I just spend a week trying to finish my project and now that I uploaded it to the webplayer the shader used to show you selected and object doesn’t work.
All that happens now when you select an object is turns a dark gray.
![]()
Shaders work fine
Check the quality level and ensure that you don’t rely on plugins (unmanaged) cause they won’t work. nor will WWW(file:// work
I don’t know anything about shaders, I found this one on the forums its the only thing that doesn’t work…
Shader "Outlined Diffuse"
{
Properties
{
_Color ("Main Color", Color) = (.5,.5,.5,1)
_OutlineColor ("Outline Color", Color) = (0,1,0,1)
_Outline ("Outline width", Range (0.002, 0.03)) = 0.01
_MainTex ("Base (RGB)", 2D) = "white" { }
//Not needed
//_ToonShade ("ToonShader Cubemap(RGB)", CUBE) = "" { Texgen CubeNormal }
}
SubShader
{
Tags { "RenderType"="Opaque" }
//Minor switch
//UsePass "Toon/Basic/BASE"
UsePass "Diffuse/BASE"
Pass
{
Name "OUTLINE"
Tags { "LightMode" = "Always" }
Program "" {
// Vertex combos: 1
// opengl - ALU: 13 to 13
// d3d9 - ALU: 13 to 13
SubProgram "opengl " {
Keywords { }
Bind "vertex", ATTR0
Bind "normal", ATTR1
Local 1, ([_Outline],0,0,0)
Local 2, [_OutlineColor]
"!!ARBvp1.0
# 13 ALU
PARAM c[15] = { program.local[0..2],
state.matrix.modelview[0],
state.matrix.projection,
state.matrix.mvp };
TEMP R0;
TEMP R1;
DP4 R1.x, vertex.attrib[0], c[13];
DP3 R0.x, vertex.attrib[1], c[4];
MUL R0.y, R0.x, c[8];
DP3 R0.x, vertex.attrib[1], c[3];
MUL R0.x, R0, c[7];
MUL R0.zw, R0.xyxy, R1.x;
DP4 R0.x, vertex.attrib[0], c[11];
DP4 R0.y, vertex.attrib[0], c[12];
MAD result.position.xy, R0.zwzw, c[1].x, R0;
MOV result.color, c[2];
DP4 result.position.w, vertex.attrib[0], c[14];
MOV result.position.z, R1.x;
MOV result.fogcoord.x, R1;
END
# 13 instructions, 2 R-regs
"
}
SubProgram "d3d9 " {
Keywords { }
Bind "vertex", Vertex
Bind "normal", Normal
Local 12, ([_Outline],0,0,0)
Local 13, [_OutlineColor]
Matrix 0, [glstate_matrix_modelview0]
Matrix 4, [glstate_matrix_projection]
Matrix 8, [glstate_matrix_mvp]
"vs_1_1
; 13 ALU
dcl_position v0
dcl_normal v1
dp4 r1.x, v0, c10
dp3 r0.x, v1, c1
mul r0.y, r0.x, c5
dp3 r0.x, v1, c0
mul r0.x, r0, c4
mul r0.zw, r0.xyxy, r1.x
dp4 r0.x, v0, c8
dp4 r0.y, v0, c9
mad oPos.xy, r0.zwzw, c12.x, r0
mov oD0, c13
dp4 oPos.w, v0, c11
mov oPos.z, r1.x
mov oFog, r1.x
"
}
}
#LINE 52
Cull Front
ZWrite On
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
//? -Note: I don't remember why I put a "?" here
SetTexture [_MainTex] { combine primary }
}
}
Fallback "Diffuse"
}
I used this code to insert it: renderer.material.shader = Shader.Find ("Outlined Diffuse");
I did a few tests too, the box turning gray like that is only caused when the shader its looking for doesn’t exist…
EDIT: I also found out, its not my shader it happens with all shaders…
![]()
Whoops, I just found out for Shader.Find to work in the webplayer the shader needs to be in the Resources folder.
![]()
all assets that are not assigned to GOs / Prefabs must be in resources folder or they cease to exist on build
Unity will not include unused asset and “used through scripting only” is equal to unused
thats why resources is there actually ![]()
Previously i was in the same situation than you. But, it was so simply to resolve. Thanks!!
:)![]()
![]()

