Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About yk_cadcg

  • Rank
  1. Thanks sirob, my original vs "bValidVert = (all(p >= low) && all(p < high));" has worked, but your suggestion might be better, as below: //vs: bValidVert = step(p, low) * step(high, p); //ps: clip(bValidVert);
  2. Hi, att, i'm drawing points. if a point is out of a box, i don't draw it. The normal way is (assuming point is: int3 p. box is: {int3 low, int3 high}): //vs ..out bool bValidVert) { if(p.x >= low.x && p.y >= low.y && p.z >= low.z && p.x < high.x && p.y < high.y && p.z < high.z) bValidVert = true; else bValidVert = false; } //ps { if(!bValidVert) discard; } how to faster it? thanks! **added: seems below can faster vs a little: bValidVert = (all(p >= low) && all(p < high)); [Edited by - yk_cadcg on June 13, 2008 11:20:48 AM]
  3. methodology is correct; forgot to multiply MVP before drawing. -------------------------- hi, i mouse-click in the dx10 window, hope to readback the pixel's color: GetCursorPos(&g_picked.pos); ScreenToClient(DXUTGetHWND(), &g_picked.pos); new a 1x1 staging texture for rendertarget pTexRT; D3D10_BOX box = {g_picked.pos.x, g_picked.pos.y, 0, g_picked.pos.x + 1, g_picked.pos.y + 1, 1}; pd3dDevice->CopySubresourceRegion(pTexStage, 0, 0, 0, 0, pTexRT, 0, &box); D3D10_MAPPED_TEXTURE2D mappedTex; pTexStage->Map(0, D3D10_MAP_READ, NULL, &mappedTex); float* pSrc = (float*)mappedTex.pData; pSrc can't get my desired color. Confusing fact: when viewing pTexRT in PIX, the pixel at g_picked.pos is exactly what i want; but when manually writing pTexRT to .pfm and viewing it in HDRShop, the pixel i want is at another position. Did i miss something? Great thanks for suggestions! [Edited by - yk_cadcg on June 11, 2008 9:37:19 PM]
  4. same Q&A here: i adopt plan 4's CopySubresourceRegion, still have bug now, fixing ------------------------------------ Hi, Where the mouse clicked on the dx10 window, i want to display the 4-channel color info of that pixel as fonts. The special thing is, i utilize blendings (add/max/min), so i need final pixel color be an aggregated result, which could be out of [0,1] range. So i have to read texture rather than directly read screen color. Besides, it seems there's no way to directly read screen color. Below's my plan, i don't know if there're better solutions. 1, After the mouse is clicked, allocate a 1x1 texture T, set the viewport to be 1x1. Move the eye to the mouse's screen position P, and lookat in the same direction of the original camera (i don't know how to implement this move..lookat..). Redraw the scene to this texture. 2, read back the texture to main memory, use DXUT's font sprite to display a line of text near the mouse's position. Another solution will cost a whole drawing: 3, After the mouse is clicked, allocate the screen-sized texture T, redraw the scene to T. 4, stage this screen-sized texture and seek for the mouse position in the main memory. Or, use CopySubresourceRegion() to copy the related texel to another 1x1 texture first, then stage it back to main memory. Above solutions are both vague and seems troublesome. Thanks a lot for suggestions! [Edited by - yk_cadcg on June 11, 2008 7:34:00 PM]
  5. Hi, after i installed nv8800's newest driver 175.16_geforce_winvista_32bit_english_whql, my dx10 app frequently hangs the system (everyday). the situation is the same using either March08 or June08 DXSDK. Of course there might be coincidence, i.e. the system is hung for other reasons; i'd like to know if anyone has the same experience. thanks.
  6. Thanks, my knowledge about winforms etc is shallow. Technically, could we make a sample app "UT Dialog Editor" that does such editing and saves a dx code piece to .txt?
  7. Hi, To adjust positions and sizes of DXUT controls via CDXUTDialog::Addxxx() and SetLocation() are time-consuming. Could there be a MFC-style toolbox supporting wysiwyg drag-and-drop? Thanks!
  8. i haven't met it before. could it be the resolution difference etc? seems easy to debug, just move the 3 parameter sprites to the position of the 2 correct ones, see if they are displayed now.
  9. yk_cadcg

    [dx10]depth test doesn't work

    thanks! btw, NVPerfHud is not workable under newest driver for vista dx10. i used to use an older driver and successfully use perfHud. Quote:Original post by sirob Check the output values in PIX. Make sure the depth is indeed less than the value in the depth buffer (also, make sure the depth buffer is written to correctly). [Edited by - yk_cadcg on June 8, 2008 8:47:12 AM]
  10. yk_cadcg

    [dx10]depth test doesn't work

    Thank you! Yes. so is it weird? Quote:Original post by Demirug Have you created and set a depth stencil view before you draw using this technique?
  11. Hi, i first draw some nearer points, then draw some farther background lines. But when i draw them, the points are hidden by the lines (yes i can tell since the background lines are massive). What's wrong? below is the shader: pass points { SetVertexShader(CompileShader(vs_4_0, vsPoints())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, psPoints())); SetBlendState(NoBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); SetDepthStencilState(EnableD, 0); } pass grids { SetVertexShader( CompileShader( vs_4_0, vsGrids() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, psGrids() ) ); SetBlendState(NoBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); SetDepthStencilState(EnableD, 0); } where BlendState NoBlending { BlendEnable[0] = FALSE; RenderTargetWriteMask[0] = 0x0F; }; DepthStencilState EnableD { DepthEnable = TRUE; DepthWriteMask = ALL; DepthFunc = LESS; } Thanks a lot! [Edited by - yk_cadcg on June 8, 2008 4:38:08 AM]
  12. You are ALL MIGHTY! I can't thank you more! Quote:Original post by sirob You're setting the DepthStencilState twice, with the second overriding the actions of the first. Since the default value for DepthEnable is true, you're turning it back on after you've turned it off.
  13. Hi, i want to blend-add the color of 2 quads, no matter which direction they're viewed from. I draw 2 parallel quads differing only in depth, and set SetBlendState(AdditiveBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); SetRasterizerState(DisableMultiSample); SetDepthStencilState(DisableD, 0); SetDepthStencilState(DisableS, 0); where BlendState AdditiveBlending { BlendEnable[0] = TRUE; SrcBlend = ONE; DestBlend = ONE; BlendOp = ADD; SrcBlendAlpha = ZERO; DestBlendAlpha = ZERO; BlendOpAlpha = ADD; RenderTargetWriteMask[0] = 0x0F; }; DepthStencilState DisableD { DepthEnable = FALSE; DepthWriteMask = ZERO; }; DepthStencilState DisableS { StencilEnable = FALSE; StencilReadMask = 0; StencilWriteMask = 0; }; Problem: when Quad[1] is nearer to the viewer than Quad[0] does, i.e. they're back-to-front rendered, the blend-add is ok (overlapped regions are highlighted); but when Quad[0] is nearer, i.e. front-to-back, there's no blending effect -- Quad[0] simply overwrites Quad[1]. How could this happen since i disabled z-test? is there automatic early-z? how to solve it? thanks a lot! (i don't need them to be transparent, and don't need store real z info etc)
  14. Hi, Q1, i was unable to enlarge the size of texts shown on the buttons/labels/Combos, which are created by CDXUTDialog g_SettingUI: g_SettingUI.AddStatic(..) i tried SetSize() SetCaptionHeight() but with no effect. thanks for pointing to related functions! Q2,to let the user be able to config some color, how to show a MFC-like pallette when he clicks a button? Q3, to draw a 3D plot where there're scale numbers along each axis, we can generate font sprites that always face our eyes:CDXUTTextHelper* g_pTxtHelper..; g_pTxtHelper->DrawTextLine(..); but there're 2 issues: 1, these font sprites float on the screen, but i want a stencil region where no text should pass the text. how to solve it? 2, when each axis has >10 scales, these fonts are too crowded. how to solve it?(texture-based ways are not dynamic and not suitable) Thanks a lot! //bow
  15. thanks a lot! i think i can use mathematica to solve a equation R(rx)R(ry)R(rz)P1=P2, where R is rotation matrix. mathematica should solve all the possible rx,ry,rz for me.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!