Jump to content
  • Advertisement

ming zhu

  • Content Count

  • Joined

  • Last visited

Community Reputation

136 Neutral

About ming zhu

  • Rank

Personal Information

  • Role
    Technical Director
  • Interests
  1. I don't know what are your P0 and P1 represent but a plane has only one normal and even if it's pointing to a reverse direction the result should be the same.
  2. Quote:Original post by Tom Sloper Are you asking about the game design? Or the programming of the game? First you need to have a GDD (a game design document). You need to have a complete idea of what you are making. Then you need to do the technical design. In thinking through the technical design, you should be able to figure out where you need to start. If that's what you're asking. Excuse me Tom, could you please describe a little more about the "technical design"? I'm wondering how wide and how deep should this doc go. Thanks!
  3. Quote:Original post by Drakonite A compiler/toolchain (i.e. Visual Studio) A text editor to edit code (i.e. Visual Studio) An image editor (i.e. Gimp or Photoshop) A 3d modeling tool, assuming you're making a 3d game (i.e. Blender) An audio editor (if making your own sound effects) (i.e. Audacity) I Think he also needs DirectX. And, based on all of these he still needs to make a lot of other tools such as Exporter, UI Editor, Scene Editor, etc. ;)
  4. It depends on what kind of game you wanna make and which platform will the game be on. If it will be a PC game then you could start with a open source engine like Ogre. It has a basic framework for a simple game.
  5. I have this same problem. I want to make a game on my own. When I started the project I created several filters such as "IO", "UI", "Graphic", "Logic", etc. Then I focused on each of them one by one. But it turned out that the time is too long to develop a good enough module before you lose patience and ask yourself when could I start to code the real core of the game... So now I think a better way would be: 1, to have a clear structure for the project; 2, make interfaces and basic logic functions so that the game could run like a demo; 3, go deep into each module...
  6. Hi, I'm doing optimization for a game which uses C++ and Lua and I found several lua_pcall functions took very long to execute. I thought it was those lua functions ran for a long time but after I added timers into them to test I found they didn't. So I guess the problem may happen when C++ calling Lua? I also noticed there were large memory increases after lua_pcall, does it mean C++ allocates some huge objects for the lua function? The parameters for those functions are very simple so I don't see why calling them would take that long. By the way in these functions there are references to some huge global table items, does it have something to do with this issue? Looking forward to your helps. Thanks!
  7. Hello everyone. I've just bought an XB360 and was playing the game Project Gotham Racing 4 (I know, it's an old game). The streets of Shanghai in the game was so real that I can tell all the places I've been to before in my real life. I'm wondering, how did they make it? In my opinion the price of modeling for each single piece of the buildings and all other details is too high and also takes a very long time. Maybe it's something like taking photographs of the real word and generating textures for simple models? But then how to make the buildings appear real without any normal information? Could any one give me any information or suggestion on this? Thanks!
  8. maybe we can use Occlusion Query to do this in hardware~
  9. ming zhu

    transparency setting

    disable depth_check?
  10. ming zhu

    CreateDevice () fails

    Sounds like we came to a hardware discussion at last~ Reinstall an OS and all proper drivers shouldn't be a difficult thing. But if you can't run other 3d apps or games, you can't run your own either.
  11. Thanks Zuka! But since I can successfully get surfaces from both the base texture and the temp texture, what else memory do I lack that will cause D3DXLoadSurfaceFromSurface to crash?
  12. ming zhu

    CreateDevice () fails

    Run dxdiag and see under the Graphic( or Display, whatever, I'm sorry I only have a Chinese version of that ) tab check if the DirectDraw and Direct3D Acceleration are enabled.
  13. Hi guys, now I wanna paint a small texture which is gray scaled to a texture atlas, I also have a color property for the small texture so I need to multiply the colors from the small texture with my color property to get the final result. Here is a brief desc for how I make this: SmallTex.dds || || 1, create D3D Texture with Static Usage and Managed Pool \/ IDirect3DTexture9* pBaseTex || || 2, copy to a temp texture( dynamic, Default pool ) for color multiplying || I use D3DXLoadSurfaceFromSurface here \/ IDirect3DTexture9* pTempTex ( gray scaled ) || || 3, lock the temp texture and do color multiply per pixel \/ IDirect3DTexture9* pTempTex ( colored ) || || 4, copy the colored texture to the correct position of the texture atlas || I use D3DXLoadSurfaceFromSurface again here \/ IDirect3DTexture9* pTexAtlas I copied the base texture to a temp texture because the base texture could have been used by other rendering stuffes and I think this could avoid Stalls. Whatever, though the program runs fine on moden PCs, I did encounter crashes on the very old graphic card TNT2. It was when doing the 2nd step, copying the base texture to the temp texture. It didn't always crash, maybe the 1st time and 2nd time it was all right but the 3rd time it crashed. The debug program just poped up a box saying something like Access Violation. But there seemed to be nothing I could do since it was inside the D3DXLoadSurfaceFromSurface function. Later I tried to change the temp texture to be in System Memory, and it never crashed anymore. The information I could find for the functions like D3DXLoadSurfaceFrom* was so few that I don't know whether I made the wrong use of it. I wanna know why the program crashed before I used SystemMem. Another problem is that after I made that change to the texture location, the 2nd step now runs fine but the 4th step( copy the temp colored texture to the Atlas ) failed sometimes( I only encountered twice, both on WinVista ). The Atlas is Dynamic and in SystemMem too. I update it to a video memory texture later for rendering. But this time it's not a crash, but the D3DXLoadSurfaceFromSurface function returned a fail result. So what's the most proper and correct use of the D3DXLoadSurfaceFromSurface function? Or where can I find more detailed descriptions for interfaces like this? Thanks, Ming
  14. ming zhu

    Batching Models

    If you have a lot of static entities that using the same render state and textures you can put all their vertex data into one large vertex buffer( index data too if you uses indices ) and render them with one draw call. For particles it is the Shader that does the transform things, all the particles should be in one vertex buffer. For example you can use one tex-coord set for initial velocities of each particle point and pass in a time param to calculate the current scale and position of each particle. I don't have a full example at hand but I wrote a simple .fx file that demos how to do the particles. I'm sorry but I'm new here I don't know how to use the code frames so I just pasted them below. float fGlobalTime; float3 vecAcceleration; float4x4 matWorldViewProj : WORLDVIEWPROJ; struct VS_OUTPUT { float4 position : POSITION; float point_size : PSIZE; float4 color : COLOR0; }; VS_OUTPUT ParticleVS( float3 pInit : POSITION, float3 vInit : TEXCOORD0, float2 time : TEXCOORD1 ) { VS_OUTPUT output; float tInit = time.x; float tLife = time.y; float t = fGlobalTime - tInit; if( t < 0.f ) { float4 initPos = float4( pInit, 1 ); output.position = mul( initPos, matWorldViewProj ); output.point_size = 0.f; output.color = float4( 1.f, 0.f, 0.f, 0.f ); } else { float lives = t / tLife; float liveTime = t - tLife * floor( lives ); float3 pCurPos = pInit + vInit * liveTime + 0.5f * vecAcceleration * liveTime * liveTime; float4 pFinal = float4( pCurPos, 1 ); output.position = mul( pFinal, matWorldViewProj ); output.point_size = -8.f * liveTime * liveTime + 8.f * liveTime + 0.1f * pFinal.y + 1; float colorComponent = liveTime / tLife; output.color = float4( 1.f, colorComponent, 0.f, 0.f ); } return output; } void SimplePS( float4 iColor : COLOR0, out float4 oColor : COLOR0 ) { oColor = iColor; } technique tec0 { pass p0 { vertexshader = compile vs_1_1 ParticleVS( ); pixelshader = compile ps_2_0 SimplePS( ); } }
  15. ming zhu

    Texture not showing up

    You need to add a tex-coord param to your vertex shader's input for passing in the UV sets. And instead of using gDiffuseMtrl/gAmbMtrl/gSpecMtrl, you may want to use a sampler to get the pixel color from your texture. You also need to pass the uv numbers down to the pixel shader, as an output of the vertex shader. A very simple approach would be like this, texture gTexture0; sampler SimpleSampler = sampler_state { texture = <gTexture0>; MipFilter = LINEAR; MinFilter = LINEAR; }; struct InputVS { float3 posH : POSITION0; float3 Norm : NORMAL; float2 uv : TEXCOORD0; }; struct OutputVS { float4 posH : POSITION0; float2 uv: TEXCOORD0; }; OutputVS SimpleVS(InputVS input) { OutputVS outVS = (OutputVS)0; ... outVS.uv = input.uv; return outVS; } float4 SimplePS(OutputVS input): COLOR { float4 finalColour=0; ... finalColour = tex2D( SimpleSampler, input.uv ); return finalColour; } You can then do shadings or whatever you like :)
  • 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!