Skip to content

Latest commit

 

History

History
753 lines (457 loc) · 33.6 KB

README.md

File metadata and controls

753 lines (457 loc) · 33.6 KB

DemoFramework 6.5.0 GLES3

To main document

Table of contents

Demo applications

GLES3

Example of various forms of anti aliasing. Demonstrates enabling fast MSAA resolve using GL_EXT_multisampled_render_to_texture.

A simple example of multi texturing.

A example of how to create a bloom effect. The idea is not to create the most accurate bloom, but something that is fairly fast to render.

Instead of increasing the kernal size to get a good blur we do a fairly fast approximation by downscaling the original image to multiple smaller render-targets and then blurring these using a relative small kernel and then finally rescaling the result to the original size.

Showcases how to use the helios camera API. It captures a image from the camera and renders it using OpenGL ES 3.

Checks for the presence of known EGL color space extensions and outputs information about them to the console.

This sample introduces you to the use of Vertex Buffer Objects. Look for the OSTEP tags in the code, they will list in an ordered way the steps needed to set a VBO, The CHALLENGE tags will list additional steps you can follow to create an additional VBO.

This sample is basically a exact copy of E1_1_VBOs but it uses the DemoFramework utility classes to make the code simpler.

This sample introduces you to the use of Vertex Array Objects. They will allow you to record your Vertex States only once and then restore them by calling the glBindVertexArray function. As with the E* samples, look for the OSTEP tags to see how they are created and used.

This sample is basically a exact copy of E1_2_VAOs but it uses the DemoFramework utility classes to make the code simpler.

Showcases how to use the helios camera API. It captures a image from the camera and renders it using the nativebatch.

This sample shows how to use Gstreamer and OpenGL ES to display a YUV video on a texture by doing the YUV to RGB conversion on a shader and also use the DirectVIV extensions to avoid copying data from the Video Buffer to the GL Texture.

This sample introduces you to the use of Vertex Buffer Objects. Look for the OSTEP tags in the code, they will list in an ordered way the steps needed to set a VBO, The CHALLENGE tags will list additional steps you can follow to create an additional VBO.

To see a simpler version of this code that utilize utility classes from the DemoFramework take a look at D1_1_VBOs example.

This sample introduces you to the use of Vertex Array Objects. They will allow you to record your Vertex States only once and then restore them by calling the glBindVertexArray function. As with the E* samples, look for the OSTEP tags to see how they are created and used.

To see a simpler version of this code that utilize utility classes from the DemoFramework take a look at the D1_2_VAOs example.

This sample teaches you how to use the glCopyBufferSubData to copy data between 2 Vertex Buffer Objects. In this sample we copy a Buffer for Positions and a Buffer for Indices.

.

This sample introduces the concept of instancing, this concept is useful to render several meshes that share geometry. In this sample all cubes will share the same vertex positions, however the colors and MVP Matrices will be independent.

.

This sample shows you a new feature of OpenGL ES 3.0 called primitive restart. This allows you to segment the geometry without the need of adding a degenerate triangle to the triangle index list.

.

.

This sample introduces multiple render targets (MRT). This feature allows you to define multiple outputs from your fragment shader. Please check the fragment shader under the Content folder, you will notice how 4 outputs are being defined.

.

This sample creates a particle system using GL_POINTS. It defines an initial point where the particles will be tightly packed and then, during the explosion lifetime each point will be animated from a starting position to an end position.

.

Convert a equirectangular map to a cubemap using OpenGL ES3.

Can render both the julia and mandelbrot set. Was used to demonstrates GPU shader performance by using up to 515 instructions each fragment while generating the julia set.

No texture and no overdraw, minimal bandwidth requirements.

Illustrates how to render fur over several primitives.

The fur is rendered on a layered approach using a seamless texture as a base and then creating a density bitmap.

.

A simple example of how to do gamma correction it shows the difference that SRGB textures and gamma correction makes to the output by comparing it to the uncorrected rendering methods.

As normal framebuffer values are clamped between 0.0 and 1.0 it means that any light value above 1.0 gets clamped. Because of this its not really possible to differentiate really bright lights from normal lights. To take advantage of the light information that normally gets discarded we use a tone mapping algorithm to try and preserve it. This demo applies the tonemapping right away in the lighting shader so no temporary floating point framebuffer is needed.

As normal framebuffer values are clamped between 0.0 and 1.0 it means that any light value above 1.0 gets clamped. Because of this its not really possible to differentiate really bright lights from normal lights. To take advantage of the light information that normally gets discarded we use a tone mapping algorithm to try and preserve it. This demo applies the tonemapping as a postprocessing step on the fully lit scene, so a temporary floating point framebuffer is needed.

This sample outputs to a LDR screen.

Render a HDR skybox and apply various tonemapping algorithms to it.

This sample outputs to a LDR screen.

Demonstrates how to enable HDRFramebuffer mode if available. The render a test scene using a pattern that makes it easy to detect if the display actually enabled HDR mode.

This sample outputs to a HDR screen if supported.

A simple example of dynamic line rendering using the LineBuilder helper class. The line builder has 'Add' methods for most FslBase.Math classes like BoundingBox, BoundingSphere, BoundingFrustrum, Ray, etc.

Shows the use of instancing for rendering many copies of the same mesh.

Demonstrates how to use the FslSceneImporter and Assimp to load a scene and render it using OpenGLES2.

The model is rendered using a simple per pixel directional light shader.

For a more complex example take a look at the ModelViewer example.

Expands the ModelLoaderBasics example with:

  • A arcball camera
  • Multiple different scenes (Knight, Dragon, Car, etc)
  • More advanced shaders for directional per pixel specular light with support for gloss and normal maps.

Demonstrates how to utilize multiple viewports. It reuses the fractal shaders from the FractalShader demo to render the julia and mandelbrot sets.

No texture and no overdraw, minimal bandwidth requirements.

Shows how to select (pick) 3d objects using the mouse via Axis Aligned Bounding Boxes (AABB).

Beware that AABB's often represent quite a rough fit and therefore is best used as a quick way to determine if there might be a collision and then utilize a more precise calculation to verify it.

Simple application that allows you to get your system's OpenCL available platforms.

Demonstrates how to use OpenCL from inside a OpenGL ES 3 project.

This is a very basic example that mainly shows how to setup the correct dependency in the Fsl.gen file and then it does some very basic OpenCL operations. It could be used as a good starting point for a more complex example.

This sample uses OpenCL to execute a Gaussian Blur on an image.

The output will then be stored into a bmp image and also displayed as an OpenGL ES 3.0 texture mapped to a cube.

Demonstrates how to use OpenCV from inside a OpenGL ES 3 project.

This is a very basic example that mainly shows how to setup the correct dependency in the Fsl.gen file and then it does some very basic OpenCV operations. It could be used as a good starting point for a more complex example.

Demonstrates how to take a OpenCV mat and convert it to a Bitmap which is then converted to a Texture2D for use with the NativeBatch. The texture is then shown on screen and can be compared to the same texture that was loaded using the normal DemoFramework methods.

The cv::Mat -> Bitmap routines used here are a very basic proof of concept.

Demonstrates how to take a OpenCV mat and convert it to a Bitmap which is then converted to a Texture2D for use with the UI frmaework. The texture is then shown on screen and can be compared to the same texture that was loaded using the normal DemoFramework methods.

The cv::Mat -> Bitmap routines used here are a very basic proof of concept.

Demonstrate how process a image with OpenVX then use it to render as a texture on the GPU.

Creates a configurable particle system where you can select the type of primitive each particle will have and the amount of particles.

.

.

This sample covers how to use OpenGL ES 3.0 to render to a texture. It also shows how to use the DirectVIV extensions to:

  1. Map an existing buffer to be used as a texture and as a FBO. This scheme uses glTexDirectVIVMap, this function creates a texture which contents are backed by an already existing buffer. In this case we create a buffer using the g2d allocator.

  2. Create a texture and obtain a user accessible pointer to modify it, this texture can also be used as a FBO. This scheme uses glTexDirectVIV, this function creates a Texture in memory, but gives you access to its content buffer in GPU memory via a pointer, so you can write in it.

Shows how to render a single colored Triangle using OpenGL ES, this sample serves as a good introduction to the OpenGL ES 3 Pipeline and the abstraction classes that the DemoFramework provides.

It's basically the typical 'Hello World' program for graphics.

Shows how to render a vertex colored Triangle using OpenGL ES, this demonstrates how to add more than vertex positions to the vertex attributes.

This is basically the same as the S01 example it just adds vertex colors to the shader.

Renders a animated vertex colored triangle.

This shows how to modify the model matrix to rotate a triangle and how to utilize demoTime.DeltaTime to do frame rate independent animation.

This example shows how to:

  • Build a perspective projection matrix
  • Render two simple 3d models using frame rate independent animation.

Demonstrates how to use a pre-compiled shader using the offline compiler tool 'vCompiler' from Verisilicon.

This currently only works on the Yocto platform.

This example shows how to use the Texture class to use a texture in a cube.

It also shows you how to use the ContentManager service to load a 'png' file from the Content directory into a bitmap utility class which is then used to used to create a OpenGL ES texture.

This sample shows how to use a cubemap texture to simulate a reflective material.

It also shows you how to use the ContentManager service to load a 'dds' file from the Content directory into a Texture utility class which is then used to used to create a OpenGL ES cubemap texture.

This sample is a variation from the previous sample, again, a cubemap texture is used, but this time instead of simulating a reflective material a refractive material is simulated.

It also shows you how to use the ContentManager service to load a 'dds' file from the Content directory into a Texture utility class which is then used to used to create a OpenGL ES cubemap texture.

This sample shows how to use the Verisilicon extensions to create a texture without having the need to copy the image data to GL.

A simple example of how glScissor works.

This is showcased by rendering the insides of a rotating cube and using a animated scissor rectangle to clip.

Simple example of bitmap fonts vs SDF bitmap fonts. This example shows the worst case differences as we only use one resolution for the bitmap font meaning we often upscale the image which gives the worst ouput. A proper bitmap font solution should have multiple font textures at various DPI's and select the one closest to the actual font rendering size and preferbly also prefer to downscale the image instead of upscaling it.

It also showcases two simple SDF effects:

  • Outline
  • Shadow

Render a simple skybox using a cubemap.

A simple example of how a spatial hash grid works in 2d.

Background test to showcase SPline animations used for simulating a fluid background that can be stimulated by either the spheres or mouse/touch input.

It is then demonstrated how to render the grid using:

  • The DemoFramework native batch (Basic or Catmull-Rom splines)
  • Linestrips in a VertexBuffer (Catmull-Rom splines)
  • Linestrips in a VertexBuffer but using the geometry shader to make quads (Catmull-Rom splines)

Enables a SRGB Framebuffer if the extension EGL_KHR_gl_colorspace is available. If unavailable it does normal gamma correction in the shader.

Showcase the new stats services.

Executes a highly configurable stress test for the OpenGL ES API.

It will procedurally generate a mesh and fur texture that is then rendered to cover the entire screen.

This will often showcase the worst case power consumption of the GPU.

Simple tessellation sample that allows you to select the tessellation level to see how it modifies the level of detail on the selected geometry.

.

Shows how to load scenes via Assimp and then render them using

  • a directional per pixel specular light with support for normal maps.
  • tessellation using the geometry shader.

Load and render some ETC2 compressed textures. It also outputs information about the found compression extensions.

A very simple verlet integration example.

It's inspired by: Coding Math: Episode 36 - Verlet Integration Part I+IV

.

GLES3.System

Quick example that showcase how to mix rendering using the basic rendering API and the FslSimpleUI.

Development project for the IBasicRenderSystem.

Development project for custom shaders for the IBasicRenderSystem.

Development project for the Vulkan NativeTexture2D and DynamicNativeTexture2D implementation. Makes it easy to provoke certain NativeTexture2D/DynamicNativeTexture2D scenarios.

Shows how to use the Demo Frameworks 'basic' 2d rendering capabilities that work across all backends. The basic2D interface allows you to render ASCII strings using a system provided font and draw colored points.

The functionality in Basic2D is used internally in the framework to render the profiling overlays like the frame rate counter and graph.

Shows how to use the Demo Frameworks NativeBatch implementatin to render various graphics elements. The native batch functionality works across various 3D backends and also allows you to use the API native textures for rendering.

The native batch is very useful for quickly getting something on the screen which can be useful for prototyping and debugging. It is however not a optimized way of rendering things.

Application used to debug the gesture handling code.

Development project for on demand rendering and demonstrates how to implement it. It also has some basic 'janky timing' detection animations.

This application has been designed for a 1920x1080dp screen and will provide a sub-optimal experience for resolutions lower than that.

GLES3.UI

Simple example of UI data binding

UI benchmark that can be used to benchmark various ways of rendering a UI. This allows you to see what works best on the given hardware.

This application has been designed for a 1920x1080dp screen and will provide a sub-optimal experience for resolutions lower than that.

Simple example of UI chart rendering.

Experimental declarative UI that use the new data-binding capability to create UI from a XML file.

This sample showcases a UI that is DPI aware vs one rendered using the standard pixel based method.

It also showcases various ways to render scaled strings and the errors that are easy to introduce.

Application used to debug the UI gesture handling code.

This sample showcases some of the common scaling traps that can occur when trying to achieve pixel perfect rendering.

This sample test the various internal UI rendering primitives.

A very basic example of how to utilize the DemoFramework's UI library. The sample displays four buttons and reacts to clicks.

The UI framework that makes it easy to get a basic UI up and running. The main UI code is API independent. It is not a show case of how to render a UI fast but only intended to allow you to quickly get a UI ready that is good enough for a demo.

A more complex example of how to utilize the DemoFramework's UI library. It displays various UI controls and ways to utilize them.

The UI framework that makes it easy to get a basic UI up and running. The main UI code is API independent. It is not a show case of how to render a UI fast but only intended to allow you to quickly get a UI ready that is good enough for a demo.

This sample showcases the difference between sub pixel accuracy vs pixel accuracy when scrolling.

Showcase all controls that is part of the Basic UI theme.