add entity shader

This commit is contained in:
MihailRis
2024-07-20 17:13:03 +03:00
parent 8e159009eb
commit 4197746c69
8 changed files with 83 additions and 16 deletions
+5 -3
View File
@@ -3,9 +3,6 @@
#include <constants>
#define PI 3.1415926535897932384626433832795
#define PI2 (PI*2)
vec4 decompress_light(float compressed_light) {
vec4 result;
int compressed = floatBitsToInt(compressed_light);
@@ -24,4 +21,9 @@ vec3 pick_sky_color(samplerCube cubemap) {
return skyLightColor;
}
vec3 apply_planet_curvature(vec3 modelPos, vec3 pos3d) {
modelPos.y -= pow(length(pos3d.xz)*CURVATURE_FACTOR, 3.0);
return modelPos;
}
#endif // COMMONS_GLSL_
+3
View File
@@ -1,6 +1,9 @@
#ifndef CONSTANTS_GLSL_
#define CONSTANTS_GLSL_
#define PI 3.1415926535897932384626433832795
#define PI2 (PI*2)
// geometry
#define CURVATURE_FACTOR 0.002