Jump to content

  • Log In with Google      Sign In   
  • Create Account

KaiserJohan

Member Since 08 Apr 2011
Offline Last Active Yesterday, 07:03 PM

Posts I've Made

In Topic: sRGB and deferred rendering

13 December 2014 - 07:42 PM

Not sure if bug or not, but setting a sRGB format rendertarget before doing a CopyResource() it actually performs the sRGB conversion aswell. Rather useful.


In Topic: sRGB and deferred rendering

12 December 2014 - 03:18 PM

 

Now granted I havn't tried this so perhaps it dosn't work in practice, but isn't it possible to have two render targets to the same texture, one render target with sRGB conversion and one without? i.e, one RT with DXGI_FORMAT_R8G8B8A8_UNORM and one with DXGI_FORMAT_R8G8B8A8_UNORM_SRGB - drawing HUD using the former, linear->sRGB using the later?

 

Yes, you can do this. You just need to create the Texture2D with the associated TYPELESS format, and then specify the appropriate UNORM/SRGB format when creating shader resource views or render target views.

 

 

Can the texture2d be the backbuffer? The following throws an exception saying invalid args, and I only changed to TYPELESS:

// create swapchain, device and devicecontext
ZeroMemory(&mSwapchainDesc, sizeof(DXGI_SWAP_CHAIN_DESC));
mSwapchainDesc.BufferCount = 2;
mSwapchainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_TYPELESS;
mSwapchainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
mSwapchainDesc.OutputWindow = mWindowHandle;
mSwapchainDesc.SampleDesc.Count = 1;
mSwapchainDesc.Windowed = true;
DXCALL(D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, deviceFlags, &featureLevel, numFeatureLevels, D3D11_SDK_VERSION, &mSwapchainDesc, &mSwapchain, &mDevice, NULL, &mContext));

In Topic: sRGB and deferred rendering

11 December 2014 - 05:17 PM

Now granted I havn't tried this so perhaps it dosn't work in practice, but isn't it possible to have two render targets to the same texture, one render target with sRGB conversion and one without? i.e, one RT with DXGI_FORMAT_R8G8B8A8_UNORM and one with DXGI_FORMAT_R8G8B8A8_UNORM_SRGB - drawing HUD using the former, linear->sRGB using the later?


In Topic: Renderqueues

10 December 2014 - 03:06 AM

A render queue is used to determine the order in which to render objects. There is no reason for it to have a matrix of any kind, nor specular factor, etc.
It needs only a shader ID, texture ID, distance from camera, perhaps a layer ID, etc. Things that actually change the order in which it is rendered.

Additionally, the render-queue items (what you call Renderable here) are not sorted. Indices into the render-queue are sorted, and the order of the indices persists across frame to allow temporal coherence. You can find any of the many topics I have posted on this subject.

 

 

L. Spiro

 

If there is no connection between a render-queue item and it's scene properties, where do you fill in those blanks? Data such as world transformation matrix, specular factor, if it casts a shadow or not, etc all exists in the "scene" module and somehow this has to be fed into the "render" module, the way I am doing it now is through using the rendererables. Is there a good alternative structure?


In Topic: sRGB and deferred rendering

10 December 2014 - 03:00 AM

 

For a render target set up as sRGB the conversion will be done automatically when you draw to it

That is exactly the problem. The only way this is advantageous is during the final write to the back buffer.

Since sRGB is a permanent setting on any given texture/render target, you have to leave a render target dedicated to the sRGB conversion and nothing else, after which another copy must be made to the back buffer.

 

Why is this the case when a rendertarget doing sRGB conversion can just ouput to the backbuffer directly?

 

Maybe I understod the wording wrong. Are you implying theres a second copy to be made after the above?


PARTNERS