New answers tagged voxels
2
I ended up solving this with a little of guesswork. I suppose this can be optimized further.
Matrix setup
First, some mental health. I declared a convert function:
vec3 convert(mat4 matrix, vec3 vector)
{
return (matrix * vec4(vector, 1.0)).xyz;
}
And then in the fragment shader I have my matrices like this:
mat4 ModelToWorld = Model;
mat4 ...
Top 50 recent answers are included
Related Tags
voxels × 280unity × 48
opengl × 41
minecraft-modding × 31
c# × 30
terrain × 28
xna × 27
procedural-generation × 23
3d × 22
c++ × 20
java × 17
rendering × 17
algorithm × 16
performance × 15
marching-cubes × 15
shaders × 13
collision-detection × 12
textures × 12
lighting × 12
perlin-noise × 12
octree × 12
lwjgl × 11
optimization × 10
raycasting × 10
3d-meshes × 10