pouët.net

Go to bottom

Reflections

category: general [glöplog]
 
I have been trying this shadertoy for a while and havent been able to get my reflections loop working properly https://www.shadertoy.com/view/MdtBR8 any help would be much appreciated!
Here is where the problem is
Code:for( int i = 0; i < REFLECTIONS; i++ ) { rd = reflect( rd, n ); ro = p + rd * 0.02; col += d < EPS ? sha( ro, rd ) : vec3( 0.0 ); }
Looks pretty reflecting to me?
BB Image
added on the 2018-05-03 01:52:38 by LJ LJ
It is reflecting but not like https://www.shadertoy.com/view/4s3fDH
try with shadows. and maybe add some illumination model with lights and tweak diffuse, specular components and such
added on the 2018-05-03 04:14:18 by rudi rudi
Just by judging those ~5 lines of code I think my issue might be that your material is 100% reflective with no absorption?
added on the 2018-05-03 11:52:50 by Gargaj Gargaj
Well, you have reflections, but not reflections of reflections etc., because you're calculating each of them from the original intersection position since you don't update 'p', right?
added on the 2018-05-03 12:30:20 by noby noby
if you attenuate the reflections it looks better. hard to tell if they're correct though with this scene
added on the 2018-05-03 16:23:51 by jco jco
Thanks to all, I think the problem was what noby said, now that I update p it seems to be getting the right effect. I added some specular ambient and diffuse components as well
BB Image

login

Go to top