REVIEWED: GenTexture*() functions #721
Avoid RLGL data dependency to allow moving the functions somewhere else
This commit is contained in:
parent
7e2531fe35
commit
67dda62867
1 changed files with 5 additions and 6 deletions
11
src/rlgl.h
11
src/rlgl.h
|
@ -3700,7 +3700,7 @@ TextureCubemap rlGenTextureCubemap(Shader shader, Texture2D panorama, int size,
|
|||
rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer)
|
||||
|
||||
// Reset viewport dimensions to default
|
||||
rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight);
|
||||
rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight());
|
||||
rlEnableBackfaceCulling();
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -3773,7 +3773,7 @@ TextureCubemap rlGenTextureIrradiance(Shader shader, TextureCubemap cubemap, int
|
|||
rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer)
|
||||
|
||||
// Reset viewport dimensions to default
|
||||
rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight);
|
||||
rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight());
|
||||
rlEnableBackfaceCulling();
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -3848,7 +3848,7 @@ TextureCubemap rlGenTexturePrefilter(Shader shader, TextureCubemap cubemap, int
|
|||
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, mipWidth, mipHeight);
|
||||
|
||||
float roughness = (float)mip/(float)(MAX_MIPMAP_LEVELS - 1);
|
||||
glUniform1f(roughnessLoc, roughness);
|
||||
rlSetUniform(roughnessLoc, &roughness, SHADER_UNIFORM_FLOAT);
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
|
@ -3872,7 +3872,7 @@ TextureCubemap rlGenTexturePrefilter(Shader shader, TextureCubemap cubemap, int
|
|||
rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer)
|
||||
|
||||
// Reset viewport dimensions to default
|
||||
rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight);
|
||||
rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight());
|
||||
rlEnableBackfaceCulling();
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -3903,7 +3903,6 @@ Texture2D rlGenTextureBRDF(Shader shader, int size)
|
|||
// STEP 2: Draw to framebuffer
|
||||
//------------------------------------------------------------------------------------------
|
||||
// NOTE: Render BRDF LUT into a quad using FBO
|
||||
|
||||
rlEnableShader(shader.id);
|
||||
|
||||
rlViewport(0, 0, size, size);
|
||||
|
@ -3921,7 +3920,7 @@ Texture2D rlGenTextureBRDF(Shader shader, int size)
|
|||
rlUnloadFramebuffer(fbo); // Unload framebuffer (and automatically attached depth texture/renderbuffer)
|
||||
|
||||
// Reset viewport dimensions to default
|
||||
rlViewport(0, 0, RLGL.State.framebufferWidth, RLGL.State.framebufferHeight);
|
||||
rlViewport(0, 0, rlGetFramebufferWidth(), rlGetFramebufferHeight());
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
brdf.width = size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue