- Home /
Help! Bad texcoord index!!!?
(Still happening in 3.5.5f3 - this is an unresolved issue )
Starting with unity3.5.3 ( I don't know the exact update, but the update before 3.5.4f1 ) We have a problem with "Bad texcoord index" errors and crashes
With Some clues from: http://forum.unity3d.com/threads/23924-more-than-four-textures-in-one-pass
removing some textures on our shader seem to fix the problem
turning off shadows fixes the problem
this problem is only directX - OpenGL on OSX is fine
This is very limiting, our shader needs Color Map Self Illum/Other special purposes Map NormalMap And Cubemap for reflections
Removing one of these maps seems to fix the problem, but would require changing our art.
Please Help
Thanks
Addendum : reported bug (Case 481853) Bad texcoord index errors and crashes still waiting to hear back
just to don't use some texcoords. use for example for bumpmap and selfillum textures mapping from main texture.
we're just using float2 uv_$$anonymous$$ainTex; float2 uv_Bump$$anonymous$$ap;
dropping down to uv_$$anonymous$$ainTex doesn't fix the issue
any other ideas? Thanks!
Answer by snakeylake · Aug 02, 2012 at 11:10 PM
Shaders attached. I've confirmed that the issue does NOT happen in 3.5.2f2.
The issue goes away if I disable vertex lighting. ( comment out #define VERTEX_COLOR_LIGHTING )
shader compiles ok with both
#define VERTEX_COLOR_LIGHTING
and
//#define VERTEX_COLOR_LIGHTING
Unity version 3.5.4f1
how can i reproduce the error?
Answer by snakeylake · Aug 03, 2012 at 06:28 PM
Scroodge, Thanks for you interest! the error doesn't happen on shader compile here is an untextured project with the error ( open the test scene and make sure shadows are enabled an you should see an error - I couldn't upload textures on this post because it says there isn't enough space... the same error happens when it is textured )
The issue may be related to how the mesh was created... ( maybe the vertex colors in the mesh allow it to happen, stock unity sphere don't seem to cause the error )
Answer by ScroodgeM · Aug 04, 2012 at 10:52 AM
link: http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaderExamples.html
citation: If you want to do reflections that are affected by normal maps, it needs to be slightly more involved: INTERNAL_DATA needs to be added to the Input structure, and WorldReflectionVector function used to compute per-pixel reflection vector after you've written the Normal output.
solution:
replace this:
texCUBE(_Cube, IN.worldRefl)
and all same calculations based on worldRefl with this:
texCUBE(_Cube, WorldReflectionVector (IN, o.Normal))
Your answer
Follow this Question
Related Questions
Is the final look of a model,in-game work done in a modeling software or inside unity? 2 Answers
Strange shadow/texture issue on Save Scene 0 Answers
Best way to add a simple smudge effect? 0 Answers
Shader to transition between lit and shadowed area 0 Answers
Changing Unity's Graphics Engine? 2 Answers