- Home /
Question by
atozpp · May 09, 2018 at 02:16 PM ·
shadershader programmingshader writingglsl
How effective are glsl shaders in Unity?
Hi there, I have never written glsl shaders in Unity (2017), but I can't seem to make this shader work. I have my OpenGL core active as I am using windows. The test I have done is below and the expected result is red but I get a black color on my materials. Please advise also on the point that the manual indicates that we should use glsl only if we hope to test our projects. Could this be the cause of my shader not working? thank you very much for your answers!
Shader "TEST" { Properties {
}
SubShader
{
Pass{
Tags {"LightMode" = "ForwardBase"}
GLSLPROGRAM
#include "UnityCG.glslinc"
#ifdef VERTEX
void main()
{
gl_Position = gl_Vertex * glModelViewProjectionMatrix;
}
#endif
// Fragent shader
#ifdef FRAGMENT
void main()
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
#endif
ENDGLSL
}
}
Fallback "Diffuse"
}
Comment
Your answer
Follow this Question
Related Questions
CRT shader but NOT for camera 0 Answers
Shader: Mask Without a Texture? 2 Answers
Possible for a shader to have two decal slots? 2 Answers
How to adapt this shader into a transparent one (alpha blend) 0 Answers