- Home /
Vertex program max instructions limit
Is there any way to increase the 1024 instructions limit in a vertex program when using a surface shader as such : #pragma surface surf Lambert vertex:vert
?
In my case, the vert
function generates an error complaining about the max (1024) instructions in the shader.
Thanks!
1024 instructions in a vertex shader? o_O
What are you trying to accomplish? $$anonymous$$aybe some optimization by hand is in order ;-)
I'm calculating the height of each vertex with a multifractal noise function (over several octaves) and then calculating the tangent and bitangent vectors to generate normals (which requires 4 additional noise computations).
@Dwarfius Ho hum, I've got a lot to learn. Like the meaning of about half the words in those last two comments :)
I'd sure like to see a short demo/vid, when you get it running, or at least some snapshots! :o)
Sure, I'll have a Showcase thread up by next week and I'll post the link here :).
Answer by jesta · Jun 14, 2012 at 11:43 PM
OK, finally found a solution. Adding #pragma target 3.0
helped, but it wasn't enough. I needed to add #pragma exclude_renderers opengl
to compile the shaders without any instruction limit errors.
Thanks Wolfram!
Answer by Wolfram · Jun 14, 2012 at 03:41 PM
Hm, the docs say, with #pragma target 3.0
it should support "ARB_vertex_program with no instruction limit and ARB_fragment_program with 1024 instruction limit (512 texture + 512 arithmetic)"
You're right, but specifying #pragma target 3.0
forces me to use vertex and fragment programs. I'm currently using surface shaders, which GREATLY simplifies the lighting/shading process.
"When compiling to 3.0 target, both vertex and fragment programs need to be present."
Sorry, in that case I'm out of ideas. :-/
Except switching to vert/frag. Depending how complex your surf() is, it might be not that hard, standard diffuse or bump vert/frag shaders should be available somewhere.
Ok, I can set #pragma target 3.0 with surface shaders, but it still gives me the instruction limit error...
Your answer
Follow this Question
Related Questions
Surface Shader, run vertex multiple times 0 Answers
Vertex Texture Lookup Breaking in Unity 3.5 0 Answers
How do I create an unlit reflective shader. 0 Answers
Is it possible to get back data for a specific vertex from a shader ? 0 Answers
Modify vertex position using shaders on Windows Phone 8 0 Answers