Skip to content

Premultiplied alpha in multipass sampling #33

@bananoid

Description

@bananoid

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);	
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions