mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2025-06-13 06:46:17 +02:00
ModelBaker Test
MeshCombiner, combine SkinnedMeshRenderers and MeshRenderers into one. AnimationBaker, bake SkinnedMeshRenderer with of animations into vertex animations. Test shader, flipped Y compared to previvious version, it now starts at 0,0 and goes into the positive direciton.
This commit is contained in:
@ -20,6 +20,21 @@ float2 VA_UV_float(float2 uv, int maxFrames, float time)
|
||||
return uvPosition;
|
||||
}
|
||||
|
||||
float2 VA1_UV_float(float2 uv, int maxFrames, float time)
|
||||
{
|
||||
float2 uvPosition;
|
||||
|
||||
float timeInFrames = frac(time);
|
||||
timeInFrames = ceil(timeInFrames * maxFrames);
|
||||
timeInFrames /= maxFrames;
|
||||
timeInFrames += round(1.0f / maxFrames);
|
||||
|
||||
uvPosition.x = uv.x;
|
||||
uvPosition.y = (1.0f - (1.0f - uv.y) - (1.0f - (timeInFrames)));
|
||||
|
||||
return uvPosition;
|
||||
}
|
||||
|
||||
void VA_float(float2 uv, SamplerState texSampler, Texture2D positionMap, float time, int maxFrames,
|
||||
out float3 position, out float3 alpha)
|
||||
{
|
||||
@ -34,6 +49,20 @@ void VA_float(float2 uv, SamplerState texSampler, Texture2D positionMap, float t
|
||||
alpha = texturePos.w;
|
||||
}
|
||||
|
||||
void VA1_float(float2 uv, SamplerState texSampler, Texture2D positionMap, float time, int maxFrames,
|
||||
out float3 position, out float alpha)
|
||||
{
|
||||
float2 uvPosition = VA1_UV_float(uv, maxFrames, time);
|
||||
|
||||
// Position.
|
||||
float4 texturePos = positionMap.SampleLevel(texSampler, uvPosition, 0);
|
||||
position = texturePos.xyz;
|
||||
|
||||
// Normal.
|
||||
//FloatToFloat3_float(texturePos.w, outNormal);
|
||||
alpha = texturePos.w;
|
||||
}
|
||||
|
||||
void VA_ARRAY_float(float2 uv, SamplerState texSampler, Texture2DArray positionMap, float positionMapIndex, float time, int maxFrames,
|
||||
out float3 position, out float3 alpha)
|
||||
{
|
||||
|
Reference in New Issue
Block a user