Results 1 to 6 of 6

Thread: Images ... diffuse, normal, specular

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,855

    Images ... diffuse, normal, specular

    Ok, I've been handed another possibly fun project.

    Obviously, there are many of us here who are familiar with 24-bit true-color images. And, when manipulating PNGs, TGAs, and others, we might also get an alpha channel.

    However, when these images are used as textures in a 3D environment, and we've got a video chipset powerful enough to do an advanced lighting model, we're also given the opportunity to specify a "normals" image, a "specular" image (and sometimes even others).

    Here's a webpage that illustrates what I'm talking about.

    Ok, here's my idea. Using VB6, I'd like to do what that webpage is doing. Furthermore, I'd like to do it for an image of any size. (Whether or not I make any alpha channel considerations will be of secondary consideration.)

    Please pay particular attention to the Strength, Level, & Blur/Sharp sliders. Also, the filter type and invert checkboxes are interesting.

    At this time, I'm only interested in "Normal" and "Specular". Also, at least for now, I'm not interested in the displacement slider. The cube example is pretty cool, and I hope to eventually work that out with Direct3D.

    Apparently, some NVidia software can help with some of this stuff, but I'm clueless on how to actually use that or what the API for it is.

    -------

    Any ideas are greatly appreciated.

    Elroy

    EDIT: Maybe the GDI+ has some calls to help with this ... I haven't really looked as of yet.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  2. #2
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Images ... diffuse, normal, specular

    u should definitely use direct3d, 9 or 11 or opengl.
    gdi+ should be abandoned.

  3. #3

  4. #4

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,855

    Re: Images ... diffuse, normal, specular

    .
    Ok, I'm going to try and provide a bit more focus here. How about, as a first step, we try to figure out how to take an image and then produce a new "normals" image from it (possibly having the ability to specify certain parameters), in VB6 of course. Would anyone begin to know how to do that?

    --------------------

    Now, I'll address some of the comments.

    Quote Originally Posted by baka View Post
    u should definitely use direct3d, 9 or 11 or opengl.
    gdi+ should be abandoned.
    ... and ...

    Quote Originally Posted by The trick View Post
    Do you want to use a fixed pipeline or shaders? As far as i know "normals" and "specular" FX you can make using the fixed pipeline. Also there is per-pixel lighting vs per-vertex lighting.
    ---

    Ok, I guess I see this project as having several pieces: 1) the "making" of the normals and specular images (sort of how I started this post), and 2) the actual "display" of these images (along with the corresponding diffuse image). I just put it all together because that's the way that webpage had it. And, it's my ultimate goal to have a VB6 program that's very similar to that webpage. Actually, I wouldn't mind having both a normals and a specular image (so four display areas: 1) original image, 2) normals image, 3) specular image, 4) rotating cube showing results. Basically:

    • Load a typical (diffuse) image of something.
    • When an image is loaded, have it produce both a normals and specular image from it.
    • Tweak on Strength, Level, & Blur/Sharp for each of those.
    • Maybe mess with the actual filter used and/or invert certain things.
    • View the final rotating cube and keep tweaking until it's to my liking.
    • Export both the normals and specular images to do with what I like.

    Trick, I've definitely got a learning curve in front of me. I tried to google "fixed pipeline" and "shaders", but I'm not even sure what the difference is. I guess most of these are OpenGL terms. I was hoping to stick with Direct3D, but I may need to jump over to OpenGL to do this stuff.

    Baka, I'm not sure I see the GDI+ and either Direct3D or OpenGL as mutually exclusive. I do see Direct3D and OpenGL as mutually exclusive. However, either of those might make use of images (i.e., textures) produced via GDI+ and use them for normals or specular, or am I missing something?

    Take Care,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  5. #5
    PowerPoster
    Join Date
    Feb 2015
    Posts
    2,673

    Re: Images ... diffuse, normal, specular

    Trick, I've definitely got a learning curve in front of me. I tried to google "fixed pipeline" and "shaders", but I'm not even sure what the difference is. I guess most of these are OpenGL terms. I was hoping to stick with Direct3D, but I may need to jump over to OpenGL to do this stuff.
    Shaders are related to any 3d rendering engine.
    If you don't mind to use D3DX you could use D3DXComputeNormalMap which computes a normal map from a height map. You could use the Sobel operator to compute a gradient as well and then use normalization to produce normal map.

    The specular map is computed using this code which is quite simple.

  6. #6

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,855

    Re: Images ... diffuse, normal, specular

    Quote Originally Posted by The trick View Post
    Shaders are related to any 3d rendering engine.
    If you don't mind to use D3DX you could use D3DXComputeNormalMap which computes a normal map from a height map. You could use the Sobel operator to compute a gradient as well and then use normalization to produce normal map.

    The specular map is computed using this code which is quite simple.
    Ahhh, thank you, Trick! I knew there were some answers to this stuff. I'll be trying to make some headway on this shortly.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width