Jump to content
  • Advertisement

ajithk

Member
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

158 Neutral

About ajithk

  • Rank
    Member
  1. What I meant was, CoInititializeEx was not called by me in my hand written code. I was not sure if that function was called by any library, header etc which I have included and which may have called it as part of their initialization process :) Anyway, I have included CoInitializeEx and CoUninitializeEx pair in my code and it worked.
  2. Hai guys, Anyone who worked with DirectxTex toolkit can help me. I am trying to load a texture from png file using createwictexturefromfile function. The arguments I have sent are fine. But the function fails with an error code E_NOINTERFACE. I think the hex code is 0x80004002. What does that mean? The WICTextureLoader.cpp file inside that toolkit says in the comment section that it assumes the application has already called CoInitializeEx.I am not sure if I did. Is this the reason? The exact location in that file where the error returns goes like this IWICImagingFactory* pWIC = _GetWIC(); if(!pWIC) return E_NOINTERFACE Btw, this toolkit is on github.
  3. Hi guys, I have been studying C++ lately, especially the std libraries related to concurrency and threads. I came to know about atomics and lock free programmimg in general. Given that game engines are some of the complex softwares requiring high performance, are there any game engines in market which use multithreading. Or lock free algorithms? (Lock free algorithms are pretty low level even compared to traditional locks, mutexes, semaphores). Also we have vulkan which absolutely forces us to deal with memory on GPU. It seems we are going deeper and deeper into hardware.
  4. ajithk

    Changing Direct3D state

    @Hodgeman Sorry friend, What I said earlier is wrong. That 'buffer' did have a connection. Maybe that's the reason. @Happy SDE I did that. There are several lines like 'Loaded 'C\Windows\SysWoW64\blahblah.dll,' Cannot find or open the PDB file' .But other than that everything is fine though. They did not affect my output.
  5. @vinterberg and @MJP I have tested it and what you said is correct. Btw, just for the sake of curiosity, I had a look at Vulkan/Direct3D 12 to figure out how driver does these things. Didn't understand a thing :D Waiting for those awesome authors out there to release a book.
  6. ajithk

    Changing Direct3D state

    Hi Hodgman, No, they are unrelated. But I myself feel that the question is too vague for you guys to help me without looking at the code. Anyway, I will observe this issue further in my code and see if I can zero in it exactly. @Nik02. Yeah. I hope so. Thanks, guys
  7. Hello guys, immediateContext->OMSetRenderTargets(1,&renderTargetView,dsv); immediateContext->UpdateSubresource(buffer,0,NULL,data,0,0); The above code works, but if I reverse those statements it draws blank. I don't know even what to ask. All right, I will do my best. Is there a particular sequence in which I need to change state in D3D11. Like for example, if I am setting buffers, shader resources etc should I do all those after shaders are attached to pipeline? Or before? If only I know what the driver is doing inside. Does the question make any sense :(
  8. Hi everyone, I have a constant buffer which is bound to b3 register. But none of the shaders currently bound to pipeline have got any constant buffers bound to b3. Can I use UpdateSubresource now to update my constant buffer and will it reflect in any subsequent shader I use in which a binding point to b3 exists?
  9. Hi everyone, Is there a way to limit the influence of lights in a scene to a particular distance. For example, if a lamp is in one corner of the room, the amount of light that reaches the other corner after taking attenuation into account is very insignificant that I may as well have left it uncalculated. My first idea is to calculate the fragment's world space distance from light in pixel shader and then proceed to evaluate the lighting equation based on that distance. But this requires 'if' statement in pixel shader. I was always advised to avoid dynamic branching in pixel shader. Any ideas?
  10. ajithk

    Consume and append buffer

    Hey! I never used those structured buffers but just to make sure, have you followed restrictions stated in this link https://msdn.microsoft.com/en-us/library/windows/desktop/ff471459(v=vs.85).aspx
  11. Hey! I got it working. Direct3D 11.0 will allow simultaneous read/write in either pixel or compute shader with only DXGI_FORMAT_R32_UINT. (Also, see the comment at the bottom of the page in the link). I din't knew this stuff. https://msdn.microsoft.com/en-us/library/ff728749(v=vs.85).aspx
  12. Actually I can't and I don't know how to. That's why I am returning contents of UAV to render target to see it on screen. I just return float4(tex1[uint2(input.pos.xy)],tex1[uint2(input.pos.xy)],tex1[uint2(input.pos.xy)],tex1[uint2(input.pos.xy)]); to SV_Target in my pixel shader. Why? Won't this work?
  13. My pixel shader is writing to render target but not to UAV. Actually it's not even reading from UAV. Since I clear UAV with float(1.0f) it should atleast show white screen if I return float4(tex1[uint2(input.pos.xy)],....) . I bound it to slot 1 since now I have render target. Not sure how to proceed with further debugging.
  14. I use black color to clear my RTV. When I return float4(1,0,0,1) the whole screen is red. Btw, my scene is a room with a chair, bed, table and a lamp. I have a first person camera working. I noticed something here. I replaced the return statement with this return float4(input.pos.z,input.pos.z,input.pos.z,input.pos.z). The whole screen is white. As i remember the scene, I walked to my lamp and chair. As I approached these, I can see a faint grey outline of lamp, chair etc. The more nearer I approach them the more greyish they appear. Even walls appear greyish when I walk to them.
  15. @ _void_ Yeah, I replaced tex[uint(input.pos.xy)] with tex[uint2(input.pos.xy)]. The program didn't crash. Earlier I did not enable debug layer, now I did. The format for my UAV is DXGI_FORMAT_R16_UNORM if that's what you asked. I have set the viewport also btw. Since I have no way of knowing if the contents of UAV are correct, I bound rendering target this time. It's format is DXGI_FORMAT_R8G8B8A8_UNORM. And I added the below line return float4(tex[uint2(input.pos.xy)],tex[uint2(input.pos.xy)],tex[uint2(input.pos.xy)],tex[uint2(input.pos.xy)]) with float4 as return type and SV_Target as return semantic (Sorry for bad formatting. Ah! The misery of typing in a tab). I expected to see my scene in black and white colors. The sort of image they show to visualize the depth buffer. But I got only black(blank) screen (no white colors ;) ) @ Hodgman For using forced sample count, I need to upgrade the driver. I will keep that on mind. And yeah, you guessed it right. Usually I dont check for HRESULT errors but now that I am getting more and more involved with this, I will. I am writing depth in pixel shader just to learn using UAVs. But now that you asked, I came to think of it :). For point lights we need 6 depth maps. Instancing geometry shaders 6 times with six different matrices and rendering depth in pixel to an array of Texture2Ds with array index as SV_GSInstanceID will give me 6 depth maps in a single pass. Not sure of performance though.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!