Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by tcz8 · Feb 13, 2017 at 09:22 PM · shader programmingshaderlabpivotshader writingrenderqueue

Why does changing a shader's Render Queue affect the pivot point of transform matrices?

I have been messing around with skewing vertex and uv map coordinates in a shader.

I acheived the effect that I wanted but when I change the render queue from Transparent to AlphaTest It's as if the pivot point moves or the transform' matrix behavior changes.

Basicly, the result of using my transform matrix changes and since im very new to unity I dont understand what is going on. I even read the manual.

What is going? What did I miss?

Thank you!

Comment
Add comment · Show 2
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 tcz8 · Feb 14, 2017 at 07:44 PM 0
Share

Revised the question to make it more to the point.

avatar image tcz8 · Feb 16, 2017 at 03:33 PM 0
Share

Bumpedibop

1 Reply

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

Answer by tanoshimi · Feb 19, 2017 at 06:03 PM

It shouldn't and it never has done for me. Most likely explanation I can suggest is that your changes are inadvertently enabling/disabling dynamic batching, which would cause the pivot point to become the "shared" pivot point of all meshes that were batched together using that material.

Comment
Add comment · Show 4 · 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 tcz8 · Feb 19, 2017 at 06:05 PM 0
Share

I have no clue if this is it yet, but thank you so much for giving something to investigate! I shall run tests and if you are right we shall make this an answer! Thank you!

avatar image tcz8 · Feb 19, 2017 at 06:44 PM 0
Share

Wow, that was it! I didn't exactly confirm it was dynamic batching as I dont know how (I'll just trust you on that one) but creating a unique material for one of the sprites fixed the issue for that one sprite.

Does this mean I will not be able to use batching on any of my sprites? or is there a way around that pivot issue while batching?

And while were at it does this mean that using the Transparent render queue disables dynamic batching?

BTW please create an answer so I can accept it!

Thank you so much!

avatar image tanoshimi tcz8 · Feb 19, 2017 at 08:09 PM 0
Share

If you want to do any kind of shader transformation in model-space coordinates, then yes you'll have to disable dynamic batching on that shader (add the "DisableBatching=true" tag, as explained at https://docs.unity3d.com/$$anonymous$$anual/SL-SubShaderTags.html)

avatar image tcz8 tanoshimi · Feb 19, 2017 at 08:22 PM 0
Share

Thank you.

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

64 People are following this question.

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

Related Questions

Surface shader changing z value 0 Answers

Fog not working in my Shader~ 0 Answers

Help converting stencil shader in HDRP 1 Answer

Obtaining relative speed of vertex in a shader 1 Answer

How i get unity linear fog start and end values in shaderlab. 1 Answer


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