vvopensource
vvopensource copied to clipboard
Premultiplied alpha in multipass sampling
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);
}
}