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?


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
Just by judging those ~5 lines of code I think my issue might be that your material is 100% reflective with no absorption?
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?
if you attenuate the reflections it looks better. hard to tell if they're correct though with this scene
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
