Alright. I’ve gotten as far as figuring out that the tiling and offset values in a shader are dictated in the UnityCG include files where one calls TRANSFORM_TEX pre-processor and I’ve seen CG examples of applying this… but I’m a bit lost as to applying it in a GLSL context.
Shader error in 'GLSLFastSpec': GLSL Error in Vertex Shader: ERROR: 0:176: '' : syntax error preprocessor command must not be preceded by any other statement in that line
ERROR: 0:176: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type '2-component vector of float' and a right operand of type 'uniform sampler2D' (or there is no acceptable conversion)
ERROR: 0:176: 'pre-mature EOF' : syntax error syntax error
at line 0
Something about the Pre-processor that’s broken. Not sure what though. Inside UnityCG.glslinc we have:
// Transforms float2 UV by scale/bias property (new method)
#define TRANSFORM_TEX(tex,name) (tex.xy * name##_ST.xy + name##_ST.zw)
// Transforms float4 UV by a texture matrix (old method)
#define TRANSFORM_UV(idx) (gl_TextureMatrix[idx] * gl_TexCoord[0] ).xy
I pretty much just hand-wrote the TRANSFORM Text myself in my shader directly and it worked. How odd.
I’m not understanding your troubles, but thanks for this find – it works perfectly. I’m not too skilled with decoding what #pragma debug spits out yet.
Well, I’m surprised that there’s something I discovered that you didn’t know. I’ve been reading most of the Shaderlab threads with your expertise, you’ve single-handedly got me up to speed on the subject. (if the speed were largely slowish… Shaders are clumsy awkward vodoo)
The problem is, while ShaderLab itself has good documentation, and there are lots of references for GLSL, it’s very hard for me to figure out how to access the data that I need from Unity to make shaders happen. I get the impression that Unity Tech is anti-GLSL, sees shaders as part of their source code that they’re forced, at this time, to let loose without a source code license, and with the stigma of shaders basically being magic to most developers (due in my opinion to lack of good educational material), they don’t feel the desire to help us write our own. That sentiment could be way off the mark, but it’s how it comes off to me.