Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.3:viewport [2021/02/11 16:25] – [Native OpenGL Rendering] admin | 0.8.3:viewport [2022/04/06 19:29] (current) – [UseFixedFrameRate] admin | ||
---|---|---|---|
Line 65: | Line 65: | ||
==== Requesting FrameRate (FPS) ==== | ==== Requesting FrameRate (FPS) ==== | ||
- | Currently it is not possible | + | If UseFixedFrameRate |
+ | If UseFixedFrameRate is set to false, the TGorillaViewport provides an estimated framerate value. | ||
Simply setup a timer and request those value every 100 milliseconds. | Simply setup a timer and request those value every 100 milliseconds. | ||
Line 82: | Line 83: | ||
Animation-Framerate (TAnimation): | Animation-Framerate (TAnimation): | ||
==== UseFixedFrameRate ==== | ==== UseFixedFrameRate ==== | ||
+ | |||
+ | The viewport is able to render a scene on event feedback (when visual components change) or by a fixed framerate interval. | ||
+ | If UseFixedFrameRate is set to true, the rendering pipeline tries to render the scene with the configured FixedFrameRate value. | ||
+ | By default this value is set to 60. | ||
+ | |||
+ | Notice: At design-time fixed framerate rendering is disabled due to limitations in IDE. | ||
===== FrustumCulling ===== | ===== FrustumCulling ===== | ||
Line 309: | Line 316: | ||
Even in OnRender event you are in Gorilla3D rendering context. This means the framework has bound a framebuffer and the necessary render target textures. | Even in OnRender event you are in Gorilla3D rendering context. This means the framework has bound a framebuffer and the necessary render target textures. | ||
- | This is very important to know. | + | **__Remark: |
- | It is recommended to only use opaque rendering, by setting elements to " | + | |
+ | If the opaque property is false, you will render to translucent albedo channel. | ||
__// | __// | ||
Line 321: | Line 329: | ||
[...] | [...] | ||
+ | // get the final REAL color value | ||
vec4 l_WBOITColor = gl_FragColor; | vec4 l_WBOITColor = gl_FragColor; | ||
+ | // compute color-vertex-weight | ||
float l_Weight = max(min(1.0, | float l_Weight = max(min(1.0, | ||
clamp(0.001 / (1e-5 + pow(v_WorldViewProjVertPos.z / 1000.0, 2.0)), 1e-5, 1e4); | clamp(0.001 / (1e-5 + pow(v_WorldViewProjVertPos.z / 1000.0, 2.0)), 1e-5, 1e4); | ||
+ | // compute a final weighted color value written to translucent albedo render target | ||
gl_FragColor = vec4(l_WBOITColor.rgb * l_Weight, l_Weight); | gl_FragColor = vec4(l_WBOITColor.rgb * l_Weight, l_Weight); | ||
</ | </ | ||
+ | |||
+ | **__Remark: | ||
To understand rendering pipeline better, have a closer look [[renderpass|here]]. | To understand rendering pipeline better, have a closer look [[renderpass|here]]. |