Updated the SDK with the latest code from the TF and HL2 branches.
This commit is contained in:
@@ -11,8 +11,11 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "strtools.h"
|
||||
#include "steam/steamclientpublic.h"
|
||||
#if !defined( INCLUDED_STEAM_STEAMUSERIDTYPES_H )
|
||||
#include "SteamCommon.h"
|
||||
#define INCLUDED_STEAM2_USERID_STRUCTS
|
||||
#include "SteamCommon.h"
|
||||
#endif
|
||||
|
||||
#define IDTYPE_WON 0
|
||||
@@ -23,13 +26,7 @@
|
||||
typedef struct USERID_s
|
||||
{
|
||||
int idtype;
|
||||
|
||||
union
|
||||
{
|
||||
TSteamGlobalUserID steamid;
|
||||
} uid;
|
||||
|
||||
// unsigned int clientip;
|
||||
CSteamID steamid;
|
||||
} USERID_t;
|
||||
|
||||
#endif // USERID_H
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
pushd %~dp0
|
||||
devtools\bin\vpc.exe /hl2 /episodic +everything /mksln everything.sln
|
||||
popd
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
pushd %~dp0
|
||||
devtools\bin\vpc.exe /hl2 /episodic +game /mksln games.sln
|
||||
popd
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -261,8 +261,6 @@ CClientVirtualReality::CClientVirtualReality()
|
||||
m_rtLastMotionSample = 0;
|
||||
m_bMotionUpdated = false;
|
||||
|
||||
m_bForceVRMode = false;
|
||||
|
||||
#if defined( USE_SDL )
|
||||
m_nNonVRSDLDisplayIndex = 0;
|
||||
#endif
|
||||
@@ -1367,7 +1365,7 @@ void CClientVirtualReality::Activate()
|
||||
return;
|
||||
|
||||
// These checks don't apply if we're in VR mode because Steam said so.
|
||||
if ( !m_bForceVRMode )
|
||||
if ( !ShouldForceVRActive() )
|
||||
{
|
||||
// see if VR mode is even enabled
|
||||
if ( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter == -1 )
|
||||
@@ -1441,7 +1439,7 @@ void CClientVirtualReality::Activate()
|
||||
vgui::ivgui()->SetVRMode( true );
|
||||
|
||||
// we can skip this extra mode change if we've always been in VR mode
|
||||
if ( !m_bForceVRMode )
|
||||
if ( !ShouldForceVRActive() )
|
||||
{
|
||||
VRRect_t rect;
|
||||
if ( g_pSourceVR->GetDisplayBounds( &rect ) )
|
||||
@@ -1510,10 +1508,7 @@ void CClientVirtualReality::Deactivate()
|
||||
// Called when startup is complete
|
||||
void CClientVirtualReality::StartupComplete()
|
||||
{
|
||||
if ( g_pSourceVR )
|
||||
m_bForceVRMode = g_pSourceVR->ShouldForceVRMode();
|
||||
|
||||
if ( vr_activate_default.GetBool( ) || m_bForceVRMode )
|
||||
if ( vr_activate_default.GetBool() || ShouldForceVRActive() )
|
||||
Activate();
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,6 @@ private:
|
||||
int m_iAlignTorsoAndViewToWeaponCountdown;
|
||||
|
||||
bool m_bMotionUpdated;
|
||||
bool m_bForceVRMode;
|
||||
|
||||
RTime32 m_rtLastMotionSample;
|
||||
|
||||
|
||||
@@ -281,7 +281,11 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa
|
||||
Q_snprintf( szBuffer,
|
||||
sizeof(szBuffer),
|
||||
"(%0.2f) output: (%s,%s) -> (%s,%s,%.1f)(%s)\n",
|
||||
#ifdef TF_DLL
|
||||
engine->GetServerTime(),
|
||||
#else
|
||||
gpGlobals->curtime,
|
||||
#endif
|
||||
pCaller ? STRING(pCaller->m_iClassname) : "NULL",
|
||||
pCaller ? STRING(pCaller->GetEntityName()) : "NULL",
|
||||
STRING(ev->m_iTarget),
|
||||
@@ -298,7 +302,11 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa
|
||||
Q_snprintf( szBuffer,
|
||||
sizeof(szBuffer),
|
||||
"(%0.2f) output: (%s,%s) -> (%s,%s)(%s)\n",
|
||||
#ifdef TF_DLL
|
||||
engine->GetServerTime(),
|
||||
#else
|
||||
gpGlobals->curtime,
|
||||
#endif
|
||||
pCaller ? STRING(pCaller->m_iClassname) : "NULL",
|
||||
pCaller ? STRING(pCaller->GetEntityName()) : "NULL", STRING(ev->m_iTarget),
|
||||
STRING(ev->m_iTargetInput),
|
||||
@@ -767,7 +775,13 @@ void CEventQueue::Dump( void )
|
||||
{
|
||||
EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext;
|
||||
|
||||
Msg( "Dumping event queue. Current time is: %.2f\n", engine->GetServerTime() );
|
||||
Msg("Dumping event queue. Current time is: %.2f\n",
|
||||
#ifdef TF_DLL
|
||||
engine->GetServerTime()
|
||||
#else
|
||||
gpGlobals->curtime
|
||||
#endif
|
||||
);
|
||||
|
||||
while ( pe != NULL )
|
||||
{
|
||||
@@ -795,7 +809,11 @@ void CEventQueue::AddEvent( const char *target, const char *targetInput, variant
|
||||
{
|
||||
// build the new event
|
||||
EventQueuePrioritizedEvent_t *newEvent = new EventQueuePrioritizedEvent_t;
|
||||
#ifdef TF_DLL
|
||||
newEvent->m_flFireTime = engine->GetServerTime() + fireDelay; // priority key in the priority queue
|
||||
#else
|
||||
newEvent->m_flFireTime = gpGlobals->curtime + fireDelay; // priority key in the priority queue
|
||||
#endif
|
||||
newEvent->m_iTarget = MAKE_STRING( target );
|
||||
newEvent->m_pEntTarget = NULL;
|
||||
newEvent->m_iTargetInput = MAKE_STRING( targetInput );
|
||||
@@ -814,7 +832,11 @@ void CEventQueue::AddEvent( CBaseEntity *target, const char *targetInput, varian
|
||||
{
|
||||
// build the new event
|
||||
EventQueuePrioritizedEvent_t *newEvent = new EventQueuePrioritizedEvent_t;
|
||||
#ifdef TF_DLL
|
||||
newEvent->m_flFireTime = engine->GetServerTime() + fireDelay; // primary priority key in the priority queue
|
||||
#else
|
||||
newEvent->m_flFireTime = gpGlobals->curtime + fireDelay; // primary priority key in the priority queue
|
||||
#endif
|
||||
newEvent->m_iTarget = NULL_STRING;
|
||||
newEvent->m_pEntTarget = target;
|
||||
newEvent->m_iTargetInput = MAKE_STRING( targetInput );
|
||||
@@ -885,7 +907,11 @@ void CEventQueue::ServiceEvents( void )
|
||||
|
||||
EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext;
|
||||
|
||||
#ifdef TF_DLL
|
||||
while ( pe != NULL && pe->m_flFireTime <= engine->GetServerTime() )
|
||||
#else
|
||||
while ( pe != NULL && pe->m_flFireTime <= gpGlobals->curtime )
|
||||
#endif
|
||||
{
|
||||
MDLCACHE_CRITICAL_SECTION();
|
||||
|
||||
@@ -1171,7 +1197,11 @@ int CEventQueue::Restore( IRestore &restore )
|
||||
AddEvent( tmpEvent.m_pEntTarget,
|
||||
STRING(tmpEvent.m_iTargetInput),
|
||||
tmpEvent.m_VariantValue,
|
||||
#ifdef TF_DLL
|
||||
tmpEvent.m_flFireTime - engine->GetServerTime(),
|
||||
#else
|
||||
tmpEvent.m_flFireTime - gpGlobals->curtime,
|
||||
#endif
|
||||
tmpEvent.m_pActivator,
|
||||
tmpEvent.m_pCaller,
|
||||
tmpEvent.m_iOutputID );
|
||||
@@ -1181,7 +1211,11 @@ int CEventQueue::Restore( IRestore &restore )
|
||||
AddEvent( STRING(tmpEvent.m_iTarget),
|
||||
STRING(tmpEvent.m_iTargetInput),
|
||||
tmpEvent.m_VariantValue,
|
||||
#ifdef TF_DLL
|
||||
tmpEvent.m_flFireTime - engine->GetServerTime(),
|
||||
#else
|
||||
tmpEvent.m_flFireTime - gpGlobals->curtime,
|
||||
#endif
|
||||
tmpEvent.m_pActivator,
|
||||
tmpEvent.m_pCaller,
|
||||
tmpEvent.m_iOutputID );
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,18 +1,18 @@
|
||||
ps.1.1
|
||||
|
||||
// 1221 filter constants
|
||||
def c0, 0.1667f, 0.1667f, 0.1667f, 0.3333f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0.rgb, t0, c0
|
||||
mad r0.rgb, t1, c0.a, r0
|
||||
mad r0.rgb, t2, c0.a, r0
|
||||
mad r0.rgb, t3, c0, r0
|
||||
|
||||
mul r0.rgb, r0, c1 +
|
||||
mov r0.a, t0.a
|
||||
|
||||
ps.1.1
|
||||
|
||||
// 1221 filter constants
|
||||
def c0, 0.1667f, 0.1667f, 0.1667f, 0.3333f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0.rgb, t0, c0
|
||||
mad r0.rgb, t1, c0.a, r0
|
||||
mad r0.rgb, t2, c0.a, r0
|
||||
mad r0.rgb, t3, c0, r0
|
||||
|
||||
mul r0.rgb, r0, c1 +
|
||||
mov r0.a, t0.a
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; See the vertex shader for info
|
||||
;
|
||||
; This shader takes:
|
||||
; t0 = normal map
|
||||
; t1 = base texture
|
||||
; v0 = directional light color
|
||||
; t2 = directional light direction (biased into 0-1)
|
||||
; c0 = percent of dirlight to add as ambient
|
||||
;
|
||||
; Output:
|
||||
; (t0 dot t1) * v0
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; Get the 3-vector from the normal map
|
||||
tex t1 ; Interpret tcoord t1 as color data.
|
||||
texcoord t2
|
||||
|
||||
dp3 r1, t0_bx2, t2_bx2 ; r1 = normalMap dot dirLightDir
|
||||
add r0, r1, c0 ; + 0.5
|
||||
|
||||
mul r1, v0, r0 ; scale the dot product by the dirlight's actual color
|
||||
mul r0.rgb, r1, t1 + ; scale by the texture color
|
||||
|
||||
mul r0.a, t1.a, v0.a
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; See the vertex shader for info
|
||||
;
|
||||
; This shader takes:
|
||||
; t0 = normal map
|
||||
; t1 = base texture
|
||||
; v0 = directional light color
|
||||
; t2 = directional light direction (biased into 0-1)
|
||||
; c0 = percent of dirlight to add as ambient
|
||||
;
|
||||
; Output:
|
||||
; (t0 dot t1) * v0
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; Get the 3-vector from the normal map
|
||||
tex t1 ; Interpret tcoord t1 as color data.
|
||||
texcoord t2
|
||||
|
||||
dp3 r1, t0_bx2, t2_bx2 ; r1 = normalMap dot dirLightDir
|
||||
add r0, r1, c0 ; + 0.5
|
||||
|
||||
mul r1, v0, r0 ; scale the dot product by the dirlight's actual color
|
||||
mul r0.rgb, r1, t1 + ; scale by the texture color
|
||||
|
||||
mul r0.a, t1.a, v0.a
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw the eyes
|
||||
; t0 - texture
|
||||
; t1 - iris
|
||||
; t2 - glint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
|
||||
mad r0.rgb, r0, v0, t2 + ; Modulate by the illumination, add in the glint
|
||||
mov r0.a, t0.a
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw the eyes
|
||||
; t0 - texture
|
||||
; t1 - iris
|
||||
; t2 - glint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
|
||||
mad r0.rgb, r0, v0, t2 + ; Modulate by the illumination, add in the glint
|
||||
mov r0.a, t0.a
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw the eyes
|
||||
; t0 - texture
|
||||
; t1 - iris
|
||||
; t2 - glint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
|
||||
mul_x2 r0, v0, r0 ; Modulate by the illumination with overbright
|
||||
|
||||
add r0.rgb, r0, t2 + ; Add in the glint
|
||||
mov r0.a, t0.a
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw the eyes
|
||||
; t0 - texture
|
||||
; t1 - iris
|
||||
; t2 - glint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
lrp r0, t1.a, t1, t0 ; Blend in the iris with the background
|
||||
mul_x2 r0, v0, r0 ; Modulate by the illumination with overbright
|
||||
|
||||
add r0.rgb, r0, t2 + ; Add in the glint
|
||||
mov r0.a, t0.a
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t2 ; cube map
|
||||
tex t3 ; envmap mask
|
||||
|
||||
mul r0.rgb, t2, 1-t3.a
|
||||
mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
+ mul r0.a, c2.a, v0.a
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t2 ; cube map
|
||||
tex t3 ; envmap mask
|
||||
|
||||
mul r0.rgb, t2, 1-t3.a
|
||||
mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
+ mul r0.a, c2.a, v0.a
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t2 ; cube map
|
||||
tex t3 ; envmap mask
|
||||
|
||||
mul r0.rgb, t2, t3
|
||||
mul r0.rgb, c2, r0
|
||||
+ mul r0.a, c2.a, v0.a
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t2 ; cube map
|
||||
tex t3 ; envmap mask
|
||||
|
||||
mul r0.rgb, t2, t3
|
||||
mul r0.rgb, c2, r0
|
||||
+ mul r0.a, c2.a, v0.a
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t2 ; cube map
|
||||
|
||||
mul r0.rgb, t2, c2
|
||||
+ mul r0.a, v0.a, c2.a
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t2 ; cube map
|
||||
|
||||
mul r0.rgb, t2, c2
|
||||
+ mul r0.a, v0.a, c2.a
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
mul r1, t2, 1-t3.a ; envmap * envmapmask (alpha)
|
||||
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
mul r1, t2, 1-t3.a ; envmap * envmapmask (alpha)
|
||||
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the color from the texture
|
||||
tex t0
|
||||
mul r0, t0, c0
|
||||
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the color from the texture
|
||||
tex t0
|
||||
mul r0, t0, c0
|
||||
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Environment mapping on a bumped surface
|
||||
; t0 - Normalmap
|
||||
; t3 - Cube environment map (*must* be a cube map!)
|
||||
;
|
||||
; c0 - color to multiply the results by
|
||||
; c1 - envmap contrast
|
||||
; c2 - envmap saturation
|
||||
; c3 - grey weights
|
||||
; c4 - fresnel amount
|
||||
; Input texture coords required here are a little wonky.
|
||||
; tc0.uv <- U,V into the normal map
|
||||
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
|
||||
; from tangent space->env map space
|
||||
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
tex t0
|
||||
|
||||
; Perform matrix multiply to get a local normal bump. Then
|
||||
; reflect the eye vector through the normal and sample from
|
||||
; a cubic environment map.
|
||||
texm3x3pad t1, t0_bx2
|
||||
texm3x3pad t2, t0_bx2
|
||||
texm3x3vspec t3, t0_bx2
|
||||
|
||||
; FIXME FIXME - Need to do specialized versions of this with and without:
|
||||
; - constant color
|
||||
; - fresnel amount of exactly 0 or 1 or in between
|
||||
; - envmap contrast of 0, 1, or in between
|
||||
; - envmap saturation of 0, 1, or in between
|
||||
|
||||
; r0 = constant color * result of bump into envmap
|
||||
mul r0.rgb, t3, c0
|
||||
|
||||
; dot eye-vector with per-pixel normal from t0
|
||||
dp3_sat r1, v0_bx2, t0_bx2
|
||||
|
||||
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
|
||||
mul r1.rgb, r0, r0 ; color squared
|
||||
+mul r0.a, 1-r1.a, 1-r1.a ; squared
|
||||
|
||||
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
|
||||
+mul r0.a, r0.a, r0.a ; quartic
|
||||
|
||||
dp3 r1.rgb, r0, c3 ; color greyscaled
|
||||
+mul r0.a, r0.a, 1-r1.a ; quintic
|
||||
|
||||
; FIXME - these should be able to pair (I think), but don't on nvidia for some reason.
|
||||
; (I think) cannot pair due to use of >2 constants in single stage
|
||||
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
|
||||
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
|
||||
|
||||
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
|
||||
|
||||
#if NORMALMAPALPHAENVMAPMASK
|
||||
+mul r0.a, c0.a, t0.a ; Fade amount * alpha from the texture
|
||||
#else
|
||||
+mov r0.a, c0.a ; Just use the fade amount
|
||||
#endif
|
||||
|
||||
|
||||
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Environment mapping on a bumped surface
|
||||
; t0 - Normalmap
|
||||
; t3 - Cube environment map (*must* be a cube map!)
|
||||
;
|
||||
; c0 - color to multiply the results by
|
||||
; c1 - envmap contrast
|
||||
; c2 - envmap saturation
|
||||
; c3 - grey weights
|
||||
; c4 - fresnel amount
|
||||
; Input texture coords required here are a little wonky.
|
||||
; tc0.uv <- U,V into the normal map
|
||||
; tc1.uvw, tc2.uvw, tc3.uvw <- 3x3 matrix transform
|
||||
; from tangent space->env map space
|
||||
; tc1.q, tc2.q, tc3.q <- eye vector in env map space
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
tex t0
|
||||
|
||||
; Perform matrix multiply to get a local normal bump. Then
|
||||
; reflect the eye vector through the normal and sample from
|
||||
; a cubic environment map.
|
||||
texm3x3pad t1, t0_bx2
|
||||
texm3x3pad t2, t0_bx2
|
||||
texm3x3vspec t3, t0_bx2
|
||||
|
||||
; FIXME FIXME - Need to do specialized versions of this with and without:
|
||||
; - constant color
|
||||
; - fresnel amount of exactly 0 or 1 or in between
|
||||
; - envmap contrast of 0, 1, or in between
|
||||
; - envmap saturation of 0, 1, or in between
|
||||
|
||||
; r0 = constant color * result of bump into envmap
|
||||
mul r0.rgb, t3, c0
|
||||
|
||||
; dot eye-vector with per-pixel normal from t0
|
||||
dp3_sat r1, v0_bx2, t0_bx2
|
||||
|
||||
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
|
||||
mul r1.rgb, r0, r0 ; color squared
|
||||
+mul r0.a, 1-r1.a, 1-r1.a ; squared
|
||||
|
||||
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
|
||||
+mul r0.a, r0.a, r0.a ; quartic
|
||||
|
||||
dp3 r1.rgb, r0, c3 ; color greyscaled
|
||||
+mul r0.a, r0.a, 1-r1.a ; quintic
|
||||
|
||||
; FIXME - these should be able to pair (I think), but don't on nvidia for some reason.
|
||||
; (I think) cannot pair due to use of >2 constants in single stage
|
||||
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
|
||||
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
|
||||
|
||||
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
|
||||
|
||||
#if NORMALMAPALPHAENVMAPMASK
|
||||
+mul r0.a, c0.a, t0.a ; Fade amount * alpha from the texture
|
||||
#else
|
||||
+mov r0.a, c0.a ; Just use the fade amount
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,72 +1,72 @@
|
||||
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
|
||||
ps.1.4
|
||||
;------------------------------------------------------------------------------
|
||||
; Phase 1
|
||||
;------------------------------------------------------------------------------
|
||||
; Get the 3-vector from the normal map
|
||||
texld r0, t0
|
||||
; Get environment matrix
|
||||
texcrd r1.rgb, t1
|
||||
texcrd r2.rgb, t2
|
||||
texcrd r3.rgb, t3
|
||||
; Normalize eye-ray vector through normalizer cube map
|
||||
texld r4, t4 ; <---- CUBE MAP here!!!
|
||||
;mov r0.rgba, r4
|
||||
|
||||
; Transform normal
|
||||
dp3 r5.r, r1, r0_bx2
|
||||
dp3 r5.g, r2, r0_bx2
|
||||
dp3 r5.b, r3, r0_bx2
|
||||
; Reflection calculatiom
|
||||
dp3_x2 r3.rgb, r5, r4_bx2 ; 2(N.Eye)
|
||||
mul r3.rgb, r5, r3 ; 2N(N.Eye)
|
||||
dp3 r2.rgb, r5, r5 ; N.N
|
||||
mad r2.rgb, -r4_bx2, r2, r3 ; 2N(N.Eye) - Eye(N.N)
|
||||
|
||||
#if NORMALMAPALPHAENVMAPMASK
|
||||
; Alpha gets lost after phase marker, so store it here
|
||||
mov r5, r0.a
|
||||
#endif
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Phase 2
|
||||
;------------------------------------------------------------------------------
|
||||
; What's left over from the last phase:
|
||||
; r0 - normal
|
||||
; r1 - free
|
||||
; r2 - vector to sample in envmap
|
||||
; r3 - free
|
||||
; r4 - normal
|
||||
; r5 - normal map alpha (rgba)
|
||||
|
||||
phase
|
||||
|
||||
; Sample environment map
|
||||
texld r3, r2
|
||||
|
||||
; dot eye-vector with per-pixel normal from r0
|
||||
dp3_sat r1, v0_bx2, r0_bx2
|
||||
|
||||
; Result goes in output color (multiply by constant color c0)
|
||||
mul r0.rgb, r3, c0
|
||||
|
||||
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
|
||||
mul r1.rgb, r0, r0
|
||||
+mul r0.a, 1-r1.a, 1-r1.a ; squared
|
||||
|
||||
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
|
||||
+mul r0.a, r0.a, r0.a ; quartic
|
||||
|
||||
dp3 r1.rgb, r0, c3
|
||||
+mul r0.a, r0.a, 1-r1.a ; quintic
|
||||
|
||||
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
|
||||
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
|
||||
|
||||
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
|
||||
|
||||
#if NORMALMAPALPHAENVMAPMASK
|
||||
+mul r0.a, c0.a, r5.r ; Fade amount * alpha from the texture
|
||||
#else
|
||||
+mov r0.a, c0.a ; Just use the fade amount
|
||||
#endif
|
||||
; STATIC: "NORMALMAPALPHAENVMAPMASK" "0..1"
|
||||
ps.1.4
|
||||
;------------------------------------------------------------------------------
|
||||
; Phase 1
|
||||
;------------------------------------------------------------------------------
|
||||
; Get the 3-vector from the normal map
|
||||
texld r0, t0
|
||||
; Get environment matrix
|
||||
texcrd r1.rgb, t1
|
||||
texcrd r2.rgb, t2
|
||||
texcrd r3.rgb, t3
|
||||
; Normalize eye-ray vector through normalizer cube map
|
||||
texld r4, t4 ; <---- CUBE MAP here!!!
|
||||
;mov r0.rgba, r4
|
||||
|
||||
; Transform normal
|
||||
dp3 r5.r, r1, r0_bx2
|
||||
dp3 r5.g, r2, r0_bx2
|
||||
dp3 r5.b, r3, r0_bx2
|
||||
; Reflection calculatiom
|
||||
dp3_x2 r3.rgb, r5, r4_bx2 ; 2(N.Eye)
|
||||
mul r3.rgb, r5, r3 ; 2N(N.Eye)
|
||||
dp3 r2.rgb, r5, r5 ; N.N
|
||||
mad r2.rgb, -r4_bx2, r2, r3 ; 2N(N.Eye) - Eye(N.N)
|
||||
|
||||
#if NORMALMAPALPHAENVMAPMASK
|
||||
; Alpha gets lost after phase marker, so store it here
|
||||
mov r5, r0.a
|
||||
#endif
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Phase 2
|
||||
;------------------------------------------------------------------------------
|
||||
; What's left over from the last phase:
|
||||
; r0 - normal
|
||||
; r1 - free
|
||||
; r2 - vector to sample in envmap
|
||||
; r3 - free
|
||||
; r4 - normal
|
||||
; r5 - normal map alpha (rgba)
|
||||
|
||||
phase
|
||||
|
||||
; Sample environment map
|
||||
texld r3, r2
|
||||
|
||||
; dot eye-vector with per-pixel normal from r0
|
||||
dp3_sat r1, v0_bx2, r0_bx2
|
||||
|
||||
; Result goes in output color (multiply by constant color c0)
|
||||
mul r0.rgb, r3, c0
|
||||
|
||||
; run Fresnel approx. on it: R0 + (1-R0) (1-cos(q))^5 in alpha channel
|
||||
mul r1.rgb, r0, r0
|
||||
+mul r0.a, 1-r1.a, 1-r1.a ; squared
|
||||
|
||||
lrp r0.rgb, c1, r1, r0 ; blend between color and color * color
|
||||
+mul r0.a, r0.a, r0.a ; quartic
|
||||
|
||||
dp3 r1.rgb, r0, c3
|
||||
+mul r0.a, r0.a, 1-r1.a ; quintic
|
||||
|
||||
lrp r0.rgb, c2, r0, r1 ; blend between color and greyscale
|
||||
mad r0.a, r0.a, c6.a, c4.a ; Take Fresnel R(0) into consideration
|
||||
|
||||
mul r0.rgb, r0, r0.a ; multiply output color by result of fresnel calc
|
||||
|
||||
#if NORMALMAPALPHAENVMAPMASK
|
||||
+mul r0.a, c0.a, r5.r ; Fade amount * alpha from the texture
|
||||
#else
|
||||
+mov r0.a, c0.a ; Just use the fade amount
|
||||
#endif
|
||||
|
||||
@@ -1,79 +1,79 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
tex t0
|
||||
|
||||
; Sample the lightmaps
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
; output = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) +
|
||||
|
||||
; r0 = ( N dot basis[0] )
|
||||
; don't "_sat" here so that everything adds up to one even if the normal is outside of the basis!!!!!
|
||||
dp3 r0, t0_bx2, c0
|
||||
|
||||
; r1 = ( N dot basis[1] )
|
||||
dp3 r1, t0_bx2, c1
|
||||
|
||||
;----
|
||||
; r0 = ( N dot basis[0] )
|
||||
; r1 = ( N dot basis[1] )
|
||||
;----
|
||||
|
||||
; r0.rgb = ( N dot basis[0] )^2
|
||||
mul r0.rgb, r0, r0
|
||||
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
+mul r1.a, r1, r1
|
||||
|
||||
;----
|
||||
; r0.rgb = ( N dot basis[0] )^2
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
;----
|
||||
|
||||
mul t1, r0, t1
|
||||
|
||||
;----
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
; t1 = lightmapColor[0] * ( N dot basis[0] )^2
|
||||
;----
|
||||
|
||||
dp3 r0, t0_bx2, c2
|
||||
|
||||
;----
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
; t1 = lightmapColor[0] * ( N dot basis[0] )^2
|
||||
; r0 = ( N dot basis[2] )
|
||||
;----
|
||||
|
||||
mad t1.rgb, r1.a, t2, t1
|
||||
+mul r0.a, r0, r0
|
||||
|
||||
;----
|
||||
; t1.rgb = lightmapColor[0] * ( N dot basis[0] )^2 + lightmapColor[1] * ( N dot basis[1] )^2
|
||||
; r0.a = ( N dot basis[2] )^2
|
||||
;----
|
||||
|
||||
mad r0.rgba, r0.a, t3, t1
|
||||
|
||||
;----
|
||||
; r0.rgb = lightmapColor[0] * ( N dot basis[0] )^2 +
|
||||
; lightmapColor[1] * ( N dot basis[1] )^2 +
|
||||
; lightmapColor[2] * ( N dot basis[2] )^2
|
||||
;----
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
tex t0
|
||||
|
||||
; Sample the lightmaps
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
; output = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) +
|
||||
|
||||
; r0 = ( N dot basis[0] )
|
||||
; don't "_sat" here so that everything adds up to one even if the normal is outside of the basis!!!!!
|
||||
dp3 r0, t0_bx2, c0
|
||||
|
||||
; r1 = ( N dot basis[1] )
|
||||
dp3 r1, t0_bx2, c1
|
||||
|
||||
;----
|
||||
; r0 = ( N dot basis[0] )
|
||||
; r1 = ( N dot basis[1] )
|
||||
;----
|
||||
|
||||
; r0.rgb = ( N dot basis[0] )^2
|
||||
mul r0.rgb, r0, r0
|
||||
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
+mul r1.a, r1, r1
|
||||
|
||||
;----
|
||||
; r0.rgb = ( N dot basis[0] )^2
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
;----
|
||||
|
||||
mul t1, r0, t1
|
||||
|
||||
;----
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
; t1 = lightmapColor[0] * ( N dot basis[0] )^2
|
||||
;----
|
||||
|
||||
dp3 r0, t0_bx2, c2
|
||||
|
||||
;----
|
||||
; r1.a = ( N dot basis[1] )^2
|
||||
; t1 = lightmapColor[0] * ( N dot basis[0] )^2
|
||||
; r0 = ( N dot basis[2] )
|
||||
;----
|
||||
|
||||
mad t1.rgb, r1.a, t2, t1
|
||||
+mul r0.a, r0, r0
|
||||
|
||||
;----
|
||||
; t1.rgb = lightmapColor[0] * ( N dot basis[0] )^2 + lightmapColor[1] * ( N dot basis[1] )^2
|
||||
; r0.a = ( N dot basis[2] )^2
|
||||
;----
|
||||
|
||||
mad r0.rgba, r0.a, t3, t1
|
||||
|
||||
;----
|
||||
; r0.rgb = lightmapColor[0] * ( N dot basis[0] )^2 +
|
||||
; lightmapColor[1] * ( N dot basis[1] )^2 +
|
||||
; lightmapColor[2] * ( N dot basis[2] )^2
|
||||
;----
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
; t4 - Base
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
|
||||
;------------------------------------------------------------------------------
|
||||
ps.1.4
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
texld r0, t0
|
||||
|
||||
; Sample the lightmaps
|
||||
texld r1, t1
|
||||
texld r2, t2
|
||||
texld r3, t3
|
||||
|
||||
; Sample the base texture
|
||||
texld r4, t4
|
||||
|
||||
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * base
|
||||
|
||||
dp3 r5.r, r0_bx2, c0
|
||||
dp3 r5.g, r0_bx2, c1
|
||||
dp3 r5.b, r0_bx2, c2
|
||||
mul r5.rgb, r5, r5
|
||||
mul r1, r1, r5.r
|
||||
mad r1, r2, r5.g, r1
|
||||
mad r1, r3, r5.g, r1
|
||||
|
||||
; assume overbright_2 !!!
|
||||
mul_x2 r0, r1, r4
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
; t4 - Base
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
|
||||
;------------------------------------------------------------------------------
|
||||
ps.1.4
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
texld r0, t0
|
||||
|
||||
; Sample the lightmaps
|
||||
texld r1, t1
|
||||
texld r2, t2
|
||||
texld r3, t3
|
||||
|
||||
; Sample the base texture
|
||||
texld r4, t4
|
||||
|
||||
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * base
|
||||
|
||||
dp3 r5.r, r0_bx2, c0
|
||||
dp3 r5.g, r0_bx2, c1
|
||||
dp3 r5.b, r0_bx2, c2
|
||||
mul r5.rgb, r5, r5
|
||||
mul r1, r1, r5.r
|
||||
mad r1, r2, r5.g, r1
|
||||
mad r1, r3, r5.g, r1
|
||||
|
||||
; assume overbright_2 !!!
|
||||
mul_x2 r0, r1, r4
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
; t4 - Base1
|
||||
; t5 - Base2
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
|
||||
;------------------------------------------------------------------------------
|
||||
ps.1.4
|
||||
|
||||
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * lerp(base1, base2, lightmapColor[0].a)
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
texld r0, t0
|
||||
|
||||
dp3 r5.r, r0_bx2, c0
|
||||
dp3 r5.g, r0_bx2, c1
|
||||
dp3 r5.b, r0_bx2, c2
|
||||
mul r5.rgb, r5, r5
|
||||
|
||||
phase
|
||||
|
||||
; Sample the lightmaps
|
||||
texld r1, t1
|
||||
texld r2, t2
|
||||
texld r3, t3
|
||||
|
||||
; Sample the base textures
|
||||
texld r4, t4
|
||||
texld r5, t5
|
||||
|
||||
mul r1, r1, r5.r
|
||||
mad r1, r2, r5.g, r1
|
||||
mad r1, r3, r5.g, r1
|
||||
|
||||
; blend base textures
|
||||
lrp r4, r4, r5, r1.a
|
||||
|
||||
; assume overbright_2 !!!
|
||||
mul_x2 r0, r1, r4
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
; t4 - Base1
|
||||
; t5 - Base2
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - Axes of the lightmap coordinate system in tangent space
|
||||
;------------------------------------------------------------------------------
|
||||
ps.1.4
|
||||
|
||||
; output = (lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) ) * lerp(base1, base2, lightmapColor[0].a)
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
texld r0, t0
|
||||
|
||||
dp3 r5.r, r0_bx2, c0
|
||||
dp3 r5.g, r0_bx2, c1
|
||||
dp3 r5.b, r0_bx2, c2
|
||||
mul r5.rgb, r5, r5
|
||||
|
||||
phase
|
||||
|
||||
; Sample the lightmaps
|
||||
texld r1, t1
|
||||
texld r2, t2
|
||||
texld r3, t3
|
||||
|
||||
; Sample the base textures
|
||||
texld r4, t4
|
||||
texld r5, t5
|
||||
|
||||
mul r1, r1, r5.r
|
||||
mad r1, r2, r5.g, r1
|
||||
mad r1, r3, r5.g, r1
|
||||
|
||||
; blend base textures
|
||||
lrp r4, r4, r5, r1.a
|
||||
|
||||
; assume overbright_2 !!!
|
||||
mul_x2 r0, r1, r4
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - decal texture
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - ( ( N dot basis[0] )^2 ), ( ( N dot basis[1] )^2 ), ( ( N dot basis[2] )^2 )
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the decal color
|
||||
tex t0
|
||||
|
||||
; Sample the lightmaps
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
; output = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) +
|
||||
|
||||
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 )
|
||||
mul r0, t1, c0
|
||||
|
||||
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) + lightmapColor[1] * ( ( N dot basis[1] )^2 )
|
||||
mad r0, t2, c1, r0
|
||||
|
||||
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 )
|
||||
mad r0, t3, c2, r0
|
||||
|
||||
; Modulate by decal texture
|
||||
mul r0.rgb, r0, t0
|
||||
+ mov r0.a, t0.a
|
||||
|
||||
; Modulate by constant color
|
||||
mul r0, r0, c3
|
||||
|
||||
; Modulate by per-vertex factor
|
||||
mul r0, r0, v0
|
||||
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - decal texture
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
; c0, c1, c2 - ( ( N dot basis[0] )^2 ), ( ( N dot basis[1] )^2 ), ( ( N dot basis[2] )^2 )
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the decal color
|
||||
tex t0
|
||||
|
||||
; Sample the lightmaps
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
; output = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 ) +
|
||||
|
||||
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 )
|
||||
mul r0, t1, c0
|
||||
|
||||
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) + lightmapColor[1] * ( ( N dot basis[1] )^2 )
|
||||
mad r0, t2, c1, r0
|
||||
|
||||
; r0 = lightmapColor[0] * ( ( N dot basis[0] )^2 ) +
|
||||
; lightmapColor[1] * ( ( N dot basis[1] )^2 ) +
|
||||
; lightmapColor[2] * ( ( N dot basis[2] )^2 )
|
||||
mad r0, t3, c2, r0
|
||||
|
||||
; Modulate by decal texture
|
||||
mul r0.rgb, r0, t0
|
||||
+ mov r0.a, t0.a
|
||||
|
||||
; Modulate by constant color
|
||||
mul r0, r0, c3
|
||||
|
||||
; Modulate by per-vertex factor
|
||||
mul r0, r0, v0
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r1.rgb, r0, t2 ; detail texture
|
||||
lrp r0.rgb, c2, r1, r0
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r1.rgb, r0, t2 ; detail texture
|
||||
lrp r0.rgb, c2, r1, r0
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
tex t2
|
||||
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
|
||||
mov r0.a, v0.a
|
||||
mul_x2 r0.rgb, r0, t2 ; detail texture
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
tex t2
|
||||
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
|
||||
mov r0.a, v0.a
|
||||
mul_x2 r0.rgb, r0, t2 ; detail texture
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r1.rgb, r0, t2 ; detail texture
|
||||
lrp r0.rgb, c2, r1, r0
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mul r1, c1, t0 ; Self illum * tint
|
||||
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r1.rgb, r0, t2 ; detail texture
|
||||
lrp r0.rgb, c2, r1, r0
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mul r1, c1, t0 ; Self illum * tint
|
||||
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
mov r0.rgb, v0 + ; vertex color
|
||||
mul r0.a, v0.a, t2.a ; vertex alpha * envmap alpha
|
||||
|
||||
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
mov r0.rgb, v0 + ; vertex color
|
||||
mul r0.a, v0.a, t2.a ; vertex alpha * envmap alpha
|
||||
|
||||
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
ps.1.1
|
||||
|
||||
tex t1
|
||||
|
||||
mov r0.rgba, t1
|
||||
|
||||
ps.1.1
|
||||
|
||||
tex t1
|
||||
|
||||
mov r0.rgba, t1
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mov r0.rgb, v0 ; vertex color
|
||||
mul r1, t2, t3 ; envmap * envmapmask
|
||||
|
||||
mad r0.rgb, r1, c2, r0 + ; + envmap * envmapmask * envmaptint (color only)
|
||||
mul r0.a, v0.a, r1.a ; alpha = vertex alpha * envmap alpha * envmapmask alpha
|
||||
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mov r0.rgb, v0 ; vertex color
|
||||
mul r1, t2, t3 ; envmap * envmapmask
|
||||
|
||||
mad r0.rgb, r1, c2, r0 + ; + envmap * envmapmask * envmaptint (color only)
|
||||
mul r0.a, v0.a, r1.a ; alpha = vertex alpha * envmap alpha * envmapmask alpha
|
||||
|
||||
mul r0.rgb, t1, r0 ; fold in lightmap (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
mul r1, t2, t3 ; envmap * envmapmask
|
||||
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0, t0, v0 ; base times vertex color (with alpha)
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
mul r1, t2, t3 ; envmap * envmapmask
|
||||
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c2, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
; Blend between grey and lightmap color based on total alpha
|
||||
|
||||
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
|
||||
+ mul_sat r1.a, t0, v0 ; base times vertex alpha
|
||||
lrp r0, r1.a, r1, c2 ; interpolate between white + color
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c2, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
; Blend between grey and lightmap color based on total alpha
|
||||
|
||||
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
|
||||
+ mul_sat r1.a, t0, v0 ; base times vertex alpha
|
||||
lrp r0, r1.a, r1, c2 ; interpolate between white + color
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c2, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
; Blend between grey and lightmap color based on total alpha
|
||||
|
||||
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
|
||||
+ mov_sat r1.a, v0 ; vertex alpha
|
||||
lrp r0, r1.a, r1, c2 ; interpolate between white + color
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c2, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
; Blend between grey and lightmap color based on total alpha
|
||||
|
||||
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
|
||||
+ mov_sat r1.a, v0 ; vertex alpha
|
||||
lrp r0, r1.a, r1, c2 ; interpolate between white + color
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c2, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
; Blend between white and lightmap color based on total alpha
|
||||
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
|
||||
+ mov_sat r1.a, v0 ; opacity == vertex opacity (no alpha in texture)
|
||||
|
||||
lrp r0.rgb, t0.a, c1, r1 ; Blend between self-illum + lightmap
|
||||
+ mov r0.a, c2.a
|
||||
|
||||
lrp r0.rgb, r1.a, r0, c2 ; interpolate between white + color
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c2, 1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
; Blend between white and lightmap color based on total alpha
|
||||
mul_x2 r1.rgb, c0, t1 ; Apply overbright to lightmap
|
||||
+ mov_sat r1.a, v0 ; opacity == vertex opacity (no alpha in texture)
|
||||
|
||||
lrp r0.rgb, t0.a, c1, r1 ; Blend between self-illum + lightmap
|
||||
+ mov r0.a, c2.a
|
||||
|
||||
lrp r0.rgb, r1.a, r0, c2 ; interpolate between white + color
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
|
||||
mov r0.a, v0.a
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1
|
||||
mul r0.rgb, t1, v0 + ; base times vertex color (with alpha)
|
||||
mov r0.a, v0.a
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
ps.1.1
|
||||
def c0, 1,0,0,0
|
||||
def c1, 0,1,0,0
|
||||
def c2, 0,0,1,0
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
tex t0
|
||||
|
||||
; Sample the lightmaps
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
; output = lightmapColor[0] * n.r + lightmapColor[1] * n.g + lightmapColor[2] * n.b
|
||||
|
||||
|
||||
mov r0, t0
|
||||
dp3 r1, t0, c0
|
||||
mul r0.rgb, r1, t1
|
||||
dp3 r1, t0, c1
|
||||
mad r0.rgb, r1, t2, r0
|
||||
dp3 r1, t0, c2
|
||||
mad r0.rgb, r1, t3, r0
|
||||
ps.1.1
|
||||
def c0, 1,0,0,0
|
||||
def c1, 0,1,0,0
|
||||
def c2, 0,0,1,0
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Computes the diffuse component of lighting using lightmap + bumpmap
|
||||
; t0 - Normalmap
|
||||
; t1 - Lightmap1
|
||||
; t2 - Lightmap2
|
||||
; t3 - Lightmap3
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - Normalmap and lightmap texture coordinates
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Get the 3-vector from the normal map
|
||||
tex t0
|
||||
|
||||
; Sample the lightmaps
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
; output = lightmapColor[0] * n.r + lightmapColor[1] * n.g + lightmapColor[2] * n.b
|
||||
|
||||
|
||||
mov r0, t0
|
||||
dp3 r1, t0, c0
|
||||
mul r0.rgb, r1, t1
|
||||
dp3 r1, t0, c1
|
||||
mad r0.rgb, r1, t2, r0
|
||||
dp3 r1, t0, c2
|
||||
mad r0.rgb, r1, t3, r0
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mul r1, c1, t0 ; Self illum * tint
|
||||
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r0.rgb, t1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mul r1, c1, t0 ; Self illum * tint
|
||||
lrp r0.rgb, t0.a, r1, r0 ; Blend between self-illum + base * lightmap
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r1, t0.a, t0 ; Self illum
|
||||
mad r1, c1, r1, t1 ; Self illum * tint + lightmap
|
||||
|
||||
mul r0.rgb, r1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
|
||||
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (no alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r1, t0.a, t0 ; Self illum
|
||||
mad r1, c1, r1, t1 ; Self illum * tint + lightmap
|
||||
|
||||
mul r0.rgb, r1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mad r0.rgb, t2, c2, r0 ; + envmap * envmaptint (color only)
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (with alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r1, c1, t0.a ; Self illum alpha * tint
|
||||
mad r1, t0, r1, t1 ; Self illum * tint + lightmap
|
||||
mul r0.rgb, r1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mul r1, t2, t3 ; envmap * envmapmask
|
||||
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
|
||||
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c1 - self-illum tint
|
||||
; c2 - envmap tint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0
|
||||
tex t1
|
||||
tex t2
|
||||
tex t3
|
||||
|
||||
mul r0.rgb, t0, v0 + ; base times vertex color (with alpha)
|
||||
mov r0.a, v0.a ; Grab alpha from vertex color
|
||||
|
||||
mul r1, c1, t0.a ; Self illum alpha * tint
|
||||
mad r1, t0, r1, t1 ; Self illum * tint + lightmap
|
||||
mul r0.rgb, r1, r0 ; fold in lighting (color only)
|
||||
mul_x2 r0.rgb, c0, r0 ; * 2 * (overbrightFactor/2)
|
||||
|
||||
mul r1, t2, t3 ; envmap * envmapmask
|
||||
mad r0.rgb, r1, c2, r0 ; + envmap * envmapmask * envmaptint (color only)
|
||||
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
; STATIC: "REFRACTTINTTEXTURE" "0..1"
|
||||
; STATIC: "NORMALMAPALPHA" "0..1"
|
||||
|
||||
ps.1.1
|
||||
|
||||
; t0:
|
||||
; texture: dudv map
|
||||
; texcoords: dudvmap texcoords
|
||||
; t1:
|
||||
; texture: refraction render target
|
||||
; texcoords:
|
||||
|
||||
tex t0 ; sample dudv map
|
||||
texbem t1, t0 ; refraction
|
||||
|
||||
#if REFRACTTINTTEXTURE
|
||||
tex t2
|
||||
#endif
|
||||
|
||||
#if NORMALMAPALPHA
|
||||
tex t3
|
||||
#endif
|
||||
|
||||
; refracttint
|
||||
#if REFRACTTINTTEXTURE
|
||||
mul_x2 r0, t1, t2
|
||||
#else
|
||||
mov r0, t1
|
||||
#endif
|
||||
|
||||
#if NORMALMAPALPHA
|
||||
mul r0.rgb, r0, c0 +
|
||||
mov r0.a, t3.a
|
||||
#else
|
||||
mul r0.rgb, r0, c0
|
||||
#endif
|
||||
; STATIC: "REFRACTTINTTEXTURE" "0..1"
|
||||
; STATIC: "NORMALMAPALPHA" "0..1"
|
||||
|
||||
ps.1.1
|
||||
|
||||
; t0:
|
||||
; texture: dudv map
|
||||
; texcoords: dudvmap texcoords
|
||||
; t1:
|
||||
; texture: refraction render target
|
||||
; texcoords:
|
||||
|
||||
tex t0 ; sample dudv map
|
||||
texbem t1, t0 ; refraction
|
||||
|
||||
#if REFRACTTINTTEXTURE
|
||||
tex t2
|
||||
#endif
|
||||
|
||||
#if NORMALMAPALPHA
|
||||
tex t3
|
||||
#endif
|
||||
|
||||
; refracttint
|
||||
#if REFRACTTINTTEXTURE
|
||||
mul_x2 r0, t1, t2
|
||||
#else
|
||||
mov r0, t1
|
||||
#endif
|
||||
|
||||
#if NORMALMAPALPHA
|
||||
mul r0.rgb, r0, c0 +
|
||||
mov r0.a, t3.a
|
||||
#else
|
||||
mul r0.rgb, r0, c0
|
||||
#endif
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c0,1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0 ; shadow color
|
||||
texkill t1 ; Clip
|
||||
texkill t2
|
||||
texkill t3 ; backface cull
|
||||
|
||||
; Darkening equation, compute a color = (shadow color * shadow alpha + 1- shadow alpha)
|
||||
;sub r1, t0, v0.a ; r1 = shadow alpha
|
||||
lrp r0.rgb, t0.a, v0, c0 + ; r0.rgb = (shadow color * shadow alpha + 1 - shadow alpha)
|
||||
mov r0.a, c0.a ; r0.a = 1
|
||||
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
def c0,1.0f, 1.0f, 1.0f, 1.0f
|
||||
|
||||
tex t0 ; shadow color
|
||||
texkill t1 ; Clip
|
||||
texkill t2
|
||||
texkill t3 ; backface cull
|
||||
|
||||
; Darkening equation, compute a color = (shadow color * shadow alpha + 1- shadow alpha)
|
||||
;sub r1, t0, v0.a ; r1 = shadow alpha
|
||||
lrp r0.rgb, t0.a, v0, c0 + ; r0.rgb = (shadow color * shadow alpha + 1 - shadow alpha)
|
||||
mov r0.a, c0.a ; r0.a = 1
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
|
||||
mul r0, t0, v0
|
||||
@@ -1,19 +1,19 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
|
||||
mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
|
||||
mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
mad r0.rgb, t0, v0, r0
|
||||
+ mul r0.a, t0, v0
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
|
||||
mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
|
||||
mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
mad r0.rgb, t0, v0, r0
|
||||
+ mul r0.a, t0, v0
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t3 ; detail texture
|
||||
|
||||
mul r0, t0, v0
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t3 ; detail texture
|
||||
|
||||
mul r0, t0, v0
|
||||
mul_x2 r0.rgb, r0, t3
|
||||
@@ -1,29 +1,29 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
;mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
|
||||
;mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
;mad r0.rgb, t0, v0, r0
|
||||
;+ mul r0.a, t0, v0
|
||||
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
|
||||
; version 2: applies the mod2x *before* environment map
|
||||
mul r0, t0, v0 ; Base times modulation color
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
mul r1, t1, 1-t2.a ; Have to invert the alpha for basealpha (feh!)
|
||||
mul r1, c2, r1 ; apply the envmaptint
|
||||
add r0.rgb, r0, r1 ; add in the envmap
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
;mul r0.rgb, t1, 1-t2.a ; can't use mad cause can't use 3 texture registers
|
||||
;mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
;mad r0.rgb, t0, v0, r0
|
||||
;+ mul r0.a, t0, v0
|
||||
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
|
||||
; version 2: applies the mod2x *before* environment map
|
||||
mul r0, t0, v0 ; Base times modulation color
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
mul r1, t1, 1-t2.a ; Have to invert the alpha for basealpha (feh!)
|
||||
mul r1, c2, r1 ; apply the envmaptint
|
||||
add r0.rgb, r0, r1 ; add in the envmap
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
;mul r1, c2, t1
|
||||
;mad r0.rgb, t0, v0, r1
|
||||
;+ mul r0.a, t0, v0
|
||||
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
|
||||
; version 2: applies the mod2x *before* environment map
|
||||
mul r0, t0, v0 ; Base times modulation color
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
mad r0.rgb, c2, t1, r0 ; add in tinted envmap
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
;mul r1, c2, t1
|
||||
;mad r0.rgb, t0, v0, r1
|
||||
;+ mul r0.a, t0, v0
|
||||
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
|
||||
; version 2: applies the mod2x *before* environment map
|
||||
mul r0, t0, v0 ; Base times modulation color
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
mad r0.rgb, c2, t1, r0 ; add in tinted envmap
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
;mul r0.rgb, t1, t2 ; can't use mad cause can't use 3 texture registers
|
||||
;mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
;mad r0.rgb, t0, v0, r0
|
||||
;+ mul r0.a, t0, v0
|
||||
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
|
||||
; version 2: applies the mod2x *before* environment map
|
||||
mul r0, t0, v0 ; Base times modulation color
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
mul r1, t1, t2 ; Envmap * envmapmask
|
||||
mul r1, c2, r1 ; apply the envmaptint
|
||||
add r0.rgb, r0, r1 ; add in the envmap
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
;mul r0.rgb, t1, t2 ; can't use mad cause can't use 3 texture registers
|
||||
;mul r0.rgb, c2, r0 ; apply the envmaptint
|
||||
;mad r0.rgb, t0, v0, r0
|
||||
;+ mul r0.a, t0, v0
|
||||
;mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
|
||||
; version 2: applies the mod2x *before* environment map
|
||||
mul r0, t0, v0 ; Base times modulation color
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
mul r1, t1, t2 ; Envmap * envmapmask
|
||||
mul r1, c2, r1 ; apply the envmaptint
|
||||
add r0.rgb, r0, r1 ; add in the envmap
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
; version 2 doesn't make sense here!
|
||||
mul r0, t1, t2
|
||||
mul r0.rgb, c2, r0
|
||||
mul r0, r0, v0
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1 ; cube map
|
||||
tex t2 ; envmap mask
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
; version 2 doesn't make sense here!
|
||||
mul r0, t1, t2
|
||||
mul r0.rgb, c2, r0
|
||||
mul r0, r0, v0
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
@@ -1,19 +1,19 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1 ; cube map
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
; version 2 doesn't make sense here!
|
||||
mul r0, v0, t1
|
||||
mul r0.rgb, r0, c2
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t1 ; cube map
|
||||
tex t3 ; detail texture
|
||||
|
||||
; version 1: applies the mod2x *after* environment map
|
||||
; version 2 doesn't make sense here!
|
||||
mul r0, v0, t1
|
||||
mul r0.rgb, r0, c2
|
||||
mul_x2 r0.rgb, r0, t3 ; mod2x detail texture
|
||||
@@ -1,10 +1,10 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Just use the vertex color
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t3
|
||||
|
||||
mul_x2 r0.rgb, v0, t3
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Just use the vertex color
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t3
|
||||
|
||||
mul_x2 r0.rgb, v0, t3
|
||||
+ mov r0.a, v0.a
|
||||
@@ -1,17 +1,17 @@
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
|
||||
mul r1, c2, t1
|
||||
mad r0.rgb, t0, v0, r1
|
||||
+ mul r0.a, t0, v0
|
||||
ps.1.1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Draw a texture . . woo hoo!
|
||||
; t0 - texture
|
||||
;
|
||||
; The texture coordinates need to be defined as follows:
|
||||
; tc0 - texcoords
|
||||
; c2 - envmaptint
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
tex t0 ; base color
|
||||
tex t1 ; cube map
|
||||
|
||||
mul r1, c2, t1
|
||||
mad r0.rgb, t0, v0, r1
|
||||
+ mul r0.a, t0, v0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user