• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

114 Neutral

About zipwax

  • Rank
  1. I've seen tons of examples on the net about how to get a DebugDevice in SharpDX, and then how at the end, to call ReportLiveDeviceObjects( ). Yet every single example shows a stack of still-instantiated objects. The ID3D11Device always has at least 2 external refcounts on it, and the rest have internal refcounts, but no external refcounts... This seems unclean.   I'd like to know if there is *a* way to "clean up" the DebugDevice so that the DebugDevice knows that ALL of the D3D objects are gone and cleaned up. Kinda like a way to call DebugDevice.SetD3DDevice( null ), or DebugDevice.DisposeYourReferenceToD3D( ), and THEN call ReportLiveDeviceObjects( )! I want a clean log! I haven't seen one example where the log is clean.   I know enough to flush the context, and clear it's state, by the way. This still-having-entries log file is after doing all that.   Possible!?
  2. I'd like to have a master HLSL file, with some functions in it, but these functions require a lot of variables to be passed in. It'd be *nice*, but not absolutely necessary, if my master .fx file could reference "extern" variables, and at compile time, resolve those to the ones in my cbuffer in the non-master file. Is this possible?   to restate, I have two files, "master.hlsl" and let's say "blur.hlsl". I want blur.hlsl to reference master.hlsl with a #include. I want blur.hlsl to define a cbuffer  with some varaibles (let's say float fBlurSizeH and float fBlurSizeW), and inside master.hlsl, it defines these variables as "extern float fBlurSizeH" (etc)... Maybe I'd have a function like void DoBlur( Texture2D image ), which references fBlurSizeH. When I try this, it tells me my variable is defined twice. Stupid compiler! :-)   I don't see any reason why this couldn't happen, but I don't know the syntax of how to do it. It just seems cleaner.   One problem I have is that I have multiple HLSL files wanting to reference this master HLSL file, so I can't reference a specific constant buffer from within the master HLSL file, I need the variables it references to be "generic".   thanks  
  3. I want to animate some synthetic video bits to fullscreen w/o tearing at a precise vertical HZ frequency. Can I set up D3D 9/10/11 in exclusive mode, and have it present a series of buffers that I'm writing to? I know how to copy system memory bits into a texture, then draw that texture as a fullscreen quad, but it seems like overkill. Why should I use the triangle rasterizer when I want to do something so simple? I don't know what i'm doing, but all I want to do is set up a long (4-8 buffer) swapchain and set the bits of the back buffer that is about to be displayed. Or, I want to allocate 4-8 RenderTargets, and on each frame, copy the bits from system memory to the RenderTarget, then somehow, get that RenderTarget to display on the screen. I realize a RenderTarget is normally used to draw to as a pre-step then use it as a texture in a successive step. Whatever the case, i want to blast system memory bits into "something that is about to be displayed next" and have D3D drawing one thing while I'm blasting bits to the next thing. I don't know why I should have to use the triangle rasterizer with so simple a task. I've never seen or heard about anybody doing this, but it seems it should be so dead simple! thanks in advance...
  4. Soft-Edged Shadows

    Why is the depth calculated per vertex instead of per pixel?
  5. I need to calculate shadow maps for 3 lights at once. Instead of using 3 shadow maps, I'd like to calculate all of them in one pass, using one shadow map, each light stuffing it's depth value into a single R, G, or B channel. I know, this gives me only 256 bits of precision per channel. Is this even possible?
  6. To the first guy who asked the question, I figured it out. For a point-light, you simply duplicate the exact same projection matrix as you use for the camera. In other words, move the "eye" to the point source's location (the view matrix), and calculate the projection matrix to be the same as you used for the camera. Then calculate the shadow map. Be careful that the light is not too close to your model, or the shadow map won't contain all of the model, and you'll get STRANGE shadows.
  7. That wasn't the most informative reply. Why represent it as six spot lights? Why can't I find a HLSL example for a point-light shadow routine where the point light simply uses a perspective transformation instead of a orthographic transformation? Are there any examples online of a point-source shadow mapping (SIMPLE) example?
  • Advertisement