add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
34
gamedata/shaders/r2/lod.ps
Normal file
34
gamedata/shaders/r2/lod.ps
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include "common.h"
|
||||
#include "sload.h"
|
||||
|
||||
struct vf
|
||||
{
|
||||
float4 hpos : POSITION ;
|
||||
half3 position: TEXCOORD0 ;
|
||||
float2 tc0 : TEXCOORD1 ; // base0
|
||||
float2 tc1 : TEXCOORD2 ; // base1
|
||||
half4 af : COLOR1 ; // alpha&factor
|
||||
};
|
||||
|
||||
f_deffer main ( vf I )
|
||||
{
|
||||
f_deffer O;
|
||||
|
||||
// 1. Base texture + kill pixels with low alpha
|
||||
half4 D0 = tex2D (s_base, I.tc0);
|
||||
half4 D1 = tex2D (s_base, I.tc1);
|
||||
half4 H0 = tex2D (s_hemi, I.tc0); H0.xyz = H0.rgb*2-1; // expand
|
||||
half4 H1 = tex2D (s_hemi, I.tc1); H1.xyz = H1.rgb*2-1; // expand
|
||||
|
||||
half4 D = lerp (D0,D1,I.af.w); D.w *= I.af.z; // multiply alpha
|
||||
half4 H = lerp (H0,H1,I.af.w); H.w *= I.af.x; // multiply hemi
|
||||
|
||||
clip (D.w-(96.h/255.h)) ;
|
||||
half3 N = normalize (H.xyz);
|
||||
|
||||
// 2. Standart output
|
||||
O.Ne = half4 (N , H.w );
|
||||
O.position = half4 (I.position + N*def_virtualh/2.h , 0 );
|
||||
O.C = half4 (D.x, D.y, D.z , def_gloss ); // OUT: rgb.gloss
|
||||
return O;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue