- Home /
Issue with a 2 sided texture (I know, I know) :P
So I know this is a common question around these parts and you wonderful ladies and gents must get tired of answering with links of the answers.
But!
I've read the answers and since I'm a newbie @ some of this shader stuff I'm going to post my issue/trouble I'm having anyways with hopes someone can help?
I have a tree model static mesh that I want to eventually paint on a terrain layer. Anyways, the tree has many branches that are just Planes w/ Alpha maps on them. I am aiming for a 2 sided lit texture shader in unity. When I choose the "transparent/difuse" shader it works with my alphas and looks sweet! Problem is, it doesn't do the 2sided part so well..at all. Now, when I pick the "transparent/cutout/soft edge unlit" shader it all works great! ...except it's obviously unlit. :( I did some searching on here and felt like I was getting way over my head with people posting custom shaders that seemed to work with being lit, being 2sided, and holding alphas, but when I tried to implement these I couldn't quite figure out the process of coding all that in somewhere. Is there anyone who could help me out somehow without hating me for this question? haha
Basically, I need a shader that supports Alpha planes, 2sided texture, and has lighting on the model. How would I get that result? I don't think any of the standard shaders supports all 3.
Answer by GreenHat · Mar 10, 2011 at 11:56 PM
Solved!
I ended up using the default shader "nature/ambient occlusion leaves" because it supports all the needs I was looking for...
It doesnt works with URP;( I am using the shader graph, and I enabled render both faces on plane type mesh, one side looks great but the other seems somewhat whitish, just wondering if you can help?
Almost any shader that does render the front and backside in one pass are unlit shaders. Lit shaders would not work with a single pass since you only have one normal for calculating the lighting of the face. A two pass shader would work because one pass could render the front and one the backside. Though the pass for the backside would need to invert the normal to perform the correct lighting calculations. Two sided shaders are usually only used for unlit shaders. If you need to render both sided in any other cases, it's best to use two quads instead. This also allows a different UV mapping for both sides (since they are essentially two seperate faces).
ps:
You do realise that this question is over 10 years old? Why posting a comment on this ancient question which was posted at a completely different time. So your issue can't possibly be related to the state of the engine 10 years ago. If you have a question, please, ask your own seperate question.
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Two-sided Objects from Blender to Unity3d 2 Answers
How to "paint" the terrain in a script? 1 Answer
Texture vs GUI 2 Answers
Randomize texture within prefab 0 Answers