Skip to main content
gamedev.net
🔒 Locked

GLSL pointers!

Started by golgoth 1 reply 6k views
Original Post
golgoth
golgoth
Hi all! its me again! is there anyways to verify if a texture id exist? Abstract:

uniform sampler2D texture;

void main()
{
	vec4 a = vec4(0,0,0,0);
	vec4 b = vec4(1,1,1,1);

	if (texture == NULL)
	{
		gl_FragColor = a;
	}
	else
	{
		gl_FragColor = b;
	}
}

failed to compile so far! THX
_the_phantom_
_the_phantom_
samplers are not pointers.
GLSL doesnt have pointers.
Uniforms default to zero if they arent changed by the host application.

tbh, You are asking questions which could be answered if you took the time to learn GLSL properly. Tutorial links in the FAQ can help with this, however the 'Orange Book' (a buy link exists in the FAQ as well) is the best source of infomation you are going to find on it.
golgoth
golgoth
alright!

im on it!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.