Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by Jimadybobalon · Nov 05, 2013 at 01:50 PM · camerashaderrendering

(Non-Euclidean) Overlapping Textures with Multiple Cameras Problem

Hello~

I have a big problem with displaying some overlapping textures the way I want to. I'm creating a 2D Non-Euclidean Dungeon and so because of the logic (or lack thereof) of Non-Euclidean space, some rooms can overlap. Or seem to, at least, thinking in a Linear sense.

And this is where my problem occurs. Because of the overlapping rooms I figured I'd have to have multiple cameras to render them correctly at the correct times. However I'm using 2D Volumetric Lights from the Asset store, and the shaders it uses seem to just merge the object with the 2D Light mesh at render, which means that as long as there is a light over the space of an object, the later cameras will render it, regardless of what layer the light that was rendered was on... as shown here:

In this image you can see from the first room into the room drawn by LayerCamera1. Everything looks fine and great.

alt text

This is the room drawn by LayerCamera2 (which draws before 1, sorry for silly naming conventions there). Here you can see that it renders 2, then draws the first room over it when LayerCamera1 draws.

alt text

Even though the camera itself can see nothing, it merges itself with what was already onscreen because of the shaders. Which confuses me to all hell, as only the correct light (that's on the correct layer that's visible by the correct camera) can enter it's set room, no other light can, and to me it seems like it's the light shader that does the combining at the end. Oh well, I'm terrible at shaders anyhoo. Here are the shaders as well, by the way:

This is the object shader:

Shader "2DVLS/Diffuse" {

Properties { _MainTex ("Base (RGB) Trans. (Alpha)", 2D) = "white" { } }

 Category
 {
     ZWrite On
     Cull Back
     Lighting Off

     SubShader
     {
         Pass 
         {
             ColorMask 0
         }

         Pass
         {
                Blend DstColor DstAlpha

             SetTexture [_MainTex] 
             { 
                 combine texture
             }             
         }
     } 
 }

 Fallback "Diffuse"

}

And this here is the light shader (for the lightmesh itself)

Shader "2DVLS/Light" {

Properties { _MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white" } Category {

    Lighting Off
    ZWrite Off
    
    //Tags { "Queue" = "Geometry-10" }

    Blend One One
    
    BindChannels {
           Bind "Color", color
           Bind "Vertex", vertex
           Bind "TexCoord", texcoord
    }
    
    SubShader 
    {
         Pass 
         {
            SetTexture [_MainTex] 
            {
                Combine texture * primary
            }
         }
     } 
 }

}

Any help at all would be greatly appreciated! Whether it's pointing out a mistake, suggesting another method or pointing out my idiocy for not using an obvious idea in the first place! Thanks~ :)

screen shot 2013-11-05 at 11.28.59.png (49.7 kB)
screen shot 2013-11-05 at 11.29.18.png (49.5 kB)
Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

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

15 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

Related Questions

2.5D perspective rendering order challenges 2 Answers

Is particular object visible 1 Answer

Using a camera replacement shader but keeping the underlying (original) colors? -4 Answers

Access Unity Projector Buffer 0 Answers

stencil mesh,stencil mesh-how to i get a stencil mesh to a camra rendering pipe to cull the mesh behand the mesh. dimish the draw call count 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