summaryrefslogtreecommitdiffstats
path: root/3ner.cginc
diff options
context:
space:
mode:
Diffstat (limited to '3ner.cginc')
-rw-r--r--3ner.cginc10
1 files changed, 9 insertions, 1 deletions
diff --git a/3ner.cginc b/3ner.cginc
index db10781..9b73a53 100644
--- a/3ner.cginc
+++ b/3ner.cginc
@@ -16,6 +16,7 @@
#include "interpolators.cginc"
#include "ray_marching.cginc"
#include "vertex.cginc"
+#include "impostor.cginc"
v2f vert(appdata v) {
#if defined(SHADOW_CASTER_PASS) && !defined(_SHADOW_CASTER)
@@ -28,6 +29,12 @@ v2f vert(appdata v) {
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
+#if defined(_IMPOSTORS)
+ float3 impostorWorldPos = mul(unity_ObjectToWorld, v.vertex);
+ impostor_vert(v.vertex, impostorWorldPos);
+ v.vertex = mul(unity_WorldToObject, float4(impostorWorldPos, 1));
+#endif
+
#if defined(_TESSELLATION)
o.tpos = v.vertex;
#endif
@@ -53,6 +60,7 @@ v2f vert(appdata v) {
deform_normal(o.objPos, o.normal.xyz, o.tangent.xyz);
#endif
deform(o.objPos);
+
propagateObjPos(o);
UNITY_TRANSFER_LIGHTING(o, v.uv1);
@@ -63,7 +71,7 @@ v2f vert(appdata v) {
TRANSFER_SHADOW(o);
#endif
- return o;
+ return o;
}
//ifex _Tessellation_Enabled==0