Skip to content
Snippets Groups Projects
Commit a3001dec authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#82] Add missing abs in shader

parent 44555c98
No related branches found
No related tags found
1 merge request!70Resolve "Voxel cone tracing"
Pipeline #25974 passed
...@@ -91,7 +91,7 @@ void main() { ...@@ -91,7 +91,7 @@ void main() {
vec3 F_out = fresnelSchlick(NoV, f0); vec3 F_out = fresnelSchlick(NoV, f0);
vec3 diffuse = lambertBRDF(albedo) * (1 - F_in) * (1 - F_out); vec3 diffuse = lambertBRDF(albedo) * (1 - F_in) * (1 - F_out);
vec3 up = N_geo.y >= 0.99 ? vec3(1, 0, 0) : vec3(0, 1, 0); vec3 up = abs(N_geo.y) >= 0.99 ? vec3(1, 0, 0) : vec3(0, 1, 0);
vec3 right = normalize(cross(up, N)); vec3 right = normalize(cross(up, N));
up = cross(N, right); up = cross(N, right);
mat3 toSurface = mat3(right, up, N); mat3 toSurface = mat3(right, up, N);
......
...@@ -32,7 +32,7 @@ void main(){ ...@@ -32,7 +32,7 @@ void main(){
float halfVoxelSize = voxelInfo.extent / float(voxelImageSize.x) * 0.5f; float halfVoxelSize = voxelInfo.extent / float(voxelImageSize.x) * 0.5f;
vec3 pos = voxelCoordinatesToWorldPosition(UV, voxelImageSize.x, voxelInfo, halfVoxelSize); vec3 pos = voxelCoordinatesToWorldPosition(UV, voxelImageSize.x, voxelInfo, halfVoxelSize);
vec3 up = N.y >= 0.99 ? vec3(1, 0, 0) : vec3(0, 1, 0); vec3 up = abs(N.y) >= 0.99 ? vec3(1, 0, 0) : vec3(0, 1, 0);
vec3 right = normalize(cross(up, N)); vec3 right = normalize(cross(up, N));
up = cross(N, right); up = cross(N, right);
mat3 toSurface = mat3(right, up, N); mat3 toSurface = mat3(right, up, N);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment