ryvola

Members
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

100 Neutral

About ryvola

  • Rank
    Newbie
  1. [quote name='Starnick' timestamp='1309537401' post='4830063'] You would unbind your shadow map render target by either setting null or a different render target (e.g. your swapchain's render target). [/quote] Thank you for your anwwer. But I still get the same warning. In fact I set different target when switching from shadow map render to camera view render. Just to be sure I set null render target at the end of my Render method. [code] public void Render() { // ... // some initialization // ... context.OutputMerger.SetTargets(shadowMapDepthView); // here I get the warning // ... // shadow map render // ... // setting new target for camera view render context.OutputMerger.SetTargets(depthStencilView, renderTarget); // ... // camera view render // ... // just to be sure, I set all targets to null context.OutputMerger.SetTargets((DepthStencilView)null,(RenderTargetView)null); swapChain.Present(0, PresentFlags.None); } [/code] Despite the warning the render is OK. Why do I get the warning? Ryvola
  2. Hi everybody, I render a scene with a shadow map. When I set target for the output merger, I get a warning about the Resource not being unbound from the previous render. [code] DeviceContext context; DepthStencilView shadowMapDepthView; // ... context.OutputMerger.SetTargets(shadowMapDepthView); [/code] [code]D3D11: WARNING: ID3D11DeviceContext::OMSetRenderTargets: Resource being set to OM DepthStencil is still bound on input! [ STATE_SETTING WARNING #9: DEVICE_OMSETRENDERTARGETS_HAZARD ][/code] Please, how can I unbound the resource? Ryvola
  3. [SlimDX] Shadow Map

    Yes, running this code on DX10.0 hardware doesn't allow to use more than 1 sample count. On DX11 hardware this code runs smoothly. Thank you for helping me. Ryvola
  4. [SlimDX] Shadow Map

    Maxest, thank you for your quick answer. [quote name='maxest' timestamp='1308831938' post='4826743'] Quick guess: Format is wrong to me. Shouldn't that be R32F or D24? I would assume D24 after taking into account you have DepthStencil bind flag. [/quote] All these formats give me the same exception. [quote name='maxest' timestamp='1308831938' post='4826743'] btw: what does the DX debugger says? [/quote] Is it this? (I'm still new to DirectX) [code] An unhandled exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll Additional information: E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809) [/code] Edit: I've got additional info from debugger: [code]D3D11: ERROR: ID3D11Device::CreateTexture2D: If the device interface is D3D10.0 or the driver/hardware are D3D10.0 (regardless of API version), a Texture2D with sample count > 1 cannot have both D3D11_BIND_DEPTH_STENCIL and D3D11_BIND_SHADER_RESOURCE. This call may appear to incorrectly return success on older/current D3D runtimes due to missing validation, despite this debug layer message. [ STATE_CREATION ERROR #99: CREATETEXTURE2D_INVALIDBINDFLAGS ][/code] Does it mean I can't run it on DX10.0 graphics card? Ryvola
  5. Hi everybody, I try creating a shadow map in SlimDX using this tutorial [url="http://takinginitiative.net/2011/05/15/directx10-tutorial-10-shadow-mapping/"]http://takinginitiat...shadow-mapping/[/url] Whenever I create Texture2D for the shadow map I get [i]System.NullReferenceException[/i]. The relevant part of the code is here [code] Texture2DDescription shadowMapTexDesc = new Texture2DDescription() { Width = form.ClientSize.Width, Height = form.ClientSize.Height, MipLevels = 1, ArraySize = 1, Format = Format.R32_Typeless, SampleDescription = swapDesc.SampleDescription, Usage = ResourceUsage.Default, BindFlags = BindFlags.DepthStencil | BindFlags.ShaderResource, CpuAccessFlags = CpuAccessFlags.None, OptionFlags = ResourceOptionFlags.None }; shadowMap = new Texture2D(device, shadowMapTexDesc); // the exception is raised here [/code] Anybody knows what I'm doing wrong? I'm using DirectX11. Ryvola