diff options
| author | yum <yum.food.vr@gmail.com> | 2025-10-12 15:00:47 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-10-12 15:00:47 -0700 |
| commit | 6ac3da1b0bd363d70c2f6e4b7b921f2f929dedac (patch) | |
| tree | cc09ebbdd7bd101bccd2f9d594279f5f66370c63 /pbr.cginc | |
| parent | d2090f73f3e4f08cdbd3c3b82eb7f3ba9f459dd0 (diff) | |
add uv scroll, aniso16, and finish tubes
Diffstat (limited to 'pbr.cginc')
| -rw-r--r-- | pbr.cginc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -53,18 +53,22 @@ void apply_marble(float3 world_pos, inout float3 albedo) { Pbr getPbr(v2f i) { Pbr pbr = (Pbr) 0; - pbr.albedo = _MainTex.Sample(trilinear_repeat_s, i.uv0 * _MainTex_ST.xy); +#if defined(_UV_SCROLL) + i.uv0 += _Time[0] * _UV_Scroll_Speed; +#endif // _UV_SCROLL + + pbr.albedo = _MainTex.Sample(aniso16_trilinear_repeat_s, i.uv0 * _MainTex_ST.xy); pbr.albedo *= _Color; apply_marble(i.worldPos, pbr.albedo.xyz); - float3 normal_tangent = UnpackNormal(_BumpMap.Sample(trilinear_repeat_s, i.uv0 * _BumpMap_ST.xy)); + float3 normal_tangent = UnpackNormal(_BumpMap.Sample(aniso16_trilinear_repeat_s, i.uv0 * _BumpMap_ST.xy)); normal_tangent.xy *= _BumpScale; // Map from tangent space to world space. float3 bitangent = cross(i.normal, i.tangent.xyz) * i.tangent.w; pbr.tbn = float3x3(i.tangent.xyz, bitangent, i.normal); pbr.normal = normalize(mul(normal_tangent, pbr.tbn)); - float4 metallic_gloss = _MetallicGlossMap.Sample(trilinear_repeat_s, i.uv0 * _MetallicGlossMap_ST.xy); + float4 metallic_gloss = _MetallicGlossMap.Sample(aniso16_trilinear_repeat_s, i.uv0 * _MetallicGlossMap_ST.xy); pbr.smoothness = metallic_gloss.a * _Glossiness; pbr.metallic = metallic_gloss.r * _Metallic; #if defined(_CLEARCOAT) |
