yage.system.graphics.render
Authors:
Eric Poggel
License:
LGPL v3
- struct
RenderStatistics
;
- Statistics about the last render operation.
- int
nodeCount
;
- int
vertexCount
;
- int
triangleCount
;
- int
lightCount
;
- RenderStatistics
opAdd
(RenderStatistics rhs);
- RenderStatistics
opAddAssign
(RenderStatistics rhs);
- struct
Render
;
- As the nodes of the scene graph are traversed, those to be rendered in
the current frame are added to a queue. They are then reordered for correct
and optimal rendering. Translucent polygons are separated, sorted
and rendered in a second pass.
- static void
cleanup
(int age = 3600);
- Cleanup no-longer used graphics resources.
- static void
complete
();
- Complete rendering and swap the back buffer to the front buffer.
- static Shader
generateShader
(MaterialPass pass, LightNode[] lights, bool fog, ref ArrayBuilder!(ShaderUniform) uniforms);
- Generate a phong/normal map shader for the pass.
Params:
MaterialPass pass |
|
LightNode[] lights |
|
bool fog |
|
ArrayBuilder!(ShaderUniform) uniforms |
Uniform variables to pass to the shader when binding. |
Returns:
- static bool
bindPass
(MaterialPass pass, LightNode[] lights);
- Bind a MaterialPass, generating a shader based on the number of lights.
- static MaterialTechnique
getTechnique
(Material material, LightNode[] lights = null);
- Get the first technique that can be used without issue, or the last technique if all have issues.
- static RenderStatistics
geometry
(Geometry
geometry
, LightNode[] lights = null, Material[] materialOverrides = null);
- static RenderStatistics
model
(Model
model
, LightNode[] lights = null, Material[] materialOverrides = null, float animationTime = cast(float)0);
- protected static void
postRender
();
- static void
reset
();
- Completely
reset
the Rendering engine.
All shaders will be regenerated.
TODO:
As of now, only a few things are actually
reset
.
- static RenderStatistics
scene
(CameraNode camera, IRenderTarget target);
- Render a camera's view to target.
The previous contents of target are first cleared.
Params:
CameraNode camera |
Render what the camera sees. |
IRenderTarget target |
Render to this target. |
Returns:
A struct containing rendering statistics
- static void
surface
(Surface
surface
, IRenderTarget target = cast(IRenderTarget)null);
- Render a
surface
. TODO: Move parts of this to OpenGL.d
|