-
Notifications
You must be signed in to change notification settings - Fork 219
Renderer Interface
Rendering is done through an interface called spades::client::IRenderer
.
- Setup a struct
SceneDefinition
and give it toBeginScene
- Add objects including:
- Models
- Dynamic Light
- Debug Line
- Call
EndScene
to tell the renderer that we have nothing to add to the scene anymore - Draw 2D images
- Call
FrameDone
. - Call
Flip
. The renderer will transfer the rendered image to the screen.
GLRenderer
is an OpenGL 3.0 implementation of IRenderer
and supports all required function. GLRenderer
is currently the only implementation of IRenderer
.
-
BeginScene
just initializes the rendering -
EndScene
renders the scene in multiple passes:- Preparation
- Shadow Maps Generation
- Sun-light Pass
- Dynamic Light Pass
- Post-process
-
FrameDone
flushes 2D rendering command buffer. -
Flip
callsSwap
of the OpenGL device.
NOTE: This is not implemented. There are no plans to implement this. Just an idea.
GL1Renderer
will be an OpenGL 1.x implementation of IRenderer
and will support all required function.
NOTE: This is not implemented. There are no plans to implement this. Just an idea.
CLRenderer
will be a OpenCL implementation (like GPU-accelerated VOXLAP) of IRenderer
and will support all required function.
NOTE: This is not implemented. There are no plans to implement this. Just an idea.
SWRenderer
will be a software implementation (like VOXLAP) of IRenderer
and will support all required function.
When cg_smp
is set to 1, multi-threaded rendering architecture is enabled. Client
issues commands to AsyncRenderer
, and AsyncRenderer
sends the commands to IRenderer
in a separate thread.
This architecture is similar to cg_smp
of id Software's Quake 3.
Note that SMP renderer is unstable, difficult to trace errors, and there is some lag because of thread scheduling. Logging might not work correctly.
CPU/GPU Ray-tracing renderer might be added (something like VOXLAP) in the future.
This wiki is in the middle of an update process to match the latest changes of OpenSpades 0.1.2
It may contain outdated, incorrect or incomplete information.
Please contact the repository owner (@yvt) via email or ask a question in the issue tracker if there is any obscure information you are looking for that can't be found in neither the source code nor in this wiki.