Skip to content

Commit f02b760

Browse files
committed
Clean-up base voxelization fragment shader.
1 parent e5015e9 commit f02b760

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/apps/ch11_voxel/ch11_voxel/Voxelization.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ void Voxelizer::voxelize(const scenic::SceneTree & aScene, GLuint aGridDimension
278278
glViewport(0, 0, aGridDimension, aGridDimension);
279279

280280
const auto & program = aGraph.mPrograms.mVoxelizationProgram;
281-
graphics::setUniform(program, "u_AabbDepth", maxSide);
282281

283282
GLuint query;
284283
glGenQueries(1, &query);

src/apps/ch11_voxel/ch11_voxel/resources/shaders/ch11_Voxelization.frag

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66

77
in vec3 ex_Position_view;
88

9-
uniform float u_AabbDepth;
10-
119

1210
void main(void)
1311
{
1412
// TODO: interpolate the arithmetic in floor() from the vertex shader
15-
uint z = uint(floor(-ex_Position_view.z * ub_GridDimension / u_AabbDepth));
13+
uint z = uint(gl_FragCoord.z * ub_GridDimension);
1614
ivec3 voxel = ivec3( ivec2(gl_FragCoord.xy),
1715
max(0, (ub_GridDimension - 1) - z) );
1816

0 commit comments

Comments
 (0)