vvopensource icon indicating copy to clipboard operation
vvopensource copied to clipboard

Premultiplied alpha in multipass sampling

Open bananoid opened this issue 5 years ago • 0 comments

When I sample a vec4 from an other pass buffer I get a vector where XYZ are multiplied by W. This make it impossible to use the W.

/*{
    "CATEGORIES": [
        "XXX"
    ],
    "CREDIT": "by gosub7777777",
    "DESCRIPTION": "",
    "INPUTS": [
        {
            "NAME": "inputImage",
            "TYPE": "image"
        }
    ],
    "ISFVSN": "2",
    "PASSES": [
        {
            "FLOAT": true,
            "HEIGHT": "$HEIGHT",
            "PERSISTENT": true,
            "TARGET": "first",
            "WIDTH": "$WIDTH"
        },
        {
        }
    ]
}
*/

void main() {
	if(PASSINDEX == 0){
		gl_FragColor = vec4(0.1, 0.0, 0.0, 10.);
	}
	if(PASSINDEX == 1){
		// gl_FragColor = vec4(0.1, 0.0, 0.0, 10.);
		gl_FragColor = IMG_PIXEL(first, isf_FragNormCoord.xy);	
    }
}

bananoid avatar Feb 07 '20 01:02 bananoid