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 bouke1 · Dec 11, 2011 at 10:33 PM · lightinglightprojectoremissive

how to make projector shader behave like vertex lit shader

hi i have an object that on selection has an marker projected on the ground with a projector. now is this marker a bit dark and i would like to brighten up this marker by making it emit light. only the standard shader for the projection are insufficient.

can someone help me to make the shader emit light, or is it just impossible with a projector.

an other option would be helpful.

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

2 Replies

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

Answer by bouke1 · Dec 12, 2011 at 04:00 PM

I've found a solution,

 Shader "Projector/Light" {
   Properties {
         _Color ("Main Color", Color) = (1,1,1,1)       
      _ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
      _FalloffTex ("FallOff", 2D) = "" { TexGen ObjectLinear }
   }
   Subshader {
      Pass {
         ZWrite off
         Fog { Color (0, 0, 0) }
         Color [_Color]
         ColorMask RGB
         Blend DstColor One
         Offset -1, -1
         SetTexture [_ShadowTex] {
            combine texture +  primary , ONE - texture //used to be multiply now is add
            Matrix [_Projector]
         }
         SetTexture [_FalloffTex] {
            constantColor (0,0,0,0)
            combine previous lerp (texture) constant
            Matrix [_Projector] //used to be _projectorClip
         }
      }
   }
 }



this is the projector light shader but modified

and the textures that was on the _fallofftex i changed it to my main texture, that has an alpha channel and the matrix of the falloftex has been changed to the same matrix as the _shadowtex

Comment
Add comment · Show 2 · 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 Jessy · Dec 12, 2011 at 04:28 PM 0
Share

That is overcomplicated. I have no idea what you're trying to do; text is not enough to explain this. But if it works, it works. ;-) Regardless, you don't need to lerp to black. Lerping to black is the same as multiplying.

avatar image bouke1 · Dec 12, 2011 at 07:43 PM 0
Share

just modified the "projector/light" shader so that it works for me

avatar image
0

Answer by Jessy · Dec 11, 2011 at 11:23 PM

There is no such thing as "light" in the innards of your 3D app's code. "Light" generally refers to RGB values that get multiplied into your main texture. Spotlights and projectors are essentially the same thing; the difference is, you deal with spotlights in the shaders that are used by individual objects' materials, and projectors blend the same material onto every object with which they interact. As such, spotlights offer more flexibility at the expense of complexity. You need to delve a little deeper into what is going on in your renders, and then decide what is appropriate.

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 bouke1 · Dec 12, 2011 at 09:50 AM 0
Share

im trying to get the projector texture behave the same way it would when it is put on a plane with a vertex lit shader with emissive set to white with full alpha.

avatar image Jessy · Dec 12, 2011 at 02:40 PM 0
Share

Are you talking about an "unlit" shader? i.e. The projector will just project a texture that isn't affected by light? I doubt there's a point in having vertex lighting if all it's going to do is cause overbrightening. But if that's what you're going for, sure, use light. Otherwise, project this: http://www.unifycommunity.com/wiki/index.php?title=Texture_Only

avatar image bouke1 · Dec 12, 2011 at 02:49 PM 0
Share

the problem is that i use a projector that adds a texture to the existing one. and that one has (at the moment) no lighting. and for the projector to work it has to have a projector shader. or at least one that uses the components of that shader to work. but i think i have found a solution on my own and will post it below

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Neither Emissive Texture or Area Light is Working 0 Answers

How to make a GameObject not hittable by shadows ? 2 Answers

Do I still need lightmaps? 1 Answer

How to prevent Overlapping Lights from combining / adding intensity? 3 Answers

Realtime emission material during runtime 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