fix some cleanup bugs

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-08-11 07:12:04 +03:00
parent ef96c51566
commit e3b2f44621
5 changed files with 34 additions and 76 deletions

View File

@@ -12,13 +12,14 @@ static char const *SKYBOX_VS = "#version 300 es\n"
"out vec3 vDir;\n"
"void main(){ vDir=vertexPosition; "
"gl_Position=mvp*vec4(vertexPosition,1.0); }\n";
static char const *SKYBOX_FS = "#version 300 es\n"
"precision highp float;\n"
"in vec3 vDir;\n"
"uniform samplerCube environmentMap;\n"
"out vec4 finalColor;\n"
"void main(){ vec3 dir=normalize(vDir); "
"finalColor=texture(environmentMap, dir); }\n";
static char const *SKYBOX_FS
= "#version 300 es\n"
"precision highp float;\n"
"in vec3 vDir;\n"
"uniform samplerCube environmentMap;\n"
"out vec4 finalColor;\n"
"void main(){ vec3 dir=normalize(vDir); "
"finalColor=vec4(texture(environmentMap, normalize(vDir)).rgb, 1.0); }\n";
#endif
void Skybox_init(Skybox *skybox, char const *fp)
@@ -96,14 +97,14 @@ void Skybox_draw(Skybox const skybox, Vector3 position)
// Render behind everything without writing depth; cull disabled so we see
// inside faces
rlDisableColorBlend();
rlDisableBackfaceCulling();
rlDisableDepthMask();
rlDisableColorBlend();
DrawModel(skybox.cube, position, 60.0f, (Color) { 255, 255, 255, 255 });
DrawModel(skybox.cube, position, 500.0f, (Color) { 255, 255, 255, 255 });
rlDrawRenderBatchActive();
rlEnableColorBlend();
rlEnableDepthMask();
rlEnableBackfaceCulling();
rlEnableColorBlend();
}