ShaderPass constructor
Renderer object or GPUCurtains class object used to create this ShaderPass
parameters use to create this ShaderPass
The type of the FullscreenPlane.
Object defining the FullscreenPlane size.
document HTML size.
ReadonlyuuidThe universal unique id of the MeshBaseClass.
ReadonlyindexIndex of this MeshBaseClass, i.e. creation order.
The Renderer used.
RenderMaterial used by this MeshBaseClass.
Geometry used by this MeshBaseClass.
RenderTarget to render this Mesh to instead of the canvas context, if any.
OptionaladditionalAdditional output RenderTarget onto which render this Mesh, besides the main outputTarget or screen. Useful for some effects that might need to render the same Mesh twice or more. Beware tho that the Mesh pipeline has to exactly fit the provided RenderTarget render passes descriptors as no checks will be performed here.
RenderBundle used to render this Mesh, if any.
Controls the order in which this MeshBaseClass should be rendered by our Scene.
Whether this MeshBaseClass should be treated as transparent. Impacts the render pipeline blend properties.
Flag indicating whether this MeshBaseClass is ready to be drawn.
Empty object to store any additional data or custom properties into your Mesh.
Function assigned to the onReady callback.
function assigned to the onBeforeRender callback.
function assigned to the onRender callback.
Function assigned to the onAfterRender callback.
function assigned to the onAfterResize callback.
Callback to run when MeshBaseClass is ready.
Callback to execute before updating the Scene matrix stack. This means it is called early and allows to update transformations values before actually setting the Mesh matrices (if any). This also means it won't be called if the Mesh has not been added to the Scene. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
Callback to run just before updating the Scene matrix stack.
Callback to execute right before actually rendering the Mesh. Useful to update uniforms for example. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
Callback to run just before rendering the MeshBaseClass.
Callback to execute just after a Mesh has been rendered. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
Callback to run just after MeshBaseClass has been rendered.
Callback to execute just after a Mesh has been resized.
Callback to run just after MeshBaseClass has been resized.
Optional input RenderTarget to assign to the ShaderPass. Used to automatically copy the content of the given RenderTarget texture into the ShaderPass renderTexture.
The Texture that contains the input content to be used by the ShaderPass. Can also contain the ouputted content if copyOutputToRenderTexture is set to true.
Options used to create this ShaderPass
Get private #autoRender value.
Get/set whether a Mesh is ready or not.
Get the transparent property value.
Set the transparent property value. Update the RenderMaterial rendering options and Scene stack if needed.
New transparency value.
Get our RenderMaterial textures array.
Get the current RenderMaterial uniforms.
Get the current RenderMaterial storages.
Get the visible property value.
Set the visible property value.
New visibility value.
Resize our FullscreenPlane.
the new bounding rectangle.
Set a new Renderer for this Mesh.
New Renderer to set.
Called when the device has been restored.
Set default shaders if one or both of them are missing.
Compute the Mesh geometry if needed.
Set our Mesh geometry: create buffers and add attributes to material.
Set or update the RenderMaterial rendering options to match the RenderPass descriptor used to draw this Mesh.
RenderPass used to draw this Mesh, default to the renderer renderPass.
Set or update the Mesh RenderMaterial.
New RenderMaterial to use.
Set a Mesh transparent property, then set its material.
Set Mesh material attributes.
Create a new MediaTexture.
Assign or remove a RenderTarget to this Mesh. Since this manipulates the Scene stacks, it can be used to remove a RenderTarget as well.
The RenderTarget to assign or null if we want to remove the current RenderTarget.
Assign or remove a RenderBundle to this Mesh.
OptionalrenderBundle: RenderBundle
The RenderBundle to assign or null if we want to remove the current RenderBundle.
OptionalupdateScene: boolean
Whether to remove and then re-add the Mesh from the Scene or not.
Resize the textures.
Execute onBeforeRender callback if needed. Called by the Scene before updating the matrix stack.
Called before rendering the Mesh. Set the geometry if needed (create buffers and add attributes to the RenderMaterial). Then executes RenderMaterial#onBeforeRender: create its bind groups and pipeline if needed and eventually update its bindings.
Render our MeshBaseClass if the RenderMaterial is ready.
Current render pass encoder.
Current render pass encoder.
Called after having rendered the Mesh.
Render our Mesh:
Current render pass encoder.
Remove the Mesh from the Scene and destroy it.
Destroy the Mesh.
Hook used to clean up parameters before sending them to the material.
parameters to clean before sending them to the RenderMaterial
Assign or remove an input RenderTarget to this ShaderPass, which can be different from what has just been drawn to the context current texture.
Since this manipulates the Scene stacks, it can be used to remove a RenderTarget as well. Also copy or remove the render target render texture into the ShaderPass renderTexture
the RenderTarget to assign or null if we want to remove the current RenderTarget
Add the ShaderPass to the Scene and optionally to the renderer as well.
whether to add this ShaderPass to the Renderer shaderPasses array
Remove the ShaderPass from the Scene and optionally from the renderer as well.
whether to remove this ShaderPass from the Renderer shaderPasses array
Used to apply postprocessing, i.e. draw meshes to a Texture and then draw a FullscreenPlane using that texture as an input.
A ShaderPass could either post process the whole scene or just a bunch of meshes using a specific RenderTarget.
Example