mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 10:29:38 +02:00
Merge pull request #9149 from samcake/blue
Fix the lighting problem at the outline of the shapes
This commit is contained in:
commit
dc1b154482
1 changed files with 3 additions and 7 deletions
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
<@include LightClusterGrid.slh@>
|
<@include LightClusterGrid.slh@>
|
||||||
|
|
||||||
|
|
||||||
in vec2 _texCoord0;
|
in vec2 _texCoord0;
|
||||||
out vec4 _fragColor;
|
out vec4 _fragColor;
|
||||||
|
|
||||||
|
@ -39,16 +38,14 @@ void main(void) {
|
||||||
// Grab the fragment data from the uv
|
// Grab the fragment data from the uv
|
||||||
vec2 texCoord = _texCoord0.st;
|
vec2 texCoord = _texCoord0.st;
|
||||||
|
|
||||||
vec4 fragPosition = unpackDeferredPositionFromZeye(texCoord);
|
DeferredFrameTransform deferredTransform = getDeferredFrameTransform();
|
||||||
DeferredFragment frag = unpackDeferredFragmentNoPosition(texCoord);
|
DeferredFragment frag = unpackDeferredFragment(deferredTransform, texCoord);
|
||||||
|
vec4 fragPosition = frag.position;
|
||||||
|
|
||||||
if (frag.mode == FRAG_MODE_UNLIT) {
|
if (frag.mode == FRAG_MODE_UNLIT) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
frag.position = fragPosition;
|
|
||||||
|
|
||||||
|
|
||||||
// Frag pos in world
|
// Frag pos in world
|
||||||
mat4 invViewMat = getViewInverse();
|
mat4 invViewMat = getViewInverse();
|
||||||
vec4 fragPos = invViewMat * fragPosition;
|
vec4 fragPos = invViewMat * fragPosition;
|
||||||
|
@ -57,7 +54,6 @@ void main(void) {
|
||||||
vec4 clusterEyePos = frustumGrid_worldToEye(fragPos);
|
vec4 clusterEyePos = frustumGrid_worldToEye(fragPos);
|
||||||
ivec3 clusterPos = frustumGrid_eyeToClusterPos(clusterEyePos.xyz);
|
ivec3 clusterPos = frustumGrid_eyeToClusterPos(clusterEyePos.xyz);
|
||||||
|
|
||||||
|
|
||||||
ivec3 cluster = clusterGrid_getCluster(frustumGrid_clusterToIndex(clusterPos));
|
ivec3 cluster = clusterGrid_getCluster(frustumGrid_clusterToIndex(clusterPos));
|
||||||
int numLights = cluster.x + cluster.y;
|
int numLights = cluster.x + cluster.y;
|
||||||
if (numLights <= 0) {
|
if (numLights <= 0) {
|
||||||
|
|
Loading…
Reference in a new issue