Render Passes

Post your awesome Wire patches here, share tutorials
Post Reply
cat
Posts: 151
Joined: Fri Oct 08, 2004 11:03

Render Passes

Post by cat »

I still haven't got my head around render passes in glsl it seems.
I am trying to downsample an image in steps of 1/2 each time, this shader gives no errors, but doesnt output anything.
also does $WIDTH mean the previous render pass size or the original input size? should it be $WIDTH/2 , $WIDTH/4 etc?
Is there any way of getting point sampling rather than linear?

Code: Select all

/*{
    "CREDIT": "",
    "DESCRIPTION": "",
    "CATEGORIES": [ "generator" ],
    "INPUTS": [
        {
            "TYPE": "image",
            "NAME": "tex0",
        }
	
    ],
	
	"PASSES": [
		{
	    "TARGET" : "pass0",
		},
		{
		"TARGET" : "pass1",
      "WIDTH": "$WIDTH/2",
	  "HEIGHT": "$HEIGHT/2"
		}
	,
		{
		"TARGET" : "pass2",
      "WIDTH": "$WIDTH/2",
	  "HEIGHT": "$HEIGHT/2"
		}
	]
}*/



void main() {
	//vec2 uv =  isf_FragNormCoord.xy ;
	if (PASSINDEX == 0) 
	    {
	    vec4 col = IMG_NORM_PIXEL(tex0, isf_FragNormCoord );		
        gl_FragColor = col; 
		}
	if (PASSINDEX == 1){
		gl_FragColor =  IMG_NORM_PIXEL(pass0, isf_FragNormCoord );
		
	    }
	else{ 
		gl_FragColor =  IMG_NORM_PIXEL(pass1, isf_FragNormCoord ); 
	    }
	
}

Post Reply