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
2
Question by DaveA · Feb 26, 2011 at 07:16 AM · texturecolorlightmapshadow

Can transparent textures be lightmapped?

I'm wondering if there's any way to get textures to cast colored shadows? The effect is like a candle in a jar, where the jar (cylinder) has colored glass, and I want to have that spot or point light projected onto the table around it. Baked or realtime. Projector component? Doesn't seem like that would work. The best I've gotten so far is using a PNG with alpha using the Transparent/Diffuse shader will cast a gray shadow (the alpha of the PNG). I'd like to get the RGB's to contribute to the shadow too. Any ideas?

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
5
Best Answer

Answer by DaveA · Feb 27, 2011 at 05:10 AM

Get the source for the built-in shaders, edit Alpha-Diffuse to add this line to the properties block:

_TransparencyLM ("Transmissive Colour", 2D) = "white" {}

Rename it to something like Alpha-Diffuse-LM (in the code and the file name), and use that instead of Transparent/Diffuse.

See http://unity3d.com/support/documentation/Manual/LightmappingInDepth.html

Comment
Add comment · 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
0

Answer by JC Cappelletti · Apr 13, 2011 at 01:08 PM

I've found that the key to getting Beast to render any transparency into Lightmaps was in this note added recently to the Lightmapping manual.

"Note: When mapping materials to Beast, Unity detects the 'kind' of the shader by the shader's properties and path/name keywords such as: 'Specular', 'Transparent', 'Self-Illumin', etc."

To make this work, I needed to add "Transparent/" in front of the shader title like this:

Shader "RimBumpSpecCutout" {

Shader "Transparent/RimBumpSpecCutout" {

Simply adding the word Transparent into the title didn't work. I had to make "Transparent" the SubMenu name alone. It messed up my sorting in the Shader Menu, but with that simple addition, all the transparent and cutout shaders I had already worked without any other changes.

Unfortunately, it did not automatically make the Transmissive Color work since I didn't have that property in my shaders. I get how to add the _TransparencyLM property at the top of a shader, but what is the code for the bottom part:

o.Alpha = _TransparencyLM.rgb; ?????

Please let me know if anyone has this working.

Comment
Add comment · 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

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

1 Person is following this question.

avatar image

Related Questions

is it possible to make 2d real time coloring with masks (paint app) 1 Answer

Blinking lines on model after lightmapped? 0 Answers

Shader Texture Change 3 Answers

How do I fill a texture with one color? 2 Answers

Can't find a way to simplify this code... any help appreciated... 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