Boolsheet wrote:It's actually GLSL 1.2 that doesn't specify such implicit casts. Only int to float is allowed, I think. Your driver is more lenient and lets it go by.
Can't you use the .rgb (or .xyz, they're identical) swizzler for the second texture2D call too?
Ah, so vec3(0,0,0) + 1 doesn't equal vec3(1,1,1), I have to say vec3(0,0,0) + vec3(1,1,1) to be correct?
If so many people can't play like anything with shaders I've made.
I could add the .xyz, but I wasn't sure if that'd fix it since I have no way of testing for it.
By the way, does the video driver compile shaders?
edit: While this topic is up, why does this spit out
Code: Select all
Line 16: error: Undeclared Identifier: col
I'm just trying this shader as a test to see if I can get conditionals working at ALL.
Code: Select all
[[
uniform sampler2D tex0;
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords)
{
vec2 uv = vec2(
texture_coords.x,
1 - texture_coords.y
);
if (1 == 1) {
vec4 col = vec4(0,0,0,1);
} else {
vec4 col = vec4(1,0,0,1);
}
return vec4(col);
}
]]