Jump to content
  • Advertisement
Sign in to follow this  

gl_ClipDistance is not working

This topic is 546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



before I call glDrawArraysInstanced();

and my vertex shader looks that:

#version 330
layout (location = 0) in vec2 position;
layout (location = 1) in vec2 texcoord;
layout (location = 2) in vec2 offset;

out Vertex
	vec2 position;
    vec2 texcoord;
	vec2 offset;
} vertout;

void main () {
	gl_ClipDistance[0] = -0.1;
	vertout.position = position;
	vertout.texcoord = texcoord;
	vertout.offset = offset;
	//gl_ClipDistance[1] = -1.0;

gl_ClipDistance is not working - everything is being rendered, why? What I did wrong?

My GPU: Nvidia gtx 1060, drivers are up to date. 



glIsEnabled(GL_CLIP_DISTANCE0)) returns GL_TRUE;



Ok, I know what was wrong.

I use Tessellation, so I just filled gl_ClipDistance[0] = -1.0 there and now it's working correct.

Edited by montka

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!