Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About ThiEF_Jr

  • Rank
  1. Im try to create non power of 2 texture size for render sprite and gui. My video card is have D3DPTEXTURECAPS_POW2 and D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag set. DirectX Help Document say that can use not power of 2 texture if do some condition. 1. The texture addressing mode for the texture stage is set to D3DTADDRESS_CLAMP. so i set g_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP ); g_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP ); 2. Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0). 3. Mipmapping is not in use (use magnification filter only). g_pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_NONE ); g_pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT ); g_pd3dDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE ); 4. Texture formats must not be D3DFMT_DXT1 through D3DFMT_DXT5. D3DXCreateTexture( g_pd3dDevice, width, height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pTexture ); every thing is OK for not alpha texture but if when alpha blending enable alpha channel of texture does not work. when i change texture size to be power of 2 , alpha texture is work well. Does anything must be set for render non-power of 2 with support alpha blending ? Thx u for reply :) [Edited by - ThiEF_Jr on December 20, 2006 1:50:33 AM]
  2. Hi all. Someone told me changing render state eat performance. Does directX is check stage (and other data) for ignore changing if new state is same old state. or i must do with myself !?! if( newState != oldState ) setNewState; if( newShader != oldShader ) SetNewShader; if( newTexture != oldTexture ) setNewTexture;
  3. ThiEF_Jr

    OBB vs OBB Intersect ?

    Hi all. I want to check Are 2 oriented bounding box intersect. I check it by if projection of vector from center box to box on test axis is less than sum of local axis projection on test axis. [reference by http://www.gamasutra.com/features/19991018/Gomez_5.htm ] But in some case this algo does not work (such as picture). Does anyone know better solution for check it ? Thx for reply :)
  4. Hi all I create terrain engine with LOD [ref=this article] and now i want to dynamic decal such as blood, burn mask, footprint ect on terrain. In simple static terrain without LOD, i can create decal patch from hightmap by decal cliping, but in LOD terrain height and patch of terrain is changing in every frame. For small decal such-as footprint i create a small single quad-patch lie over terrain with height offset, is ok, but for large decal such-as burn mask, it not work. [headshake] Does anyone know any technique for draw dynamic decal for LOD terrin ? [help]
  5. Hi all. Does any know "how to determine the level at which to render for LOD terrain rendering" and "how to compute factor of terrain morphing between LOD level" Thx for reply [Edited by - ThiEF_Jr on May 3, 2006 1:12:51 AM]
  6. Hi all I try to create terrain rendering with quad-tree culling and LOD optimization. Terrain is split in to many patchs [Ref : http://www.gamedev.net/reference/articles/article1936.asp] My terrain is 513x513 blocks and a patch is 8x8 blocks (at high detail). My problem is what buffer type is best for terrain rendering ? 1. Large static vertex-buffer contain all vertices in terrain and Dynamic index-buffer contain valid index data. 2. static vertex-buffer for each patch and static index-buffer for each patch. 3. ...... ??? Thank's for help
  7. Hi all I have some question about "numVertices", 4th parameter of DrawIndexrimitive() function. DirectX SDK tell me <numVertices> is number of vertices used during this call. That mean if i have a vertex buffer contain many points but index buffer refer only 10 verts in vertex buffer, <numVertices> is 10, Right?? But if i render terrain ,culling with quad-tree and optimize with LOD patch, It is hard to know how many vertex be used. Can i passing number of terrain vertices (2049x2049 for my code) to <numVertices> parameter ? Fill <numVertices> parameter with large parameter is bad for vertex cache performance ?? my terrain render operation. 1. Using a large static vertex buffer contain all terrain's vertices. 2. Create a large dynamic index buffer. 3. Culling terrain with quad-tree and PVS determine visible LOD pathchs. 4. Fill all patchs's index data to index buffer. 5. DrawIndexrimitive( D3DPT_TRIANGLELIST, 0, // BaseVertexIndex 0, // MinIndex 2048x2048, // NumVertices ???? Right ????? 0, // StartIndex numTris ); 6. do 3 - 5 for each frame. thx for reply :)
  8. Hi all. I'm curious with shadow casting in Half-Life 2. It's soft edge shadow in large area. Simple shadow map with projection texture is cause aliasing problem at object nearly camera. The technique can slove that problem is LisPSM or TSM technique, Does HL2 use them ? But i dont think HL2 use those techniqe because HL2 is released in winter 2004 and LisPSM and TSM are released in 2004-2005, isn't it ?? [smile]
  9. Hi all. I want to add shadow mapping technique to my engine.. but i found some problem. I dont know where to generate position and size of bounding of shadow projection when my light is directional light and my camera go around to scene. For spot light or point light shadow mapping, shadow are projected to texture at light position, but for direction light, it doesn't have position. If i set center of projection to be camera position, there are some parts of scene that doesnt be seen (ie. behind camera ) are project to texture.. How to know minimize shadowmap bounding that include and fit to frustum volume ? Thx for help. ps. Sorry for my bad english if it hard to read.
  10. Hi all. i have some problem about using ID3DXSkinInfo::ConvertToIndexedBlendedMesh() for generate skin-mesh.. For single material, everything is OK. but if my original mesh has multi-material ( many submesh ), when i convert mesh to blended mesh, (sometime) mesh is increase number of attribute groups ( because skininfo has bones more than max matrix palette skinning ). So i cant know the new attribute use which old attribute's material ?? [before convert to blended mesh] Mesh : Attrib-1( Mtrl no.1 ), Atterib-2( Mtrl no.2 ) [after convert to blended mesh] Mesh : Attrib-1( Mtrl no.1 ?? ), Attrib-2( Mtrl no.??? ), Attrib-3( Mtrl no.????? ) How can i do for know which material use for each atterial. Thx for your help.
  11. ThiEF_Jr

    How to set line width in DX

    [oh] Depth-buffer test is working for me. Have u enable Z-Write yet ? > pDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE);
  12. ThiEF_Jr

    How to set line width in DX

    Quote:Original post by Shinkage If that's what you're looking to do, then what you really need to look into are real time cartoon shaders. That is to say, toon rendering like that is not generally done by drawing lines like you are trying to do, but is accomplished through some tricky shader programming. Google around for more information, there's a lot out there about real-time toon shading. Do u mean Silhouette Detection Imageprocessing by pixel shader? It can create cool silhouette render like DQ8 but require hi-end GPU. 1 year ago, I ve wrote line base Cel-Shade in OpenGL by reference article at nehe, it's cool and can run in low-end GPU. I want to convert my code to DX but... cliping no work. [cry] If u have better solution tell me plzzz. [sad] thx for all reply, and sorry for my bad english.
  13. ThiEF_Jr

    How to set line width in DX

    Quote:Original post by Mari_p humm... up to where I know, the drawing methods from ID3DXLine interface don't compare depth (z-buffer method). They follow the sequence of rendering calls. For example, consider you have a line behind a mesh: If you render the line first, the mesh will be drawn over the line. If you render the mesh first, the line will be drawn over the mesh. I already test, Z-Test is working if you use ID3DXLine::DrawTransform() function, not work for ID3DXLine::Draw(). Clipping is not work if I use ID3DXLine for draw line, In DrawPrimitive with D3DPT_LINESTRIP or D3DPT_LINELIST cliping is work but how to set line width ? [headshake] I want to render charector in toon-shade like DragonQuest VIII. i must use thick line for draw silhouette. I dont like silhouette drawing like XIII, extude mesh from normal and render. Does any one help me how to draw thick line in DirectX with cliping [crying]
  14. ThiEF_Jr

    How to set line width in DX

    Quote:Original post by compiler but u forgot the homogenous divide, didnt u? Homogenenous divide? Do u mean [1/W] multiply to [X, Y, Z] ? If 'yes' D3DXVec3TransformCoord() already do it. [smile] [Edited by - ThiEF_Jr on January 16, 2006 12:23:10 PM]
  15. ThiEF_Jr

    How to set line width in DX

    Hi Anonymous Poster, I have imporve my code to be as you want. Everything is like previous code, all is ok when camera is far from line vertex. when any vertex is behind near clip line is going to wrong direction. D3DXVECTOR3 vert[] = { D3DXVECTOR3( 0, 3.0f, 0), D3DXVECTOR3( 0, 0.5f, 0), D3DXVECTOR3(3.0f, 0.5f, 0) }; D3DXVECTOR3 vert2D[3]; D3DXMATRIX matViewProj = g_matView * g_matProj; for( UINT n=0; n<3; n++) { D3DXVECTOR3 v; D3DXVec3TransformCoord( &v, &vert[n], &matViewProj ); // v is projection space transform to screen space vert2D[n] = D3DXVECTOR2( v.x * m_dwHalfScrWidth + m_dwHalfScrWidth, -v.y * m_dwHalfScrHeight+ m_dwHalfScrHeight ); } ... Draw line with ID3DXLine::Draw()
  • Advertisement

Important Information

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

GameDev.net 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!