Hello,
I don't apply a lightmap properly to a vertext/fragment shader.
I make this simple shader to test. (attatched to this post)
Please any help?
Thanks
How to add a lightmap?
How to add a lightmap?
- Attachments
-
- Unlit.zip
- (2.25 KiB) Downloaded 1150 times
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: How to add a lightmap?
mossman wrote:Hello,
I don't apply a lightmap properly to a vertext/fragment shader.
I make this simple shader to test. (attatched to this post)
Please any help?
Thanks
Hello,
Thank you for getting in touch, we would be happy to help.
What's the intended effect?
The Lightmap decode node simply accesses the required per-object information and allows you to derive some information, as we do with custom lighting but, unfortunately, without additional steps/tools, you cannot rewrite Unity lightmaps.
Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: How to add a lightmap?
Hello Ricardo,
The inteded effect is apply to my shader de lightmap generated by Unity. I want not rewrite Unity lightmaps.
The achieved effect: The desired effect:
Thanks
The inteded effect is apply to my shader de lightmap generated by Unity. I want not rewrite Unity lightmaps.
The achieved effect: The desired effect:
Thanks
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: How to add a lightmap?
Using the Unlit shader you shared, the lightmap should be visible immediately after pressing play. Is that not the case?mossman wrote:Hello Ricardo,
The inteded effect is apply to my shader de lightmap generated by Unity. I want not rewrite Unity lightmaps.
The achieved effect: The desired effect: Thanks
Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: How to add a lightmap?
The result of the shared shader is the achieved effect image. All the surface of the mesh is dark and some part are more dark than others.
If I created a simple unlit shader with a tint color like this material. And then I will bake the lightmap from the Lightning panel with this settings the lightmap doesn't affect the simple unlit shader. Thanks
If I created a simple unlit shader with a tint color like this material. And then I will bake the lightmap from the Lightning panel with this settings the lightmap doesn't affect the simple unlit shader. Thanks
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: How to add a lightmap?
Hello,
Thank you for sharing additional details.
We'll run a few more tests on our side and get back to you as soon as possible.
Apologies for the inconvenience.
Thank you for sharing additional details.
We'll run a few more tests on our side and get back to you as soon as possible.
Apologies for the inconvenience.
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: How to add a lightmap?
Upon investigating this situation, we came to conclude that this is not an ASE related issue, the lightmap ST calculations must be done manually since the ST variables do not use the termination "_ST", and instead drop the "_" in favor of only "ST", so an automatic ST variable is being used that does not match the right variable.
Please refer to the following screenshot as a working solution.
Do note that you must select the proper UV channel in the Vertex Texcoord node!
Please let me know if this helps, thanks!
Please refer to the following screenshot as a working solution.
Do note that you must select the proper UV channel in the Vertex Texcoord node!
Please let me know if this helps, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: How to add a lightmap?
Thanks Ricardo.
I test your solution but now the result is that all cubes with this shader are full white. I attatched the new version of the shader.
In the Vertex Texcoord node I selected the UV channel 1 and in the Texture Sample node (unity_Lightmap) I selected the UV set 1.
I test your solution but now the result is that all cubes with this shader are full white. I attatched the new version of the shader.
In the Vertex Texcoord node I selected the UV channel 1 and in the Texture Sample node (unity_Lightmap) I selected the UV set 1.
- Attachments
-
- Unlit2.rar
- (2.3 KiB) Downloaded 1828 times
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: How to add a lightmap?
Hello,mossman wrote:Thanks Ricardo.
I test your solution but now the result is that all cubes with this shader are full white. I attatched the new version of the shader.
In the Vertex Texcoord node I selected the UV channel 1 and in the Texture Sample node (unity_Lightmap) I selected the UV set 1.
You will have to remove the underscore character from the Texture Sample node property name.

Use unity_Lightmap instead of _unity_Lightmap.
Looking forward to your feedback.
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!