Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
water.vs [water fog fix skyloader]
建立於
5 年前
差異永不過期
清除
匯出
分享
解釋
1 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
93 行
全部複製
1 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
93 行
全部複製
#include "common.h"
#include "common.h"
#include "shared\waterconfig.h"
#include "shared\waterconfig.h"
#include "shared\watermove.h"
#include "shared\watermove.h"
struct v_vert
struct v_vert
{
{
float4 P : POSITION; // (float,float,float,1)
float4 P : POSITION; // (float,float,float,1)
float4 N : NORMAL; // (nx,ny,nz,hemi occlusion)
float4 N : NORMAL; // (nx,ny,nz,hemi occlusion)
float4 T : TANGENT;
float4 T : TANGENT;
float4 B : BINORMAL;
float4 B : BINORMAL;
float4 color : COLOR0; // (r,g,b,dir-occlusion)
float4 color : COLOR0; // (r,g,b,dir-occlusion)
float2 uv : TEXCOORD0; // (u0,v0)
float2 uv : TEXCOORD0; // (u0,v0)
};
};
struct vf
struct vf
{
{
float4 hpos : POSITION ;
float4 hpos : POSITION ;
float2 tbase : TEXCOORD0 ; // base
float2 tbase : TEXCOORD0 ; // base
float2 tnorm0 : TEXCOORD1 ; // nm0
float2 tnorm0 : TEXCOORD1 ; // nm0
float2 tnorm1 : TEXCOORD2 ; // nm1
float2 tnorm1 : TEXCOORD2 ; // nm1
half3 M1 : TEXCOORD3 ;
half3 M1 : TEXCOORD3 ;
half3 M2 : TEXCOORD4 ;
half3 M2 : TEXCOORD4 ;
half3 M3 : TEXCOORD5 ;
half3 M3 : TEXCOORD5 ;
half3 v2point : TEXCOORD6 ;
half3 v2point : TEXCOORD6 ;
#ifdef USE_SOFT_WATER
#ifdef USE_SOFT_WATER
#ifdef NEED_SOFT_WATER
#ifdef NEED_SOFT_WATER
float4 tctexgen : TEXCOORD7 ;
float4 tctexgen : TEXCOORD7 ;
#endif // USE_SOFT_WATER
#endif // USE_SOFT_WATER
#endif // NEED_SOFT_WATER
#endif // NEED_SOFT_WATER
half4 c0 : COLOR0 ;
half4 c0 : COLOR0 ;
float fog : FOG ;
float fog : FOG ;
};
};
vf main(v_vert v)
vf main(v_vert v)
{
{
vf o;
vf o;
float4 P = v.P ; // world
float4 P = v.P ; // world
float3 NN = unpack_normal (v.N) ;
float3 NN = unpack_normal (v.N) ;
P = watermove (P) ;
P = watermove (P) ;
o.v2point = P-eye_position ;
o.v2point = P-eye_position ;
o.tbase = unpack_tc_base (v.uv,v.T.w,v.B.w); // copy tc
o.tbase = unpack_tc_base (v.uv,v.T.w,v.B.w); // copy tc
o.tnorm0 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_0, P.xz, W_DISTORT_AMP_0);
o.tnorm0 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_0, P.xz, W_DISTORT_AMP_0);
o.tnorm1 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_1, P.xz, W_DISTORT_AMP_1);
o.tnorm1 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_1, P.xz, W_DISTORT_AMP_1);
// Calculate the 3x3 transform from tangent space to eye-space
// Calculate the 3x3 transform from tangent space to eye-space
// TangentToEyeSpace = object2eye * tangent2object
// TangentToEyeSpace = object2eye * tangent2object
// = object2eye * transpose(object2tangent) (since the inverse of a rotation is its transpose)
// = object2eye * transpose(object2tangent) (since the inverse of a rotation is its transpose)
float3 N = unpack_bx2(v.N); // just scale (assume normal in the -.5f, .5f)
float3 N = unpack_bx2(v.N); // just scale (assume normal in the -.5f, .5f)
float3 T = unpack_bx2(v.T); //
float3 T = unpack_bx2(v.T); //
float3 B = unpack_bx2(v.B); //
float3 B = unpack_bx2(v.B); //
float3x3 xform = mul ((float3x3)m_W, float3x3(
float3x3 xform = mul ((float3x3)m_W, float3x3(
T.x,B.x,N.x,
T.x,B.x,N.x,
T.y,B.y,N.y,
T.y,B.y,N.y,
T.z,B.z,N.z
T.z,B.z,N.z
));
));
// The pixel shader operates on the bump-map in [0..1] range
// The pixel shader operates on the bump-map in [0..1] range
// Remap this range in the matrix, anyway we are pixel-shader limited :)
// Remap this range in the matrix, anyway we are pixel-shader limited :)
// ...... [ 2 0 0 0]
// ...... [ 2 0 0 0]
// ...... [ 0 2 0 0]
// ...... [ 0 2 0 0]
// ...... [ 0 0 2 0]
// ...... [ 0 0 2 0]
// ...... [-1 -1 -1 1]
// ...... [-1 -1 -1 1]
// issue: strange, but it's slower :(
// issue: strange, but it's slower :(
// issue: interpolators? dp4? VS limited? black magic?
// issue: interpolators? dp4? VS limited? black magic?
// Feed this transform to pixel shader
// Feed this transform to pixel shader
o.M1 = xform [0];
o.M1 = xform [0];
o.M2 = xform [1];
o.M2 = xform [1];
o.M3 = xform [2];
o.M3 = xform [2];
float3 L_rgb = v.color.xyz; // precalculated RGB lighting
float3 L_rgb = v.color.xyz; // precalculated RGB lighting
float3 L_hemi = v_hemi(N)*v.N.w; // hemisphere
float3 L_hemi = v_hemi(N)*v.N.w; // hemisphere
float3 L_sun = v_sun(N)*v.color.w; // sun
float3 L_sun = v_sun(N)*v.color.w; // sun
float3 L_final = L_rgb + L_hemi + L_sun + L_ambient;
float3 L_final = L_rgb + L_hemi + L_sun + L_ambient;
// L_final = v.N.w + L_ambient;
// L_final = v.N.w + L_ambient;
o.hpos = mul (m_VP, P); // xform, input in world coords
o.hpos = mul (m_VP, P); // xform, input in world coords
o.fog = saturate(calc_fogging (v.P));
o.fog = saturate(calc_fogging (v.P));
複製
已複製
複製
已複製
o.c0 = float4 (L_final,
o.fog
);
o.c0 = float4 (L_final,
1
);
// Igor: for additional depth dest
// Igor: for additional depth dest
#ifdef USE_SOFT_WATER
#ifdef USE_SOFT_WATER
#ifdef NEED_SOFT_WATER
#ifdef NEED_SOFT_WATER
o.tctexgen = mul( m_texgen, P);
o.tctexgen = mul( m_texgen, P);
float3 Pe = mul (m_V, P);
float3 Pe = mul (m_V, P);
o.tctexgen.z = Pe.z;
o.tctexgen.z = Pe.z;
#endif // USE_SOFT_WATER
#endif // USE_SOFT_WATER
#endif // NEED_SOFT_WATER
#endif // NEED_SOFT_WATER
return o;
return o;
}
}
已保存差異
原始文本
開啟檔案
#include "common.h" #include "shared\waterconfig.h" #include "shared\watermove.h" struct v_vert { float4 P : POSITION; // (float,float,float,1) float4 N : NORMAL; // (nx,ny,nz,hemi occlusion) float4 T : TANGENT; float4 B : BINORMAL; float4 color : COLOR0; // (r,g,b,dir-occlusion) float2 uv : TEXCOORD0; // (u0,v0) }; struct vf { float4 hpos : POSITION ; float2 tbase : TEXCOORD0 ; // base float2 tnorm0 : TEXCOORD1 ; // nm0 float2 tnorm1 : TEXCOORD2 ; // nm1 half3 M1 : TEXCOORD3 ; half3 M2 : TEXCOORD4 ; half3 M3 : TEXCOORD5 ; half3 v2point : TEXCOORD6 ; #ifdef USE_SOFT_WATER #ifdef NEED_SOFT_WATER float4 tctexgen : TEXCOORD7 ; #endif // USE_SOFT_WATER #endif // NEED_SOFT_WATER half4 c0 : COLOR0 ; float fog : FOG ; }; vf main(v_vert v) { vf o; float4 P = v.P ; // world float3 NN = unpack_normal (v.N) ; P = watermove (P) ; o.v2point = P-eye_position ; o.tbase = unpack_tc_base (v.uv,v.T.w,v.B.w); // copy tc o.tnorm0 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_0, P.xz, W_DISTORT_AMP_0); o.tnorm1 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_1, P.xz, W_DISTORT_AMP_1); // Calculate the 3x3 transform from tangent space to eye-space // TangentToEyeSpace = object2eye * tangent2object // = object2eye * transpose(object2tangent) (since the inverse of a rotation is its transpose) float3 N = unpack_bx2(v.N); // just scale (assume normal in the -.5f, .5f) float3 T = unpack_bx2(v.T); // float3 B = unpack_bx2(v.B); // float3x3 xform = mul ((float3x3)m_W, float3x3( T.x,B.x,N.x, T.y,B.y,N.y, T.z,B.z,N.z )); // The pixel shader operates on the bump-map in [0..1] range // Remap this range in the matrix, anyway we are pixel-shader limited :) // ...... [ 2 0 0 0] // ...... [ 0 2 0 0] // ...... [ 0 0 2 0] // ...... [-1 -1 -1 1] // issue: strange, but it's slower :( // issue: interpolators? dp4? VS limited? black magic? // Feed this transform to pixel shader o.M1 = xform [0]; o.M2 = xform [1]; o.M3 = xform [2]; float3 L_rgb = v.color.xyz; // precalculated RGB lighting float3 L_hemi = v_hemi(N)*v.N.w; // hemisphere float3 L_sun = v_sun(N)*v.color.w; // sun float3 L_final = L_rgb + L_hemi + L_sun + L_ambient; // L_final = v.N.w + L_ambient; o.hpos = mul (m_VP, P); // xform, input in world coords o.fog = saturate(calc_fogging (v.P)); o.c0 = float4 (L_final,o.fog); // Igor: for additional depth dest #ifdef USE_SOFT_WATER #ifdef NEED_SOFT_WATER o.tctexgen = mul( m_texgen, P); float3 Pe = mul (m_V, P); o.tctexgen.z = Pe.z; #endif // USE_SOFT_WATER #endif // NEED_SOFT_WATER return o; }
更改後文本
開啟檔案
#include "common.h" #include "shared\waterconfig.h" #include "shared\watermove.h" struct v_vert { float4 P : POSITION; // (float,float,float,1) float4 N : NORMAL; // (nx,ny,nz,hemi occlusion) float4 T : TANGENT; float4 B : BINORMAL; float4 color : COLOR0; // (r,g,b,dir-occlusion) float2 uv : TEXCOORD0; // (u0,v0) }; struct vf { float4 hpos : POSITION ; float2 tbase : TEXCOORD0 ; // base float2 tnorm0 : TEXCOORD1 ; // nm0 float2 tnorm1 : TEXCOORD2 ; // nm1 half3 M1 : TEXCOORD3 ; half3 M2 : TEXCOORD4 ; half3 M3 : TEXCOORD5 ; half3 v2point : TEXCOORD6 ; #ifdef USE_SOFT_WATER #ifdef NEED_SOFT_WATER float4 tctexgen : TEXCOORD7 ; #endif // USE_SOFT_WATER #endif // NEED_SOFT_WATER half4 c0 : COLOR0 ; float fog : FOG ; }; vf main(v_vert v) { vf o; float4 P = v.P ; // world float3 NN = unpack_normal (v.N) ; P = watermove (P) ; o.v2point = P-eye_position ; o.tbase = unpack_tc_base (v.uv,v.T.w,v.B.w); // copy tc o.tnorm0 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_0, P.xz, W_DISTORT_AMP_0); o.tnorm1 = watermove_tc (o.tbase*W_DISTORT_BASE_TILE_1, P.xz, W_DISTORT_AMP_1); // Calculate the 3x3 transform from tangent space to eye-space // TangentToEyeSpace = object2eye * tangent2object // = object2eye * transpose(object2tangent) (since the inverse of a rotation is its transpose) float3 N = unpack_bx2(v.N); // just scale (assume normal in the -.5f, .5f) float3 T = unpack_bx2(v.T); // float3 B = unpack_bx2(v.B); // float3x3 xform = mul ((float3x3)m_W, float3x3( T.x,B.x,N.x, T.y,B.y,N.y, T.z,B.z,N.z )); // The pixel shader operates on the bump-map in [0..1] range // Remap this range in the matrix, anyway we are pixel-shader limited :) // ...... [ 2 0 0 0] // ...... [ 0 2 0 0] // ...... [ 0 0 2 0] // ...... [-1 -1 -1 1] // issue: strange, but it's slower :( // issue: interpolators? dp4? VS limited? black magic? // Feed this transform to pixel shader o.M1 = xform [0]; o.M2 = xform [1]; o.M3 = xform [2]; float3 L_rgb = v.color.xyz; // precalculated RGB lighting float3 L_hemi = v_hemi(N)*v.N.w; // hemisphere float3 L_sun = v_sun(N)*v.color.w; // sun float3 L_final = L_rgb + L_hemi + L_sun + L_ambient; // L_final = v.N.w + L_ambient; o.hpos = mul (m_VP, P); // xform, input in world coords o.fog = saturate(calc_fogging (v.P)); o.c0 = float4 (L_final,1); // Igor: for additional depth dest #ifdef USE_SOFT_WATER #ifdef NEED_SOFT_WATER o.tctexgen = mul( m_texgen, P); float3 Pe = mul (m_V, P); o.tctexgen.z = Pe.z; #endif // USE_SOFT_WATER #endif // NEED_SOFT_WATER return o; }
尋找差異