mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
Fixed Portable C versio of ShadowMap Layer Mixer
This commit is contained in:
parent
df746ab6d1
commit
87a67eccf5
19
Sources/Engine/Light/LayerMixer.cpp
Normal file → Executable file
19
Sources/Engine/Light/LayerMixer.cpp
Normal file → Executable file
|
@ -57,7 +57,6 @@ extern INDEX shd_iDithering;
|
|||
extern const UBYTE *pubClipByte;
|
||||
extern UBYTE aubSqrt[ SQRTTABLESIZE];
|
||||
extern UWORD auw1oSqrt[SQRTTABLESIZE];
|
||||
extern UWORD auw1oSqrt[SQRTTABLESIZE];
|
||||
// static FLOAT3D _v00;
|
||||
|
||||
// internal class for layer mixing
|
||||
|
@ -464,9 +463,9 @@ skipPixel:
|
|||
SLONG slL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases
|
||||
SLONG slIntensity = _slLightMax;
|
||||
slL = aubSqrt[slL];
|
||||
if( slL>_slHotSpot) slIntensity = ((255-slL)*_slLightStep)>>8;
|
||||
if( slL>_slHotSpot) slIntensity = ((255-slL)*_slLightStep);
|
||||
// add the intensity to the pixel
|
||||
AddToCluster( pubLayer, slIntensity/255.0f);
|
||||
AddToCluster( pubLayer, (slIntensity>>8)/255.0f);
|
||||
}
|
||||
// go to the next pixel
|
||||
pubLayer+=4;
|
||||
|
@ -682,9 +681,9 @@ skipPixel:
|
|||
SLONG slL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases
|
||||
SLONG slIntensity = _slLightMax;
|
||||
slL = aubSqrt[slL];
|
||||
if( slL>_slHotSpot) slIntensity = ((255-slL)*_slLightStep)>>8;
|
||||
if( slL>_slHotSpot) slIntensity = ((255-slL)*_slLightStep);
|
||||
// add the intensity to the pixel
|
||||
AddToCluster( pubLayer, slIntensity/255.0f);
|
||||
AddToCluster( pubLayer, (slIntensity>>8)/255.0f);
|
||||
}
|
||||
// go to the next pixel
|
||||
pubLayer+=4;
|
||||
|
@ -899,9 +898,10 @@ skipPixel:
|
|||
SLONG sl1oL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases
|
||||
sl1oL = auw1oSqrt[sl1oL];
|
||||
SLONG slIntensity = _slLightMax;
|
||||
if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*_slLightStep)>>16;
|
||||
if( sl1oL<256) slIntensity = 0;
|
||||
else if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*_slLightStep)/*>>16*/;
|
||||
// add the intensity to the pixel
|
||||
AddToCluster( pubLayer, slIntensity/255.0f);
|
||||
AddToCluster( pubLayer, (slIntensity>>8)/255.0f);
|
||||
}
|
||||
// advance to next pixel
|
||||
pubLayer+=4;
|
||||
|
@ -1119,9 +1119,10 @@ skipPixel:
|
|||
SLONG sl1oL = (slL2Point>>SHIFTX)&(SQRTTABLESIZE-1); // and is just for degenerate cases
|
||||
sl1oL = auw1oSqrt[sl1oL];
|
||||
SLONG slIntensity = _slLightMax;
|
||||
if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*_slLightStep)>>16;
|
||||
if( sl1oL<256) slIntensity = 0;
|
||||
else if( sl1oL<slMax1oL) slIntensity = ((sl1oL-256)*_slLightStep)/*>>16*/;
|
||||
// add the intensity to the pixel
|
||||
AddToCluster( pubLayer, slIntensity/255.0f);
|
||||
AddToCluster( pubLayer, (slIntensity>>8)/255.0f);
|
||||
}
|
||||
// advance to next pixel
|
||||
pubLayer+=4;
|
||||
|
|
Loading…
Reference in New Issue
Block a user