Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actuallwm

Posted 30 September 2013 - 10:29 AM

But what if your pixel shader looks like this:

float4 PS(PixelInputType input) : SV_TARGET
{
	if(input.color.r == 0)
	{
		discard;
	}
	return input.color;
}

Unless you know this is never going to happen, you should probably at least count the number of curly brackets. Add one when it's an opening bracket, subtract one when it's a closing bracket. You've reached the end of the function when the counter reaches zero again.


#1lwm

Posted 30 September 2013 - 10:27 AM

But what if your pixel shader looks like this:

float4 PS(PixelInputType input) : SV_TARGET
{
	if(input.color.r == 0)
	{
		discard;
	}
	return input.color;
}

Unless you know this is never going to happen, you should probably at least count the number of curly braces. Add one when it's an opening brace, subtract one when it's a closing brace. You've reached the end of the function when the counter reaches zero again.


PARTNERS