fixed particle lighting
This commit is contained in:
@@ -9,6 +9,7 @@ struct VertextoPixel
|
||||
nointerpolation float size : TEXCOORD2;
|
||||
nointerpolation uint color : TEXCOORD3;
|
||||
float3 P : WORLDPOSITION;
|
||||
float2 unrotated_uv : UNROTATED_UV;
|
||||
};
|
||||
|
||||
#endif // WI_EMITTEDPARTICLE_HF
|
||||
|
||||
@@ -32,9 +32,9 @@ float4 main(VertextoPixel input) : SV_TARGET
|
||||
#ifdef EMITTEDPARTICLE_LIGHTING
|
||||
|
||||
float3 N;
|
||||
N.x = cos(PI * input.tex.x);
|
||||
N.y = cos(PI * input.tex.y);
|
||||
N.z = -sin(PI * length(input.tex));
|
||||
N.x = -cos(PI * input.unrotated_uv.x);
|
||||
N.y = cos(PI * input.unrotated_uv.y);
|
||||
N.z = -sin(PI * length(input.unrotated_uv));
|
||||
N = mul((float3x3)g_xCamera_InvV, N);
|
||||
N = normalize(N);
|
||||
|
||||
@@ -93,6 +93,9 @@ float4 main(VertextoPixel input) : SV_TARGET
|
||||
|
||||
color.rgb *= lighting.direct.diffuse + lighting.indirect.diffuse;
|
||||
|
||||
//color.rgb = float3(unrotated_uv, 0);
|
||||
//color.rgb = float3(input.tex, 0);
|
||||
|
||||
#endif // EMITTEDPARTICLE_LIGHTING
|
||||
|
||||
return max(color, 0);
|
||||
|
||||
@@ -63,6 +63,7 @@ VertextoPixel main(uint fakeIndex : SV_VERTEXID)
|
||||
Out.size = size;
|
||||
Out.color = (particle.color_mirror & 0x00FFFFFF) | (uint(opacity * 255.0f) << 24);
|
||||
Out.pos2D = Out.pos;
|
||||
Out.unrotated_uv = quadPos.xy * float2(1, -1) / size * 0.5f + 0.5f;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace wiVersion
|
||||
// minor features, major updates
|
||||
const int minor = 40;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 8;
|
||||
const int revision = 9;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user