Metals in glsl and evironment mapping

Hi,
i’m trying to realize something similiar to a metal surface with environment mapping, i need it to render a car with much realism as possible, naturally results are very poor.
These are some tries:


Someone knows how can i improve quality? or where i can find a wonderfull shader (i’ve already looked in RenderMonkey)?

Did you tried the Cook Torrance shader ?
It’s the same shader used in 3DS Max for example.
Looks good. I’ve have a version for HLSL and GLSL if you are interested.

sure i’m interested, you can send it to capedica@portalis.it or in this forum, maybe interests to others.
Thank you very much.

I’ve sent you the shader code in GLSL.

If you have question about this shader, just ask.

For information about BRDF, see here

thank you for shader, i’ve tried but this is result (im trying on a ground, as texture i use one texture and his normal map):

do you know what can be the problem?
And another question, if i want use this shader with an anvironment mapping and without texture on it do you know a way?
Thank you

For more realistic reflections you would need more dynamic range in the reflection data. A HDR reflectionmap would do nicely.
Check out this page : http://www.debevec.org/

Originally posted by capedica:
thank you for shader, i’ve tried but this is result (im trying on a ground, as texture i use one texture and his normal map):
Thank you

Can you create a screenshot on a ‘teapot’, in order to verify that is it OK ?

For environment, yes, you need just to create a 3rd (sampler3d s2 in the code) and in the pixel shader:

vec4 TexEnv = texture3D(s2, reflect(L, N));

and write the final gl_FragColor;

(d+s*t.a) * diffuse * t * TexEnv;

In your code, just load the Cube map

Hi,

I am also very interested by the shader. Also, I am sure I am not the only one interested. Would it be possible to put it on the web/forum? If not, please email it to me at bedm0203@hotmail.com.

Thanks!

P.S. High Dynamic Range Images (HDR Images) work very well for environment maps. I’ve been using them for 6 months now. You can convert the RGBE on the fly for each pixel at each frame, or you can convert it to float at load time and use float textures if your hardware supports it.

I’d like to use HDR environment map, have you got glsl code or something to learn?

Originally posted by capedica:
I’d like to use HDR environment map, have you got glsl code or something to learn?
Sample code from nVidia

For quite realistic car paints have a look at this pdf:

http://www.ati.com/developer/shaderx/ShaderX2_LayeredCarPaintShader.pdf

Hi,

I used the code from Bruce Walter in order to be able to load and convert RGBE images I computed with HDR Shop to floating point values. Once I have those values, it is pretty straight forward to convert them to floating point textures. So this is how I am doing it.

Cheers!
WyZ

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.