diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-18 14:59:59 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-18 14:59:59 -0800 |
| commit | 6504b2c4631bab477838548167b88c1052eac263 (patch) | |
| tree | e7d3aa4d19a21e624927a6771e2aeb4815af9393 /3ner.cginc | |
| parent | fbe7ed126883b0c4a1d5115e5c953bc244bc0214 (diff) | |
Grass: add crude instancing code
Diffstat (limited to '3ner.cginc')
| -rwxr-xr-x | 3ner.cginc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -15,6 +15,7 @@ #include "lighting.cginc" #include "globals.cginc" #include "interpolators.cginc" +#include "instancing.cginc" #include "ray_marching.cginc" #include "vertex.cginc" #include "impostor.cginc" @@ -30,6 +31,9 @@ v2f vert(appdata v) { UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Apply instance texture offset transformation if enabled + instancing_vert(v); + #if defined(_IMPOSTORS) impostor_vert(v.vertex.xyz); #endif @@ -262,6 +266,9 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace return 0; #endif + // Apply instancing effects (e.g., distance culling) + instancing_frag(i); + #if defined(_RAY_MARCHING) const bool is_fragment = true; ray_march(i, is_fragment); |
