algorithm to generate specular & displacement maps from an image

Forums: algorithm to generate specular & displacement maps from an image
Forum for OctaneRender Lua scripting examples, discussion and support.

algorithm to generate specular & displacement maps from an image

Postby MB » Fri Nov 03, 2017 1:40 pm

MB Fri Nov 03, 2017 1:40 pm
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 7 Enterprise, 2x Intel Xeon X5650 2.66 GHz, 24GB Ram, GTX 590, Quadro 5000, Quadro K4200
User avatar
MB
Licensed Customer
Licensed Customer
 
Posts: 119
Joined: Tue Jan 15, 2013 3:41 am
Location: Washington, D.C.

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

Postby blackshore » Sat Nov 04, 2017 10:08 am

blackshore Sat Nov 04, 2017 10:08 am
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
blackshore
Licensed Customer
Licensed Customer
 
Posts: 112
Joined: Wed Jul 31, 2013 6:22 pm

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

Postby bepeg4d » Sat Nov 04, 2017 11:18 am

bepeg4d Sat Nov 04, 2017 11:18 am
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
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6767
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

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

Postby MB » Mon Nov 06, 2017 11:22 pm

MB Mon Nov 06, 2017 11:22 pm
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 7 Enterprise, 2x Intel Xeon X5650 2.66 GHz, 24GB Ram, GTX 590, Quadro 5000, Quadro K4200
User avatar
MB
Licensed Customer
Licensed Customer
 
Posts: 119
Joined: Tue Jan 15, 2013 3:41 am
Location: Washington, D.C.

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Mon Dec 16, 2019 12:36 pm [ UTC ]