• 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 valoh · Jan 09, 2012 at 01:05 PM · renderorderqueueorder-of-executionrenderwithshader

render order/ multipass shaders (hidden surface shader path)

Is it possible to render one material / shader with two passes in different Queues?

I have a character surface shader and a pass for rendering the character with special color behind objects (zfail). It is important that for multipart characters all special passes of all character (parts) are rendered first and then all surface shader passes of all character (parts).

I gave the pass a different Queue Tag but this changed nothing:

 Shader
 {
   Subshader
   {
     Pass
     {
       // hidden surface pass
       Tags { "Queue"="Transparent-2" }
       // ..
     }
 
     // main rendering surface shader
     Tags { "Queue"="Transparent-1" }
     // ..
   }
 }



Am I doing something wrong? Is it possibly what I want or do I need to solve that with custom scripting (and painting)?

Comment
Add comment · Show 3
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 valoh · Jan 16, 2012 at 08:00 AM 0
Share

ok, as the unity material system is not as powerful as i thought: what is is the most efficient way to render the characters with a special shader? First I thought replacement shaders would be what I need, but the characters need to be rendered during normal rendering with the special shader: rendering static level rendering hidden surface shader characters rendering character normal material

Which is not possible if I understand the replacement correctly.

Are there better ways than duplication the gameobjects with a skinned mesh renderer using the special material?

avatar image valoh · Jan 16, 2012 at 03:30 PM 0
Share

is object duplication the only way? any better suggestions?

avatar image Jessy · Jan 16, 2012 at 03:47 PM 0
Share

$$anonymous$$aybe you should log a bug about the material system. I'm not sure if they consider it a bug or feature request. I can't help you further without knowing more about what you actually need to do. You've figured out all you can, in terms of what you've said you need to do. However, there may be a different way of tackling the problem than what you have come up with, subverting the lack of flexibility of the material system.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jessy · Jan 09, 2012 at 03:18 PM

Queue is not a Pass tag. It is a SubShader tag, and has no effect within Pass{}. You'll have to use multiple materials to do this, if you really have to do what you said you need to do. Try to think of a way to avoid that if you can, as Unity doesn't make this easy on you. It's not a big deal if you only have one submesh, but if you have multiple, you're probably out of luck for that object.

Comment
Add comment · Show 1 · 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 valoh · Jan 11, 2012 at 06:01 PM 0
Share

unfortunately our characters have multiple submeshes/part. what is the easiest way to paint them additionally with the special hidden surface pass (before regular rendering)?

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

render object on top of everything with dynamic shadows (for mobile) 1 Answer

Render to Texture artifacts 0 Answers

Billboard trees - changing the render queue 0 Answers

Queue Order and Billboarded Trees 0 Answers

Shader with adjustable render queue 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges