Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float4 Triplanar(sampler2D Texture, float Tiling, float3 offset, float3 Pos, float3 Normals) {
- float4 albedoX = tex2D(Texture, Pos.zy*Tiling + offset.zy);
- float4 albedoY = tex2D(Texture, Pos.xz*Tiling + offset.xz);
- float4 albedoZ = tex2D(Texture, Pos.xy*Tiling + offset.xy);
- float3 triW = abs(Normals);
- triW /= (triW.x + triW.y + triW.z);
- return albedoX * triW.x + albedoY * triW.y + albedoZ * triW.z;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement