Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by jesta · Jun 14, 2012 at 02:16 PM · shadervertexlimitsurfaceinstructions

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!

Comment
Add comment · Show 12
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Wolfram · Jun 14, 2012 at 02:36 PM 1
Share

1024 instructions in a vertex shader? o_O

What are you trying to accomplish? $$anonymous$$aybe some optimization by hand is in order ;-)

avatar image jesta · Jun 14, 2012 at 02:53 PM 0
Share

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).

avatar image whydoidoit · Jun 14, 2012 at 06:19 PM 1
Share

@Dwarfius Ho hum, I've got a lot to learn. Like the meaning of about half the words in those last two comments :)

avatar image Wolfram · Jun 14, 2012 at 06:31 PM 1
Share

I'd sure like to see a short demo/vid, when you get it running, or at least some snapshots! :o)

avatar image jesta · Jun 14, 2012 at 06:33 PM 1
Share

Sure, I'll have a Showcase thread up by next week and I'll post the link here :).

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

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)"

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jesta · Jun 14, 2012 at 03:48 PM 0
Share

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."

avatar image Wolfram · Jun 14, 2012 at 06:30 PM 0
Share

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.

avatar image jesta · Jun 14, 2012 at 11:17 PM 0
Share

Ok, I can set #pragma target 3.0 with surface shaders, but it still gives me the instruction limit error...

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges