Custom Render Texture failing

Using the new Custom Render Texture in Unity 2017.1

building using 2017.1.0p3 for IOS

shader error:

12034: [Unity] Player export failed. Reason: Shader error in 'Hidden/WaterDisplacement': 'asuint' : no matching overloaded function found at /UNITY_PATH/Unity/Unity-2017_1_0p3/Unity.app/Contents/CGIncludes/UnityCustomRenderTexture.cginc(189) (on gles)

looking here: asuint - Win32 apps | Microsoft Learn

says Shader Model 3 not supported :hushed:
but Docs say use SM3 (Shader example at end): https://docs.unity3d.com/Manual/CustomRenderTextures.html

So…

We solved this by removing: #include “UnityCustomRenderTexture.cginc”, copying the contents of that file into the shader and removing “OUT.primitiveID = asuint(CustomRenderTexturePrimitiveIDs[primitiveID]);”

We don’t need access to the primitiveID. Build compiles now

2 Likes