The question is answered, right answer was accepted
Unity Shader Invalid Subscript 'boxMax'
My error is this:
Shader error in 'Volund/Standard Character (Specular) ' : invalid subscript 'boxMax' at Assets/Features/Shared/Volund_UnityStandardCore.cginc(261) (on d3d11)
Compiling Vertex program with DIRECTIONAL _NORMALMAP _SPECGLOSSMAP
Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDf2 SHADER_API_DESKTOP UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA
I pasted the full error above so please do see it.
And Below is my code of the shader:
d.boxMax[0] = unity_SpecCube0_BoxMax;
d.boxMin[0] = unity_SpecCube0_BoxMin;
d.probePosition[0] = unity_SpecCube0_ProbePosition;
d.probeHDR[0] = unity_SpecCube0_HDR;
d.boxMax[1] = unity_SpecCube1_BoxMax;
d.boxMin[1] = unity_SpecCube1_BoxMin;
d.probePosition[1] = unity_SpecCube1_ProbePosition;
d.probeHDR[1] = unity_SpecCube1_HDR;
because of that error Now i changed it to this:
#if UNITY_SPECCUBE_BLENDING || UNITY_SPECCUBE_BOX_PROJECTION
d.boxMin[0] = unity_SpecCube0_BoxMin;
d.boxMin[1] = unity_SpecCube1_BoxMin;
#endif
#if UNITY_SPECCUBE_BOX_PROJECTION
d.boxMax[0] = unity_SpecCube0_BoxMax;
d.boxMax[1] = unity_SpecCube1_BoxMax;
d.probePosition[0] = unity_SpecCube0_ProbePosition;
d.probePosition[1] = unity_SpecCube1_ProbePosition;
error now: variable 'd' used without having been completely initialized.
What my problem here is i successfully converted my .exe application to .apk application but the when i opened it on my device it's just a dark screen and it show the error above after i build it. What could be the problem? Cause i'm speculating that the error above is cause
Answer by Ginxx009 · Feb 26, 2018 at 02:59 AM
For everyone that doesn't solve their problem with the answer of @dishant27 here's what i did
Method_1
#if UNITY_SPECCUBE_BOX_PROJECTION
d.boxMax[0] = unity_SpecCube0_BoxMax;
d.probePosition[0] = unity_SpecCube0_ProbePosition;
d.boxMax[1] = unity_SpecCube1_BoxMax;
d.boxMin[1] = unity_SpecCube1_BoxMin;
d.probePosition[1] = unity_SpecCube1_ProbePosition;
#endif
Method_2 By @dishant27
Go to Edit-> Project Settings -> Graphics. Uncheck "Use Default" in Tier1 and then, check "Reflection probes box projection". If, it doesn't work try doing the same for Tier2 and Tier3.
Answer by dishant27 · Dec 06, 2017 at 10:35 AM
This method worked for me. Go to Edit-> Project Settings -> Graphics.
Uncheck "Use Default" in Tier1 and then, check "Reflection probes box projection". If, it doesn't work try doing the same for Tier2 and Tier3.
Thanks @dishant27! You just saved me from a similar fate.
@dishant27 THAN$$anonymous$$ YOU Very much Bro you saved me also !
Worked for me, I did i for all three Tiers, don't see why you would ever leave one out.
Follow this Question
Related Questions
is device supported to cardboard game or not? 0 Answers
Unity Ads rewarded video no result, Android 1 Answer
Unity 2017.2.0b9 ARCore build&run with Pixel XL (Android 8.0) Failed 0 Answers
Unity Android Voice Recognition 0 Answers
Monetization breaks iOS build in XCode. Also breaks Android build. 1 Answer