Skip to content

UV projection of pointerValues for FX is wrong #84

Closed
@nhtoby311

Description

@nhtoby311

Following this setup to assign custom pointer values to FX hooks (Ex: useFluid) results in a wrong UV projection, as while pointer value goes from 0 -> 1, the effects display from 0.5 -> 1 on the UV instead.

useFrame((props) => {
    const pointerValues = updatePointer(refPointer.current);
    
    //This however returns the correct values of pointerValues
    console.log('pointerValues', pointerValues);
    
     //Therefore, I suspects the issue lie inside the updateFluid
    const fluid = updateFluid(props, { pointerValues: pointerValues });
    const fx = updateBlending(props, {
	    map: fluid,
	    alphaMap: false,
    });
    materialRef.current!.material.uniforms.u_fx.value = fx;
});
2024-03-04.20-52-56.mp4

If I use my custom code for useFluid that I created in this PR #65, it works well like below:

2024-03-04.20-58-43.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions