- Home /
Shaders not working across projects?
Hi,
I'm sort of new to shaders, so forgive me if this is a stupid question, but I'm having some trouble getting a shader to work across projects.
I took one of the default shaders and just made it so that it rendered on both sides, and was not see-through (by turning the Cull off , and the ZWrite on. Here's what the code looks like:
*Shader "Mobile/DRC_2SidedDiffuse" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Spec Color", Color) = (1,1,1,0)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.1, 1)) = 0.7
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
Category {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
ZWrite On
Cull Off
Alphatest Greater 0
Blend SrcAlpha OneMinusSrcAlpha
SubShader {
Material {
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Pass {
ColorMaterial AmbientAndDiffuse
Fog { Mode Off }
Lighting Off
SeparateSpecular On
SetTexture [_MainTex] {
Combine texture * primary, texture * primary
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine previous * constant DOUBLE, previous * constant
}
}
}
}
}*
It works fine on my computer, so I handed it off to a programmer to put it in his project. When he brings it up in his project though it's as if the shader is invisible. I've opened up this shader on his computer, and the code looks the same.
Here's what it looks like on his computer:
And here's what it looks like on my computer:
Would anyone have any idea why this is happening?
Thanks in advance for any help or suggestions.
Answer by balajidream · May 09, 2012 at 08:27 AM
I am facing the same weird problem. The shader was working before. But, after i created a new project and tried to import that shader onto this new project. It doesnt work.. Help Please. And Daniel Have figured out any solution yet. THanks in advance.
Answer by balajidream · May 09, 2012 at 08:27 AM
I am facing the same weird problem. The shader was working before. But, after i created a new project and tried to import that shader onto this new project. It doesnt work.. Help Please. And Daniel Have figured out any solution yet. THanks in advance.
Answer by jogo13 · Nov 28, 2012 at 06:35 AM
I had the same problem. (on mac unity 3) I got around it by turning an object with the shader applied into a prefab, exporting it (with all dependancies) and then importing it into the target project.
Answer by Caspilar · Aug 07, 2013 at 04:49 PM
This might be happening because of the rendering path in your camera. Some shaders or features won't work on Vertex Lit rendering path. Perhaps the rendering paths are different on your projects. Use the same camera properties and it could be the answer you're looking for.
I had a custom shader that had a simple texture and another decal texture and was killing myself to understand why the shader "stopped working out of nothing". The problem was that I had changed the rendering path to Vertex Lit and the shader would only work on Forward.
Your answer
Follow this Question
Related Questions
Fading objects to transparent - Apply shader with a script? 2 Answers
Transparent + affected by light shader 1 Answer
Shader that makes object transparent as light hits it 0 Answers
Don't render an Area behind a plane 0 Answers
Hiding sections of arbitrary models that lie one side of a plane 0 Answers