Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

different results when trying to change from makeNoise 3times into makeNoise 1time, but trouble when using DepthFBO, Thanks!

Started by gpu Jul 22, 2024 at 11:29 PM 0 replies 2.8k views
Original Post
gpu
gpu
<pass1>:
float n1 = makeNoise(u, v);
float n2 = makeNoise(u+1.0/resolution.x, v);
float n3 = makeNoise(u, v+1.0/resolution.y);
out_FragColor.rgb = normalize(vec2(n1-n2, n1-n3), 1.0);
<pass2>:
vec3 ColorA = texture(pass1_outColor, u, v).rgb;
///////////////////////////////////////////////////////////
<pass1>:
float n1 = makeNoise(u, v);
out_FragDepth.r = n1;
<pass2>://Depth32F FBO
float n = texture(pass1_outDepth, uv).r;
float n2 = texture(pass1_outDepth, uv+vec2(1.0/resolution.x, 0.0)).r;
float n3 = texture(pass1_outDepth, uv+vec2(0.0, 1.0/resolution.y)).r;
vec3 ColorB = normalize(vec2(n-n2, n-n3), 1.0);

the above solutions got different result.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.