Skip to content

davabase/mastering_render_targets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mastering Render Targets

This repository contains the code for the companion blog post Mastering Render Targets in Defold.

Each part describes a piece of the puzzle for lining up the projection frustum to properly scale partial screen shaders.

These projects are for the Defold game engine, you can find more resources for Defold at the bottom.

Part 1

Find it here.

  • Setting up the render pipeline.
  • Creating a game object to draw to.
  • Creating a new render target.
  • Create a passthrough material.
  • Drawing predicates to the the render target.
  • Drawing the game object predicate.

Part 2

Find it here.

  • Update the passthrough material to render the objects in grayscale.

Part 3

Find it here.

  • Update the screen projection to only render the part of the screen within our render window.
  • Add controls so we can drag the window around.

Part 4

Find it here.

  • Generalize the projection math so the render window can be any aspect ratio.
  • This also allows us to change the size of the render target.
  • Add controls to change the scaling of the render window.

Learn more about the Defold game engine here:

https://defold.com

https://github.com/defold/defold

https://forum.defold.com

Useful references for rendering in Defold:

https://defold.com/manuals/render

https://defold.com/manuals/material

https://defold.com/manuals/shader

https://defold.com/tutorials/shadertoy