标签:star 实例 rop shader data logs bsp http rar
参考
https://www.cnblogs.com/hont/p/7143626.html
github地址
https://github.com/yingsz/instancing/
补充2点:
1怎么add per instancing objet data
代码里使用set*Array,比如
mat.SetVectorArray("LightMapOffSets", lightmapOffSet);
shader里面使用这个lightmapoffset,如下
sampler2D Lightmap; UNITY_INSTANCING_CBUFFER_START(LightMapOffSets) UNITY_DEFINE_INSTANCED_PROP(half4, _OffSet) UNITY_INSTANCING_CBUFFER_END
取值的地方
half4 offset = UNITY_ACCESS_INSTANCED_PROP(_OffSet);
2支持lightmap
感谢Solar Rain同学的提醒
这个之前有个误区,以为烘焙后每个实例的uv2不一样,其实是一样。
标签:star 实例 rop shader data logs bsp http rar
原文地址:https://www.cnblogs.com/marcher/p/9671009.html