Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

138 Neutral

About sansured

  • Rank
  1. sansured

    Edge Detection

    From a few days i am trying to solve this problem and here is the result(it is not working) My shader (according to post process example) texture g_txScene; sampler g_samScene = sampler_state { Texture = <g_txScene>; AddressU = Clamp; AddressV = Clamp; MinFilter = Point; MagFilter = Linear; MipFilter = Linear; }; float2 PixelKernel[4] = { { 0, 1}, { 1, 0}, { 0, -1}, {-1, 0} }; float2 TexelKernel[4] < string ConvertPixelsToTexels = "PixelKernel"; >; float4 PostProcess3PS( float2 Tex : TEXCOORD0 ) : COLOR0 { float4 Orig = tex2D( g_samScene, Tex ); float4 Sum = 0; for( int i = 0; i < 4; i++ ) Sum += saturate( 1 - dot( Orig.xyz, tex2D( g_samScene, Tex + TexelKernel ).xyz ) ); return Sum; } technique CelShading { pass p0 { VertexShader = null; PixelShader = compile ps_2_0 PostProcess3PS(); } } And here are the results: Render Screen So as you see, i am far away from drawing edge lines on the texture or even detect edges correctly. Does anyone have any idea about what i need to do ? Thanks.
  2. sansured

    Edge Detection

    Yes i already looked at that example but in the postprocess example there are no textures on the mesh. I couldn't figure it out how to draw edge lines on the mesh texture. Here i'll show you what i mean: Screen Shot
  3. sansured

    Edge Detection

    Hi, i am working on directx's Progressive Mesh example and i am trying to add black edge lines on textured mesh. I guess i need to add cell shader to my project but the problem is i am not good at shaders. Do you have any example code or project that i can learn how to do this. Thanks for your help.
  4. sansured

    File Extension

    Thanks for both answers. "staticVoid2" thanks for code it helped so much.
  5. Hi, i am working on a simple model viewer for rendering 3d models in real time. I keep my model files, fx. files, apllication file and all the other stuff in a folder. In the same folder i have also a config file (for example we can call it config.jjj). That config file keeps the data like object position, rotation, scale, color ...... When i run the application, at first it looks the data in the config file and than it opens the model file and render it according the data taken from config file. Now i want to make some changes like that; first of all i need to move my config file in to another location in my computer like desktop. Secondly i need to change file extension of my config file to when i run it, it should call the main viewer application like a shortcut file(it must run the application file from it's own folder because otherwise the application couldn't find the path of object file). Lastly when the config file calls the application it must send config.jjj files path to the application because when the application starts it should read the data in config file. Is there anybody knows anything about this ? Thanks for your help.
  6. sansured

    RAM Usage

    I am looking it from Windows Task Manager's Performance tab.
  7. sansured

    RAM Usage

    Hi, I am using ".x" meshs for maps in my 3D engine. But i have some problems about RAM usage. For using 12 Mb .x mesh (with textures 21 Mb) my engine fills 183 Mb of Ram. I did some tests with the same mesh on Directx SDK samples and the results are nearly same. In the game project i need to use much bigger meshs for maps and i have to solve that performance problem. I need to minimize of Ram usage or need something like content streaming; like dynamicly loading and cleaning the Ram during the game play without loading screens. Does anyone has any idea about it ? Thanks.
  8. Thanks for your help "Evil Steve". I can't belive how could i missed that.
  9. I have a kind of similar problem in my engine. I set the cursor like that: HCURSOR hCursor = NULL; hCursor = LoadCursorFromFile( "Arrow.cur" ); SetCursor(hCursor); It's working fine in 2 minutes but after 2 minutes the mouse icon suddenly disappears.
  10. sansured

    Texture Coordinate

    Thanks for your answer.
  11. sansured

    Texture Coordinate

    I have a very very huge mesh and i don't want to render all of the textures in every render loop.It's like a frustum culling what i am trying to do.But i don't want to make a complex frustum culling operation.I guess it would be enough to check textures distance to my camera before rendering and just process textures to close the player can see.
  12. sansured

    Texture Coordinate

    Yes, i mean that. I need to get x,y,z coordinate (position) of the texture in the 3D world space.
  13. Hi guys, I am using IDirect3DBaseTexture9 structure for my mesh textures.I am wondering about is there a way to get each texture's 3d coordinate in render loop. For example: this is where set textures for effect(shaders) in my render loop UINT cPasses; V( g_pEffect->Begin( &cPasses, 0 ) ); for( UINT p = 0; p < cPasses; ++p ) { V( g_pEffect->BeginPass( p ) ); ID3DXMesh *pMesh = g_Map.GetMesh(); for( UINT i = 0; i < g_Map.m_dwNumMaterials; ++i ) { V( g_pEffect->SetVector( "g_vMatColor", (D3DXVECTOR4*)&g_Map.m_pMaterials.Diffuse ) ); if( g_Map.m_pTextures ) V( g_pEffect->SetTexture( "DiffuseTexture", g_Map.m_pTextures ) ) else V( g_pEffect->SetTexture( "DiffuseTexture", g_pDefaultTex ) ); V( g_pEffect->CommitChanges() ); V( pMesh->DrawSubset( i ) ); } V( g_pEffect->EndPass() ); } V( g_pEffect->End() ); In this step before seting the texture i want to get it's 3d coordinate. Does anyone has any idea about how can i get the 3d coordinate ? Thanks.
  14. Hi, I have a problem with direct sound. When i initialize the sound like the code below and open it from file.There is no problem when playing. WCHAR sPath[ MAX_PATH ]; if( Sounds == NULL ) { hr = DXUTFindDXSDKMediaFileCch( sPath, MAX_PATH, DEFAULTSOUND ); if( FAILED( hr ) ) StringCchCopy( sPath, MAX_PATH, DEFAULTSOUND ); hr = g_DSound->Create( &Sounds, sPath, DSBCAPS_CTRL3D, GUID_NULL ); } // Play function Sounds->Play( 0, DSBPLAY_LOOPING ); But when i open the sound from memory like the code below. WAVEFORMATEX wfx; wfx.wFormatTag = WAVE_FORMAT_PCM; wfx.nChannels = 1; wfx.nSamplesPerSec = 22050L; wfx.nAvgBytesPerSec = 44100L; wfx.nBlockAlign = 2; wfx.wBitsPerSample = 16; wfx.cbSize = 0; if( Sounds == NULL ) { if(FAILED( pSM->CreateFromMemory( &Sounds, buffer, info.uncompressed_size, &wfx, DSBCAPS_CTRL3D ) ) ) } // Play function Sounds->Play( 0, DSBPLAY_LOOPING ); In every loop in this condition it's coming an annoying sound like 'tick' periodically.I can't figure it out the reason of the problem. Here is an example of the annoying ticking sound. http://rapidshare.com/files/6827454/t__305_k__305_t__305_k.mp3.html The playing sound in the sapmle is 1 sec. silence. When i open it from the file it's ok but when open it from the memory that annoying sound starts. Does anyone has any idea about taht problem. P.S: WAVEFORMATEX data's are true.There is no problem about it.
  15. sansured

    3D Sound

    Thanks for the both of the answers. I fixed the problem with "TheAdmiral"'s method. Thanks again.
  • 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!