algorithm to generate specular & displacement maps from an image

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
MB
Licensed Customer
Posts: 168
Joined: Tue Jan 15, 2013 3:41 am
Location: Washington, D.C.
Contact:

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?
Windows 11, 2x Intel I9, 64GB Ram, 2x GTX 1080 TI, 1 x RTX 380 TI, Oculus Quest 2
User avatar
blackshore
Licensed Customer
Posts: 117
Joined: Wed Jul 31, 2013 6:22 pm

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.
User avatar
bepeg4d
Octane Guru
Posts: 10335
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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
User avatar
MB
Licensed Customer
Posts: 168
Joined: Tue Jan 15, 2013 3:41 am
Location: Washington, D.C.
Contact:

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
Windows 11, 2x Intel I9, 64GB Ram, 2x GTX 1080 TI, 1 x RTX 380 TI, Oculus Quest 2
Post Reply

Return to “Lua Scripting”