- Home /
Question by
ZiZoN · Jun 10, 2017 at 02:35 PM ·
shadershader programmingcghlslinstancing
how to approach instanceID in shader?
SkinnedMeshRenderer didn't batched in Unity. so i will implement GPU Skinning with GPU Instancing. i try to approach instanceID(like SV_InstanceID), but they are wrapped in preprocessor macro. so i find in built in shader(version is 5.6.1f). and i found this comment.
// basic instancing setups
// - UNITY_VERTEX_INPUT_INSTANCE_ID Declare instance ID field in vertex shader input / output struct.
// - UNITY_GET_INSTANCE_ID (Internal) Get the instance ID from input struct.
and im in frustration.. "Internal" keyword make me embrassed. i have just only one question.
Can i use "instanceID" in shader code?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612123659im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Porting from ShaderToy(GLSL) to shaderlab(HLSL/CG) unity not giving me the desired result. 2 Answers
How do you change Point Size in Direct3d 11 shader? 1 Answer
Shader broke after update from 5.4 to 5.5 2 Answers
Sharing variables across shader passes. Is it possible? 0 Answers
regarding Shader Optimization 0 Answers