Render/Compute pass abstraction for creating custom render graphs
Base class for all passes, used to describe a render graph.
GPass()
Default constructor for GPass.
GPass next()
Get the GPass this is connected to.
[ top ]
Base class containing shared methods for ScenePass and ScreenPass. Don't instantiate this directly.
RenderPass()
Default constructor for RenderPass.
void clear(int clear)
Set whether the framebuffer's color target should be cleared each frame. Default true.
int clear()
Get whether the framebuffer's color target is cleared each frame.
void colorOutput(Texture color_texture)
Set the target texture to render to. Setting to null will render to the window.
Texture colorOutput()
Get the target texture to render to.
void scissor(float x, float y, float w, float h)
Sets the scissor rectangle (in pixels) used during the rasterization stage. After transformation into viewport coordinates any fragments which fall outside the scissor rectangle will be discarded.
void scissor(vec4 s)
Sets the scissor rectangle (in pixels) used during the rasterization stage. After transformation into viewport coordinates any fragments which fall outside the scissor rectangle will be discarded.
void scissorNormalized(float x, float y, float w, float h)
Sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments which fall outside the scissor rectangle will be discarded.All values are multiplied by the dimensions of the output render texture, e.g. .scissorNormalized(.5, .5, .5, .5) will cut out only the bottom-right quad of the texture.
void scissorNormalized(vec4 s)
Sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments which fall outside the scissor rectangle will be discarded.All values are multiplied by the dimensions of the output render texture, e.g. .scissorNormalized(.5, .5, .5, .5) will cut out only the bottom-right quad of the texture.
void viewport(float x, float y, float w, float h)
Set the viewport this pass will render to, in pixels. x,y are the starting point. w,h are the width and height of the viewport. e.g. .viewport(500, 200, 100, 100) will render a 100x100 pixel region starting at the pixel coordinates (500, 200)
void viewport(vec4 vp)
Set the viewport this pass will render to, in pixels. x,y are the starting point. w,h are the width and height of the viewport. e.g. .viewport(500, 200, 100, 100) will render a 100x100 pixel region starting at the pixel coordinates (500, 200)
void viewportNormalized(float x, float y, float w, float h)
Set the viewport this pass will render to, in normalized in coordinates. x,y are the starting point. w,h are the width and height of the viewport. All values are multiplied by the dimensions of the output render texture, e.g. .viewportNormalized(.5, .5, .5, .5) will render to the bottom-right quad of the texture.
void viewportNormalized(vec4 v)
Set the viewport this pass will render to, in normalized in coordinates. x,y are the starting point. w,h are the width and height of the viewport. All values are multiplied by the dimensions of the output render texture, e.g. .viewportNormalized(.5, .5, .5, .5) will render to the bottom-right quad of the texture.
[ top ]
Pass to render a GScene from the perspective of a GCamera.
ScenePass()
Default constructor for ScenePass.
ScenePass(GScene scene)
Constructor that sets the scene to render. Will render from the scene's main camera, scene.camera()
GCamera camera()
Get the camera used for rendering the scene. If not set, will default to the scene's main camera.
int msaa()
Returns whether or not this scenepass has MSAA antialiasing enabled.
void msaa(int msaa)
Set whether this scenepass should perform MSAA antialiasing. If true will render the scene into a 4xMSAA texture and perform an MSAA resolve into the texture set with ScenePass.colorOutput(). Default false.
void scene(GScene scene, GCamera camera)
Set the scene and camera to render from. camera *must* be a part of the scene. Can pass `null` as the camera arg to use the scene's main camera, scene.camera()
GScene scene()
Get the scene this pass is rendering.
[ top ]
Screen pass for applying screen shaders and visual effects to the entire screen.
ScreenPass()
Default constructor for ScreenPass.
ScreenPass(Shader screen_shader)
No description available
Material material()
Get the internal material of this pass. Use the material to bind uniforms to the screen shader.
void shader(Shader shader)
Set the screen shader to apply to the screen. In your screen shader be sure to #include SCREEN_PASS_VERTEX_SHADER which supplies your fragment shader with a full-screen quad.
[ top ]
No description available
OutputPass()
Default constructor for OutputPass.
void exposure(float exposure)
Set the exposure value for the tonemapping algorithm.
float exposure()
Get the exposure value for the tonemapping algorithm.
void gamma(int gamma)
Get whether or not the pass is applying gamma correction. Default true.
int gamma()
Set whether or not to apply gamma correction. Default true.
void input(Texture input_texture)
Set the input texture to apply tonemapping and gamma correction to.
TextureSampler sampler()
Get the sampler used for the input texture.
void sampler(TextureSampler sampler)
Set the sampler used for the input texture.
void tonemap(int tonemap_type)
Set the tonemapping algorithm to apply to the input texture. Choose a value from the OutputPass.ToneMap_* enum.
int tonemap()
Get the tonemapping algorithm applied to the input texture.
int ToneMap_ACES
No description available
int ToneMap_Cineon
No description available
int ToneMap_Linear
No description available
int ToneMap_None
No description available
int ToneMap_Reinhard
No description available
int ToneMap_Uncharted
No description available
[ top ]
Compute pass for running compute shaders. Note that unlike Materials, all Compute Pass bindings must be bound under @group(0), NOT @group(1)
ComputePass()
Default constructor for ComputePass.
ComputePass(Shader shader)
Create a compute pass with the given shader.
void shader(Shader shader)
Set the compute shader to run.
void storageBuffer(int location, StorageBuffer buffer)
No description available
void storageTexture(int location, Texture texture)
No description available
void texture(int location, Texture texture)
No description available
void uniformFloat2(int location, vec2 uniform_value)
No description available
void uniformFloat3(int location, vec3 uniform_value)
No description available
void uniformFloat4(int location, vec4 uniform_value)
No description available
void uniformFloat(int location, float uniform_value)
No description available
void uniformInt(int location, int uniform_value)
No description available
void workgroup(int x, int y, int z)
Set the workgroup size for the compute shader. Used to determine the dimensions of the compute pass dispatch.
[ top ]
No description available
BloomPass()
Default constructor for BloomPass.
Texture colorOutput()
Get the render texture that the bloom pass writes to.
void input(Texture bloom_texture)
Set the render texture to apply bloom to.
void intensity(float blend_factor)
Set the blend factor between the bloom texture and the original image.
float intensity()
Get the blend factor between the bloom texture and the original image.
void levels(int num_levels)
Number of blur passes to apply to the bloom texture. Clamped between 0 and 16.
int levels()
Get the number of blur passes applied to the bloom texture.
void radius(float blend_factor)
Set the blend factor between mip levels of the bloom texture during upsample.
float radius()
Get the blend factor between mip levels of the bloom texture.
void threshold(float threshold)
Set the threshold for the bloom pass (colors with all rgb values below threshold are not bloomed)
float threshold()
Get the threshold for the bloom pass.
[ top ]