23
src/RayExt.c
23
src/RayExt.c
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user