feat: House of leaves, details added to wall shader
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#ifndef UTILITIES_HLSL
|
||||
#define UTILITIES_HLSL
|
||||
|
||||
float2 RotateUV(float2 UV, float2 Pivot, float Angle)
|
||||
{
|
||||
float s = sin(Angle);
|
||||
float c = cos(Angle);
|
||||
|
||||
UV -= Pivot;
|
||||
|
||||
float2 rotated = float2(
|
||||
UV.x * c - UV.y * s,
|
||||
UV.x * s + UV.y * c
|
||||
);
|
||||
|
||||
return rotated + Pivot;
|
||||
}
|
||||
|
||||
float3 GetScale(float3 PivotWS)
|
||||
{
|
||||
return float3
|
||||
(
|
||||
length(TransformObjectToWorld(float3(1, 0, 0)) - PivotWS),
|
||||
length(TransformObjectToWorld(float3(0, 1, 0)) - PivotWS),
|
||||
length(TransformObjectToWorld(float3(0, 0, 1)) - PivotWS)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user