mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 09:04:38 +00:00
from mar: fix the opengl cookie uv lookup
This commit is contained in:
parent
c27b9bf48f
commit
4d1395dd57
1 changed files with 5 additions and 3 deletions
|
|
@ -19,7 +19,6 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "../../../gl/hlslCompat.glsl"
|
#include "../../../gl/hlslCompat.glsl"
|
||||||
#include "farFrustumQuad.glsl"
|
#include "farFrustumQuad.glsl"
|
||||||
#include "../../shadowMap/shadowMapIO_GLSL.h"
|
#include "../../shadowMap/shadowMapIO_GLSL.h"
|
||||||
|
|
@ -116,7 +115,10 @@ void main()
|
||||||
vec3 lightCol = lightColor.rgb;
|
vec3 lightCol = lightColor.rgb;
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
vec4 cookie = texture(cookieMap, shadowCoord);
|
vec4 pxlPosLightProj = tMul( worldToLightProj, vec4( surface.P, 1 ) );
|
||||||
|
vec2 cookieCoord = ( ( pxlPosLightProj.xy / pxlPosLightProj.w ) * 0.5 ) + vec2( 0.5, 0.5 );
|
||||||
|
cookieCoord.y = 1.0f - cookieCoord.y;
|
||||||
|
vec4 cookie = texture(cookieMap, cookieCoord);
|
||||||
// Multiply the light with the cookie tex.
|
// Multiply the light with the cookie tex.
|
||||||
lightCol *= cookie.rgb;
|
lightCol *= cookie.rgb;
|
||||||
// Use a maximum channel luminance to attenuate
|
// Use a maximum channel luminance to attenuate
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue