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 Peaj · Apr 13, 2015 at 02:01 PM · unity 5shaderlightmaplightmappingreplacement shader

Replacing lightmap shader pass

Since I want to have more control over how the lightmap gets applied in the shader I would like to know where I can find the lightmap calculations in the CGIncludes files and if its possible to replace them.

Atm I am mainly interested in the non directional lightmaps.

I found the two files "Internal-DeferredShading" and "Internal-PrePassLighting" which seem to be responsible for the lighting. I put them into the Resources folder. To see any differences I changed the "CalculateLight" return value to "return half4(0,0,1,1);" in both files but it does not seem to change anything.

I am not sure if the files are not used at all or if the standard shader is just not using those passes.

Comment
Add comment · Show 10
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 KdRWaylander · Apr 13, 2015 at 03:11 PM 0
Share

I think it's juste beside your scene file in the project view, in a folder with the same name. Not sure if it's what your looking for ^^

avatar image Peaj · Apr 14, 2015 at 09:03 AM 0
Share

$$anonymous$$aybe it wasn't clear enough. I am not looking for the Texture but for the shader part where the Lightmap gets multiplied with the other colors.

avatar image Pangamini · Apr 14, 2015 at 09:22 AM 0
Share

http://docs.unity3d.com/$$anonymous$$anual/SL-SurfaceShaderLighting.html Does this work with Unity 5?

avatar image Peaj · Apr 14, 2015 at 11:30 AM 0
Share

Thanks. This solves at least a part of my problem.

Now I know how to write my own lighting function and I even found the file "Lighting.cginc" where the standard lighting methods are defined. Now I still have the problem that I want to replace those methods ins$$anonymous$$d of adding another one. I want the unity shaders, espacially the standard shader to use my new lighting method without the need to rewrite/replace every single shader. I know that its possible to override the terrain shader like here: http://forum.unity3d.com/threads/replacing-terrain-shader.59299/ But is it also possible to replace cginc files? I tried to put it into my Resources folder but it does not seem to work.

avatar image Pangamini · Apr 14, 2015 at 11:32 AM 0
Share

I think that deferred renderer only uses one lighting mode for everything. Otherwise i can't help you

Show more comments

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

19 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 avatar image avatar image avatar image avatar image

Related Questions

Directional lightmap in custom shader. 1 Answer

Lightmap options in a custom shader 0 Answers

Random lightmap switching 0 Answers

where is Unity's shader handeling lightmapping? 1 Answer

Lightmapping on a custom shader 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