rj-action-library/Runtime/Shading/Library/Transform.gdshaderinc

10 lines
242 B
Plaintext
Raw Normal View History

2024-08-11 17:38:06 +00:00
vec3 localToWorld( vec3 _VERTEX, mat4 _MODEL_MATRIX )
{
return ( _MODEL_MATRIX * vec4( _VERTEX, 1.0 ) ).xyz;
}
vec3 worldToLocal( vec3 _VERTEX, mat4 _MODEL_MATRIX )
{
return ( inverse( _MODEL_MATRIX ) * vec4( _VERTEX, 1.0 ) ).xyz;
}