Page 1 of 1

algorithm to generate specular & displacement maps from an image

PostPosted: Fri Nov 03, 2017 1:40 pm
by MB
I have done a fair amount of reading around what a good specular map is and what a good displacement map is, but can't see good agreement among artists as to what this is.
Does any one have an opinion of what would be a good approach to generate these in code from the original diffuse/ albedo image. I'm thinking some sort of hi pass filter to generate the specular map, I'm unsure if this should be color or greyscale.
For the displacement map I'm thinking it can be a greyscale of the original stretched across the full tonal range from 0-255. Alternatively perhaps there is something that could be done to a normal map that might produce better results.

Thoughts anyone?

Re: algorithm to generate specular & displacement maps from an image

PostPosted: Sat Nov 04, 2017 10:08 am
by blackshore
With a Normal map you can generate glossiness\roughness but not specular color.
Specular is the same angle to the surface normal as the ray. So how would you possibly generate this without knowing material structure?
You might find an AI that can understand what material that you have shot and generate a specular map from it but otherwise it will be difficult.

But it seems strange that you have managed to get a albedo map but not the specular.
The image below is shot by me.
It's done with polarizers.

biird.jpg


Guide by Unreal should get you started: https://docs.unrealengine.com/udk/Three ... tures.html


With a normal map you can generate displacement. Since normal map is a 3 axis bumpmap. Depth of the photo will be important when capturing.
I think BM runs at 32bit, Canon runs at 12 or 14.

Re: algorithm to generate specular & displacement maps from an image

PostPosted: Sat Nov 04, 2017 11:18 am
by bepeg4d
Hi MB,
do you mean something like this but inside Octane?
http://awesomebump.besaba.com
Did you see the new first OSL integration in 3.08?
viewtopic.php?f=33&t=63905
ciao beppe

Re: algorithm to generate specular & displacement maps from an image

PostPosted: Mon Nov 06, 2017 11:22 pm
by MB
blackshore,

thanks for the link, very interesting. You might have given me an idea, I will attempt to implement.


bpeg4d,

yes, I'm writing something like awesomebump in lua so it can be used to make an octane material directly. It would be nice to know what algorithms they used.
I'm getting acceptable results with a hi pass filter for specular, but after reading blackshore's link I'm wondering if there is a way to negate the directional aspect of the light by using the normal map, then generating the specular for better accuracy.

best

Mark