mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-05-31 09:11:43 +00:00
Upload shadow map index for each light to main.fp
Move storage buffer binding location
This commit is contained in:
parent
d450deee76
commit
538d516c9a
5 changed files with 32 additions and 19 deletions
|
@ -108,6 +108,10 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FD
|
|||
i = 1;
|
||||
}
|
||||
|
||||
float shadowIndex = (float)GLRenderer->mShadowMap.ShadowMapIndex(light);
|
||||
if (!!(light->flags4 & MF4_ATTENUATE)) // Store attenuate flag in the sign bit of the float
|
||||
shadowIndex = -shadowIndex;
|
||||
|
||||
float *data = &ldata.arrays[i][ldata.arrays[i].Reserve(8)];
|
||||
data[0] = pos.X;
|
||||
data[1] = pos.Z;
|
||||
|
@ -116,7 +120,7 @@ bool gl_GetLight(int group, Plane & p, ADynamicLight * light, bool checkside, FD
|
|||
data[4] = r;
|
||||
data[5] = g;
|
||||
data[6] = b;
|
||||
data[7] = !!(light->flags4 & MF4_ATTENUATE);
|
||||
data[7] = shadowIndex;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue