voxelcore/res/shaders
ostermine 89bdadd6aa render the world relative to an origin near the camera
World coordinates were passed to GPU as floats: u_model of a chunk and
of a model had the world translation, vertices of translucent blocks,
particles, precipitation, block wrappers, lines and 3D texts were built
in the world space, and the camera position was subtracted in shaders.
The float step grows with the distance from the world origin (6 cm at
1M blocks, 2 m at 30M): blocks got skewed, then stuck together.

Camera::getOrigin() is an integer point near the camera (X and Z are
rounded to 1024 blocks, Y is 0). Camera::getView() is relative to it,
and every position passed to GPU is "world - origin" calculated on CPU,
so the shaders keep working with small numbers and do not change:
u_cameraPos, a_modelpos, u_inverseView and the shadows matrices are in
the same space as before, shifted by the origin. Matrices of a shadow
map are converted from the origin of its camera to the origin of the
player camera. The clouds shader gets the origin wrapped by the period
of its waves, the waves stay bound to the world.

Vertices of translucent blocks are local to the chunk now, as vertices
of opaque ones, and drawn with u_model of the chunk.
2026-11-12 10:05:06 +03:00
..
effects feat: entity translucent pass & test layered transparency pipeline 2026-10-16 22:20:59 +03:00
lib gpu instanced entities renderer 2026-10-18 12:44:37 +02:00
background.glslf feat: deferred shading (day 2) 2025-07-08 23:56:22 +03:00
background.glslv feat: deferred shading (day 2) 2025-07-08 23:56:22 +03:00
clouds.glslf add clouds shader 2026-02-12 18:19:25 +03:00
clouds.glslv render the world relative to an origin near the camera 2026-11-12 10:05:06 +03:00
effect.glslf improve u_gamma support & update default dense-render-distance value 2025-07-25 21:21:18 +03:00
effect.glslv feat: post-processing effects 2025-04-05 00:41:25 +03:00
entity.glslf gpu instanced entities renderer 2026-10-18 12:44:37 +02:00
entity.glslv feat: allow passing rgba color to entity skeletons and block wraps 2026-09-16 23:28:03 +03:00
lines.glslf refactor res/shaders 2024-07-20 16:05:06 +03:00
lines.glslv refactor res/shaders 2024-07-20 16:05:06 +03:00
main.glslf update main shader 2025-12-11 23:54:23 +03:00
main.glslv add 'sky_tint', 'clouds_tint', 'min_sky_light' weather parameters 2026-02-12 20:27:29 +03:00
model.glslf gpu instanced entities renderer 2026-10-18 12:44:37 +02:00
model.glslv gpu instanced entities renderer 2026-10-18 12:44:37 +02:00
shadows.glslf initial commit 2025-05-07 20:42:50 +03:00
shadows.glslv initial commit 2025-05-07 20:42:50 +03:00
skybox_gen.glslf test 2026-10-06 22:18:07 +03:00
skybox_gen.glslv refactor res/shaders 2024-07-20 16:05:06 +03:00
translucent.glslf fix: skybox is not visible behind translucent blocks 2025-07-25 22:28:28 +03:00
translucent.glslv add 'sky_tint', 'clouds_tint', 'min_sky_light' weather parameters 2026-02-12 20:27:29 +03:00
translucent_composite.glslf feat: entity translucent pass & test layered transparency pipeline 2026-10-16 22:20:59 +03:00
translucent_composite.glslv feat: entity translucent pass & test layered transparency pipeline 2026-10-16 22:20:59 +03:00
ui.glslf refactor res/shaders 2024-07-20 16:05:06 +03:00
ui.glslv refactor res/shaders 2024-07-20 16:05:06 +03:00
ui3d.glslf refactor res/shaders 2024-07-20 16:05:06 +03:00
ui3d.glslv refactor res/shaders 2024-07-20 16:05:06 +03:00