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
0
Question by JDKnight · May 16, 2013 at 12:01 PM · shaderlight

I need help with 2D light effect by mask or something, please!

Hi there!

I'm struggling to find a solution to solve how to handle "faked" lights as you can see in the image attached. I'm thinking in grabbing a texture (render to texture) from a transparent layer (for example "queue"= "transparent+17") and render it in other in front of that ("queue" = "transparent+20). The idea is to "avoid" a plane with a color that tints the whole scene (p.e. at transparen+18 -) to get the original color behind and apply to it (fragment shader) the light flare texture and a geryscale mask with that form to lerp with the plane color too. But I can't tag the grabPass in a transparent layer different than the shader (That's one of my problems). Perhaps I'm thinking in a wrong way or someone can tell me another way to handle this problem.

Thank you very much! !

prueba luces.jpg (354.3 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

1 Reply

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

Answer by Fattie · May 16, 2013 at 12:29 PM

try this ... note you do need a damn transparent shader, of course:

alt text

  1. get 2dToolkit

  2. drop PNG in to collection

  3. make sprite in your scene

  4. add point light

  5. sit camera in front of image. sit light behind image

  6. use any transparent shader

  7. using your mouse, move the light back and fore and you will see it shining through the sprite with incredible beauty

this image shows the light is behind the sprite, and when you move it around it moves the stained-glass lighting of the sprite

alt text

Is this what you meant?

Note for future readers -- if you simply cast the light on to the FRONT OF the sprite (example, you don't have transparent shaders available) you can get a largely similar effect, really.


trivial.jpg (83.4 kB)
ez.png (178.8 kB)
Comment
Add comment · Show 9 · 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 JDKnight · May 17, 2013 at 01:35 PM 0
Share

Hi Fattie,

I tried yesterday at late hour your proposal, however, the point light illu$$anonymous$$ate just a little area in the sprite. Anyway, that's not the problem. I'm trying to find a cartoony effect similar to what I show you there and with your approach I can have it (even with a cookie texture in the light). I really appreciate your help (and could be a good solution) but it doesn't fit what I'm looking for (Indeed, it's is for sure texture render related and image combining). Sorry for answering a day late and any inconvenience I could cause to you.

Thank you!

avatar image Fattie · May 17, 2013 at 01:37 PM 0
Share

"the point light illu$$anonymous$$ate just a little area in the sprite"

huh?

make the light much larger. move it further away, and increase the intensity and the light's radiius.

avatar image JDKnight · May 17, 2013 at 01:45 PM 0
Share

Yes, that's exactly what I did but nothing happened. The area illu$$anonymous$$ated was the same. I followed the exact steps but using the sprites I have in the scene ins$$anonymous$$d using new ones. Perhaps I have a problem with the sprite properties in 2D toolkit (they are transparent too). I'll give it a try again later and I'll post the results again.

avatar image Fattie · May 17, 2013 at 01:52 PM 0
Share

What shader are you using ?

click on the sprite. click on the material. over on the left click on the material. now look at what shader you are using, lemme know

don't use the 2DT$$anonymous$$ shader for now

use Transparent/Diffuse

alt text

(Funnily enough ! by a bizarre coincidence, the T$$anonymous$$ guys are adding "see through glass effects" in the next version! can you believe it??)

screen shot 2013-05-17 at 15.51.35.png (30.0 kB)
avatar image JDKnight · May 17, 2013 at 02:11 PM 0
Share

Hi again,

The material is the same you point in your picture. When I get the point light near the illu$$anonymous$$ated area gets a maximum and then I can't illu$$anonymous$$ate more area. In the game the sprites are BlendVertex from 2DT$$anonymous$$. If Tk guys will make something similar to what I need it will be awesome!

Show more comments

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

14 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

Related Questions

Shader for Overlapping LIghts 0 Answers

Noob Question - Custom trees and aliasing 1 Answer

Shader: distort light direction besed on mesh 1 Answer

Why do terrain trees remain visible in complete darkness? 1 Answer

How to access the lights properties from within a shader? 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