LOD bias cubemap shaders
This commit is contained in:
parent
2c8d63e0b4
commit
e7b79bec31
4 changed files with 11 additions and 7 deletions
|
|
@ -7,9 +7,10 @@ layout (binding = 1) uniform samplerCube samplerColor;
|
|||
|
||||
layout (location = 0) in vec3 inPos;
|
||||
layout (location = 1) in vec3 inNormal;
|
||||
layout (location = 2) in vec3 inViewVec;
|
||||
layout (location = 3) in vec3 inLightVec;
|
||||
layout (location = 4) in mat4 inInvModelView;
|
||||
layout (location = 2) in float inLodBias;
|
||||
layout (location = 3) in vec3 inViewVec;
|
||||
layout (location = 4) in vec3 inLightVec;
|
||||
layout (location = 5) in mat4 inInvModelView;
|
||||
|
||||
layout (location = 0) out vec4 outFragColor;
|
||||
|
||||
|
|
@ -20,7 +21,7 @@ void main()
|
|||
|
||||
cR = vec3(inInvModelView * vec4(cR, 0.0));
|
||||
|
||||
vec4 color = texture(samplerColor, cR);
|
||||
vec4 color = texture(samplerColor, cR, inLodBias);
|
||||
|
||||
vec3 N = normalize(inNormal);
|
||||
vec3 L = normalize(inLightVec);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -10,13 +10,15 @@ layout (binding = 0) uniform UBO
|
|||
{
|
||||
mat4 projection;
|
||||
mat4 model;
|
||||
float lodBias;
|
||||
} ubo;
|
||||
|
||||
layout (location = 0) out vec3 outPos;
|
||||
layout (location = 1) out vec3 outNormal;
|
||||
layout (location = 2) out vec3 outViewVec;
|
||||
layout (location = 3) out vec3 outLightVec;
|
||||
layout (location = 4) out mat4 outInvModelView;
|
||||
layout (location = 2) out float outLodBias;
|
||||
layout (location = 3) out vec3 outViewVec;
|
||||
layout (location = 4) out vec3 outLightVec;
|
||||
layout (location = 5) out mat4 outInvModelView;
|
||||
|
||||
out gl_PerVertex
|
||||
{
|
||||
|
|
@ -29,6 +31,7 @@ void main()
|
|||
|
||||
outPos = vec3(ubo.model * vec4(inPos, 1.0));
|
||||
outNormal = mat3(ubo.model) * inNormal;
|
||||
outLodBias = ubo.lodBias;
|
||||
|
||||
outInvModelView = inverse(ubo.model);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue