Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

How to impplement roughness

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1 FSA   Members   

128
Like
0Likes
Like

Posted 25 August 2014 - 06:09 AM

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

Attached Thumbnails

  • 10531381_763016030407598_3419069042699806735_o.jpg


#2 Ashaman73   Members   

13714
Like
4Likes
Like

Posted 25 August 2014 - 06:45 AM


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.


Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log


#3 FSA   Members   

128
Like
0Likes
Like

Posted 25 August 2014 - 07:47 AM

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



#4 Alundra   Members   

2270
Like
0Likes
Like

Posted 25 August 2014 - 12:17 PM

Using importance sampling, but it's very expensive, all is explained there :
http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf



#5 cgrant   Members   

1786
Like
1Likes
Like

Posted 25 August 2014 - 12:22 PM

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.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.