Jump to content
  • Advertisement
Sign in to follow this  
FSA

How to impplement roughness

This topic is 1396 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

Hello!
Currently I'm trying to implement a PBR shader. And now I want to know how you've implemented rougness. My idea is to have a cubemap with MIP levels and sample the cubemap on a certain level depending on the roughness value.

 

float3 reflectedColor = cubeMap.SampleLevel(samplerCube, R, nMips - roughness * nMips).rgb;

nMips is the number of MIP levels in the texture.

 

But this approach doesn't look so nice. You can see an example in the picture. So how did you guys do it?

 

Thanks :)

Share this post


Link to post
Share on other sites
Advertisement


My idea is to have a cubemap with MIP levels..

There's  a little missconception in your approach. Thought there is no real hard definition, PBR (physical based rendering) is more about applying physical laws, formula and approximation to rendering a surface depending on the incoming light and less about hacking until it looks good/right. The latter isn't evil, but it isnt really PBR either wink.png

 

Here's a start.

Share this post


Link to post
Share on other sites

Thank you :) Yes I know that. But how should I implement the reflectance?

Share this post


Link to post
Share on other sites

Roughness is not a factor of importance sampling..may be related, but not necessary. Importance sampling is more related to image base rendering. Roughness is usually a factor of the BRDF being used so one approach would be to pick a BRDF that allows for a roughness factor ex. the Cook-Torrance BRDF. There are plenty of papers/articles out there that covers microfacet BRDFs.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!