Lesson 24 - Scissor Testing and GPU Queries

 

Note: This is a placeholder. Just some notes on what I may eventually do...

This lesson demonstrates three aspects of WebGL

  • Querying the WebGL context to get information about the renderer and extensions
  • Writing to a scrollable text sprite in a console-like way.

In order to implement all this, it was necessary to

The general process for this is:

  • Create two scenes
    • One for the scrollable sprite
    • One for the general scene
  • Create a Canvas that is the desired console width and very tall, e.g. 10x the width
  • Write a bunch of stuff in the canvas
  • Create a texture from the canvas
  • Create a Sprite the size of the canvas
  • Position the Sprite where you want the console to appear
  • Add the sprite to the sprite-scene
  • Do whatever you want in the general scene
  • Turn off autoClear in the renderer
  • In the rendering function
    • clear the scene
    • render the general scene
    • create a scissorTest rectangle to enclose the console's visible location
    • turn on scissorTest
    • render the console-scene
    • turn off scissor test

I'll get back to this one someday. Perhaps soon, perhaps not.



About Us | Contact Us | ©2017 Geo-F/X