mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
Improve dummy shader vertex stage
This commit is contained in:
parent
f26c4b99a9
commit
ab7d9b59cf
@ -8,11 +8,12 @@
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
float4x4 unity_MatrixMVP;
|
||||
float4x4 unity_ObjectToWorld;
|
||||
float4x4 unity_MatrixVP;
|
||||
|
||||
struct Vertex_Stage_Input
|
||||
{
|
||||
float3 pos : POSITION;
|
||||
float4 pos : POSITION;
|
||||
};
|
||||
|
||||
struct Vertex_Stage_Output
|
||||
@ -23,7 +24,7 @@
|
||||
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
||||
{
|
||||
Vertex_Stage_Output output;
|
||||
output.pos = mul(unity_MatrixMVP, float4(input.pos, 1.0));
|
||||
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@ -8,11 +8,12 @@
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
float4x4 unity_MatrixMVP;
|
||||
float4x4 unity_ObjectToWorld;
|
||||
float4x4 unity_MatrixVP;
|
||||
|
||||
struct Vertex_Stage_Input
|
||||
{
|
||||
float3 pos : POSITION;
|
||||
float4 pos : POSITION;
|
||||
};
|
||||
|
||||
struct Vertex_Stage_Output
|
||||
@ -23,7 +24,7 @@
|
||||
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
||||
{
|
||||
Vertex_Stage_Output output;
|
||||
output.pos = mul(unity_MatrixMVP, float4(input.pos, 1.0));
|
||||
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@ -8,22 +8,27 @@
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
float4x4 unity_MatrixMVP;
|
||||
float4x4 unity_ObjectToWorld;
|
||||
float4x4 unity_MatrixVP;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
struct Vertex_Stage_Input
|
||||
{
|
||||
float3 pos : POSITION;
|
||||
float4 pos : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct Vertex_Stage_Output
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
||||
{
|
||||
Vertex_Stage_Output output;
|
||||
output.pos = mul(unity_MatrixMVP, float4(input.pos, 1.0));
|
||||
output.uv = (input.uv.xy * _MainTex_ST.xy) + _MainTex_ST.zw;
|
||||
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
||||
return output;
|
||||
}
|
||||
|
||||
@ -37,7 +42,7 @@
|
||||
|
||||
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
||||
{
|
||||
return _MainTex.Sample(sampler_MainTex, float2(input.uv.x, input.uv.y));
|
||||
return _MainTex.Sample(sampler_MainTex, input.uv.xy);
|
||||
}
|
||||
|
||||
ENDHLSL
|
||||
|
||||
@ -8,22 +8,27 @@
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
float4x4 unity_MatrixMVP;
|
||||
float4x4 unity_ObjectToWorld;
|
||||
float4x4 unity_MatrixVP;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
struct Vertex_Stage_Input
|
||||
{
|
||||
float3 pos : POSITION;
|
||||
float4 pos : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct Vertex_Stage_Output
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
||||
{
|
||||
Vertex_Stage_Output output;
|
||||
output.pos = mul(unity_MatrixMVP, float4(input.pos, 1.0));
|
||||
output.uv = (input.uv.xy * _MainTex_ST.xy) + _MainTex_ST.zw;
|
||||
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
||||
return output;
|
||||
}
|
||||
|
||||
@ -38,7 +43,7 @@
|
||||
|
||||
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
||||
{
|
||||
return _MainTex.Sample(sampler_MainTex, float2(input.uv.x, input.uv.y)) * _Color;
|
||||
return _MainTex.Sample(sampler_MainTex, input.uv.xy) * _Color;
|
||||
}
|
||||
|
||||
ENDHLSL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user