mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-03 07:51:15 +00:00
More Cg shader fixes for Mesa and Qualcomm drivers #90
This commit is contained in:
parent
a61dbbdd9f
commit
e2ad1b2989
5 changed files with 31 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Doom 3 BFG Edition GPL Source Code
|
Doom 3 BFG Edition GPL Source Code
|
||||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||||
|
Copyright (C) 2013 Robert Beckebans
|
||||||
|
|
||||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||||
|
|
||||||
|
@ -158,6 +159,14 @@ float rand( float2 co ) {
|
||||||
return frac( sin( dot( co.xy, float2( 12.9898, 78.233 ) ) ) * 43758.5453 );
|
return frac( sin( dot( co.xy, float2( 12.9898, 78.233 ) ) ) * 43758.5453 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RB begin
|
||||||
|
#ifndef PI
|
||||||
|
#define PI 3.14159265358979323846
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DEG2RAD( a ) ( ( a ) * PI / 180.0f )
|
||||||
|
#define RAD2DEG( a ) ( ( a ) * 180.0f / PI )
|
||||||
|
// RB end
|
||||||
|
|
||||||
#define _half2( x ) half2( x )
|
#define _half2( x ) half2( x )
|
||||||
#define _half3( x ) half3( x )
|
#define _half3( x ) half3( x )
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Doom 3 BFG Edition GPL Source Code
|
Doom 3 BFG Edition GPL Source Code
|
||||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||||
|
Copyright (C) 2013 Robert Beckebans
|
||||||
|
|
||||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||||
|
|
||||||
|
@ -28,7 +29,11 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
|
|
||||||
#include "global.inc"
|
#include "global.inc"
|
||||||
|
|
||||||
|
// RB: no GPU skinning with ES 2.0
|
||||||
|
#if defined(USE_GPU_SKINNING)
|
||||||
uniform matrices_ubo { float4 matrices[408]; };
|
uniform matrices_ubo { float4 matrices[408]; };
|
||||||
|
#endif
|
||||||
|
// RB end
|
||||||
|
|
||||||
uniform float4 rpUser0 : register(c128); // rpScroll
|
uniform float4 rpUser0 : register(c128); // rpScroll
|
||||||
uniform float4 rpUser1 : register(c129); // rpDeformMagnitude
|
uniform float4 rpUser1 : register(c129); // rpDeformMagnitude
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Doom 3 BFG Edition GPL Source Code
|
Doom 3 BFG Edition GPL Source Code
|
||||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||||
|
Copyright (C) 2013 Robert Beckebans
|
||||||
|
|
||||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||||
|
|
||||||
|
@ -28,7 +29,11 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
|
|
||||||
#include "global.inc"
|
#include "global.inc"
|
||||||
|
|
||||||
|
// RB: no GPU skinning with ES 2.0
|
||||||
|
#if defined(USE_GPU_SKINNING)
|
||||||
uniform matrices_ubo { float4 matrices[408]; };
|
uniform matrices_ubo { float4 matrices[408]; };
|
||||||
|
#endif
|
||||||
|
// RB end
|
||||||
|
|
||||||
uniform float4 rpUser0 : register(c128); // rpScroll
|
uniform float4 rpUser0 : register(c128); // rpScroll
|
||||||
uniform float4 rpUser1 : register(c129); // rpDeformMagnitude
|
uniform float4 rpUser1 : register(c129); // rpDeformMagnitude
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Doom 3 BFG Edition GPL Source Code
|
Doom 3 BFG Edition GPL Source Code
|
||||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||||
|
Copyright (C) 2013 Robert Beckebans
|
||||||
|
|
||||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||||
|
|
||||||
|
@ -33,7 +34,11 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
uniform float4 rpUser0 : register(c128); // rpScroll
|
uniform float4 rpUser0 : register(c128); // rpScroll
|
||||||
uniform float4 rpUser1 : register(c129); // rpDeformMagnitude
|
uniform float4 rpUser1 : register(c129); // rpDeformMagnitude
|
||||||
|
|
||||||
|
// RB: no GPU skinning with ES 2.0
|
||||||
|
#if defined(USE_GPU_SKINNING)
|
||||||
uniform matrices_ubo { float4 matrices[408]; };
|
uniform matrices_ubo { float4 matrices[408]; };
|
||||||
|
#endif
|
||||||
|
// RB end
|
||||||
|
|
||||||
struct VS_IN {
|
struct VS_IN {
|
||||||
float4 position : POSITION;
|
float4 position : POSITION;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Doom 3 BFG Edition GPL Source Code
|
Doom 3 BFG Edition GPL Source Code
|
||||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||||
|
Copyright (C) 2013 Robert Beckebans
|
||||||
|
|
||||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||||
|
|
||||||
|
@ -27,6 +28,9 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
*/
|
*/
|
||||||
|
|
||||||
float4 modelPosition = vertex.position;
|
float4 modelPosition = vertex.position;
|
||||||
|
|
||||||
|
// RB: no GPU skinning with ES 2.0
|
||||||
|
#if defined(USE_GPU_SKINNING)
|
||||||
BRANCH if ( rpEnableSkinning.x > 0.0 ) {
|
BRANCH if ( rpEnableSkinning.x > 0.0 ) {
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
// GPU transformation of the normal / binormal / bitangent
|
// GPU transformation of the normal / binormal / bitangent
|
||||||
|
@ -64,6 +68,8 @@ BRANCH if ( rpEnableSkinning.x > 0.0 ) {
|
||||||
modelPosition.z = dot4( matZ, vertex.position );
|
modelPosition.z = dot4( matZ, vertex.position );
|
||||||
modelPosition.w = 1.0;
|
modelPosition.w = 1.0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
// RB end
|
||||||
|
|
||||||
result.position.x = dot4( modelPosition, rpMVPmatrixX );
|
result.position.x = dot4( modelPosition, rpMVPmatrixX );
|
||||||
result.position.y = dot4( modelPosition, rpMVPmatrixY );
|
result.position.y = dot4( modelPosition, rpMVPmatrixY );
|
||||||
|
|
Loading…
Reference in a new issue