The <PingPongPlane />
component will create a WebGL PingPongPlane (using a Plane object), acting as a wrapper for the curtains.js PingPongPlane class.
import ReactDOM from 'react-dom';
import React from 'react';
import {PingPongPlane} from 'react-curtains';
function BasicPingPongPlane() {
return (
<PingPongPlane />
);
}
You can refer to both the PingPongPlane curtains.js class and Plane component documentations.
Compared to the <Plane />
component the only additional prop you have to pass to your <PingPongPlane />
component is the sampler
name that you'll use in your shader (if not set, will use "uPingPongTexture").
Each time the <PingPongPlane />
component will unmount, the corresponding WebGL plane element will be automatically disposed.