Reputation: 11
Well i have looked in many places and i cant find a solution to the problem, i want to render each object at the same time in a multi threaded rendering environment, or deferred rendering as many people call it.
My current system does not work at all until i tried to implement multi-threading.
The idea of deferred rendering confuses me a lot and i need a good explanation of how i can make a system that renders objects from an array with specified textures and shaders in a deferred way because there is no good explanation out there, only the meanings of the keywords...
Upvotes: 1
Views: 613
Reputation: 952
I'll try but I am not sure if you want a deferred context or deferred rendering.
from what I understand deferred rendering is rendering to a texture. the Texture2D BindFlags are set to D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET (use the SharpDX versions). so it is a shader resource and a render target at the same time.
you would set it to the outputmergerstage ,Render stuff , release it , then set it to a shader stage (usually pixel) for doing what ever you like such as postprocessing or use as a texture on a model.
if you want to multithread then you use a deferred context. this is the type DeviceContext . you instantiate it from Device.ImmediateContext.
I am not as familiar with this so this is what I understand.
you use the deferred context like you would you Immediate Context except when you are done you export a "command list" and send that to your immediateContext. there is more to this like you havae to set all your shader objects on the deferred context because it won't use what you set on the immediatecontext. infact I believe it wipes the immeditecontext of all settings.
also check your video card specs. just because it supports dx11 doesn't mean it supports multithreading. which means it will fake the deferred context stuff behind the scenes. (yes my card is a bit older)
hope this helps.
Upvotes: 1