Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Metals in glsl and evironment mapping

  1. #1
    Intern Contributor
    Join Date
    Mar 2005
    Posts
    64

    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)?

  2. #2
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: Metals in glsl and evironment mapping

    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.

  3. #3
    Intern Contributor
    Join Date
    Mar 2005
    Posts
    64

    Re: Metals in glsl and evironment mapping

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

  4. #4
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: Metals in glsl and evironment mapping

    I've sent you the shader code in GLSL.

    If you have question about this shader, just ask.

    For information about BRDF, see here

  5. #5
    Intern Contributor
    Join Date
    Mar 2005
    Posts
    64

    Re: Metals in glsl and evironment mapping

    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

  6. #6
    Junior Member Regular Contributor
    Join Date
    Feb 2004
    Posts
    249

    Re: Metals in glsl and evironment mapping

    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/

  7. #7
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: Metals in glsl and evironment mapping

    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

  8. #8
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    21

    Re: Metals in glsl and evironment mapping

    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.

  9. #9
    Intern Contributor
    Join Date
    Mar 2005
    Posts
    64

    Re: Metals in glsl and evironment mapping

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

  10. #10
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: Metals in glsl and evironment mapping

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •