Jump to content
  • Advertisement
Sign in to follow this  
Jim70

How accurate is this method for dictating reflectivity?

This topic is 662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First off, ill show the GLSL code:

Lighting = mix(texture(Skyboxes[int((1.0f - Roughness) * 8)], R).rgb * Color, Lighting, Roughness);

I have 9 pre-filtered sky boxes for the reflection passed to the fragment shader. So first i choose which skybox to use with "texture(Skyboxes[int((1.0f - Roughness) * 8)], R).rgb". And the Lighting variable is the fragment color after applying the lighting (none PBR). And, again i use Roughness to mix between the two. 

 

However, im doubting its accuracy. When you look into a mirror, you only see the reflection, not the "Color" of the mirror. If i remove the '* Color', it doesnt look right.

Edited by Jim70

Share this post


Link to post
Share on other sites
Advertisement

Not sure what you are asking. For strictly simulating a mirror surface that can either be purely smooth or rough and have a tint, then this kind of works. The thing to note that is wrong is that you should only have 1 skybox (cubemap) and you should be using mip-mapping and tri-linear filtering on it. Not 8 different cubemaps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!