vhirtham / GDL

Game Development Library
2 stars 0 forks source link

Graphics API / Rendering #7

Open vhirtham opened 6 years ago

vhirtham commented 6 years ago

General

Possible classes

Shader / GLSL

Culling

OpenGL

General

Shader programs

Vulkan

vhirtham commented 6 years ago

Implemented

Integrating on fragment level

-> in commit d6df6521c6732bfa5e79319b62796b46d594536d - applications/examples/opengl/TriangleOpenGL.cpp

Example sinus function: Take a triangle and plot a color depending on the sinus function of the y-Coord of the fragment where the wavelength equals the trianlge size. when reducing the wave length, at some point you should see a lot of flickering/banding because the resolution of the wave gets to small. In other words: Aliasing problem. To avoid this we calculate the integral of the wave which should lead to a constant color value when the wave length gets to short. Therefore the area of each fragment is needed. This can be calculated by using the gradient funtions as described here: http://www.aclockworkberry.com/shader-derivative-functions/ The integration boundaries are then y_coord - 0.5 grad_y and y_coord + 0.5 grad_y. This could be generalized to calculate arbitrary integrals on the fragment level.