Home Unreal Engine

Generating specular maps without pre-made specular texture (Material)

grand marshal polycounter
Offline / Send Message
Obscura grand marshal polycounter
Hi, i made a little material to generate "specular maps" from the diffuse map.There are a lot of parameters, so you can really make proper specular from your diffuse map.You can manipulate the clamping min/max value,brightness, contrast for each color channel,you can invert any channel, and you can choose the merging method. I found it very useful for making specular to my hand painted scene, without any specular map.
diffusetospecularv2.jpg
diffusetospecularv2para.jpg

Let me know what you think guys. :)

Replies

  • Orgoth02
    Offline / Send Message
    Orgoth02 polycounter lvl 9
    This is like reinventing the wheel but making it a square...
  • lpcstr
    Instead of using up all these instructions trying to avoid one extra texture in the ad hoc lighting model, why not put them to better use? i.e. implement a decent physically based lighting model.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    because i want to use only one map/texture in this scene.yes, there is an alpha channel, and i could use specmaps in it, but some of my textures(like the windows) uses mask in the alpha.anyway....its only 68 instructions.a basic phong without anythning is 38.and physically based?there is no connection between the physically based lighting and this.its just a hand painted diffuse and a customizable specular, generated from the diffuse.i made it to use its instances for the other textures.
  • Hourences
    Offline / Send Message
    Hourences polycounter lvl 18
    The instruction overhead is not too gigantic, though parts of your network can be simplified. You don't need component masks at the start for example, just multiply tex coord with an append, with 2 float parameters, and the whole per channel thing is a bit much perhaps for most materials like simple bricks. I tend to do much simpler setups with just raising contrast and brightness.


    This is the way to go in general though. Making unique spec textures for everything you do is something I rarely do, generation like this is key to keeping the size on an entire game down. There are also techniques of embedding specular into normal maps (blue channel), using lower res spec textures combined with diffuse (basically this setup plus some lerps and the low res spec texture), cropped spec maps for the parts that really matter (look up the emissive crop function), etc. Also using Alpha Channels is really bad in 90% of all cases due to the lack of compression on alpha, mergemaps should be used instead.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Thanks for the tip about the tiling method.The previous worked fine, but yes, this is more simple. My TGA's are not compressed,so the alpha is working good. The reason behind this setup, is that i want to use ONLY this material, and its instances (for specular setup,changing the diffuse texture, and checking "used for window?" and if yes, is it "luminous?") for everything in my scene.Like this(updated version):
    fvdmastermatv3inst.jpg
    fvdmastermatv3.jpg
    Anyway, how could i rename my thread?because now this mat is not only doing spec...
Sign In or Register to comment.