• Content count

  • Joined

  • Last visited

Community Reputation

132 Neutral

About Drastick

  • Rank
  1. Moving while firing

    You should use the inherit velocity from the player. If you throw a rock from a moving car then the rock is already moving at the speed and direction of the car. If you throw it then it starts with that velocity then external forces may act on it (Wind, drag, gravity, so on...) You may have the same problem if you were moving forward and shot a slow rocket it is possible that it would lag behind you then tag you right in the back of your head. BulletVel = PlayerVel + EjectionVel
  2. Thanks guys that helps! Good to know I was on the right track.
  3. I've got a little head scratcher here and maybe because it somewhat trivial... I am trying to create a weapon trail effect like that in Soul Calibur, Ninja Gaiden, or even the engine trail from the ships in Homeworld. Obviously I would like to have lots of control elements such has length, mesh smoothness, fade out time, material and texture. I am a little indecisive as to how the trails mesh should be constructed as well as how to update it each frame. I am not sure if I want to construct a spline in 3D space and build the trail from that or to "emit" a new triangle at the start of the trail strip and remove from the end (of course I would recycle the tris moving from back to front). I tried to google this one for more info but there is little documentation. I would love to hear ideas from others who have tackled this problem or might have some incite.
  4. I don't think I have ever seen a vertex shader that does not do the world transfrom in it. As far as I know, when you use the vertex shader you are pushing that vertex though the whole pipeline and if you do not do the transfrom on it, then it will never get transformed at any other stage. So if plan to transfrom the vertex the do it in your shader.
  5. Level File Format Question

    You might want to search for articals related to Quake3 BSP loading. I know there are some decent ones out there that talk about the format of level file. Sorry I do not have a link handy but it should be a quick google search. To give you a littel more detail on how one might design a level file format you might want to start by getting chunks of info from your file. Also note that it is a very good idea to create two versions of a level/save load format. One that is text format that a human can scan though and make sure things are done correctly and one that is binary so I can be loaded quickly. Example: struct LevelHeader { //Header details int version; char levelName[256]; //The header will hold counts of each chunk type and an offset into the file int numLevelShapes; int offestLevelShapes; int numMonsters; int offsetMonsters; }; So lets say you you want to load the chunk data for all the monsters in your level. struct MonsterData { int type; int hp; Vec3 position; } First you always read in the header which is located into the begining of the file. The LevelHeader struct will now be filled with data. You would seek the to the memory location in the file to the offsetMonsters which is where the first check of monster data begins. You then loop though numMonsters reading in a chunk of file data into MonsterData. To the same thing for your LevelShapes and so on. I don't want to say this IS the way to do it but I think it will give you a good idea of how to design your file format. It is important that you have something you are happy with and fits your needs best. Best of luck!
  6. bump... I have still not been able to figure this out anyone out there know a thing about working with shadow volumes?
  7. I have been experimenting with shadow volumes based off the demo from codesampler.com the demo implements the depth-pass varient while I extended it to use depth-fail. I have ran into a few problems with getting my depth-fail to work correctly. Depth-pass with one light looks fine until the camera enters the shadow volume. To fix the problem of the camera in the shadow volume I used the depth-fail which fixed the problem but there are more serious ones now. As you can see from the picture things look really messed up. I then relized that I needed to cap the shadow volume. This only fixed one of the problems... There are still issues with the shadow over the object itself. This is where I am stuck and looking for the input from others. What could the issue be? Here is the section of code that renders the shadow volume: g_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE ); g_pd3dDevice->SetRenderState( D3DRS_STENCILENABLE, TRUE ); g_pd3dDevice->SetRenderState( D3DRS_SHADEMODE, D3DSHADE_FLAT ); g_pd3dDevice->SetRenderState( D3DRS_STENCILFUNC, D3DCMP_ALWAYS ); g_pd3dDevice->SetRenderState( D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP ); g_pd3dDevice->SetRenderState( D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP ); g_pd3dDevice->SetRenderState( D3DRS_STENCILPASS, D3DSTENCILOP_KEEP ); g_pd3dDevice->SetRenderState( D3DRS_STENCILREF, 0x1 ); g_pd3dDevice->SetRenderState( D3DRS_STENCILMASK, 0xffffffff ); g_pd3dDevice->SetRenderState( D3DRS_STENCILWRITEMASK, 0xffffffff ); // Make sure that no pixels get drawn to the frame buffer g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ZERO ); g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE ); //PASS 1-------------------------------------------------------- g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW ); g_pd3dDevice->SetRenderState( D3DRS_STENCILZFAIL, D3DSTENCILOP_INCR ); g_pd3dDevice->SetTransform( D3DTS_WORLD, &m_matTeapot ); m_pShadowVolume->render( g_pd3dDevice ); //PASS 2-------------------------------------------------------- g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); g_pd3dDevice->SetRenderState( D3DRS_STENCILZFAIL, D3DSTENCILOP_DECR ); g_pd3dDevice->SetTransform( D3DTS_WORLD, &m_matTeapot ); m_pShadowVolume->render( g_pd3dDevice ); // Restore render states g_pd3dDevice->SetRenderState( D3DRS_SHADEMODE, D3DSHADE_GOURAUD ); g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); g_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE ); g_pd3dDevice->SetRenderState( D3DRS_STENCILENABLE, FALSE ); g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE ); Any ideas??
  8. WHAT ENGINE!!!!!!!!!???? *GASPS!*

    IMHO, Torque is below par these days. The collision detection is very poor and the importing tools are buggy. We started a project with torque and are spending more of our time working out issues related to content and getting things to work correctly with the engine. I would highly recommend another option if you are trying to produce a professional quality game. If you are Indie, then it might be a good choice...
  9. Back 2 Front Sorting

    That sounds good, I could create plug in like sort functions so that depending on the object it can use the one best suited. I will be pulling out the transparent objects from those in the batch. With a little creativity I could batch the transparent objects much like the normal batch system (by vertex buffer/material). So long as I draw the similar state transparent objects in the correct order I will still be able to reduce the state changes. Now this is kinda of moving on to another topic but related to the batching and sorting of objects. As I understand, since I am sorting and batching the objects I need to hang on to that objects transformation matrix though the render pipeline. This way I could have only one instance of the geometric object and render it for multiple objects each with their own transformation. Now to me this sounds like a lot of space and copying of matrices, though I could use a matrix pool to reduce memory allocation, is this the ideal way of doing this?
  10. Back 2 Front Sorting

    Yes... but with what data should I determine the depth from the camera? Center of the object, closets face of the object, or something else? Lets say I have two sphere meshes one with transparency, each with a different size, both centered at the same location. Ignoring which sized sphere is the transparent one, how would you determine which to draw first?
  11. To handle transparent objects (or other thing) I need to draw my objects in back to front order from the camera's view so that the layers work out correctly. So my question is where in my render pipeline should I draw all the B2F objects, and with what data should I use in to determin what object is closer than another with respect to the camera view. The same question applys to F2B as well. The steps in rendering as I figure it best would be 1 Render Front to Back 2 Batched objects any order to reduse state changes 3 Back to Front Thanks!
  12. I was looking though the SDK and saw something that said not to execute two scripts at once, then I saw this: Multithreading * Multithreading support is off by default, to add the support define the flag USE_THREADS * The flag NO_THREADS no longer have any effect I am not sure what that control implys nor where you can set this USE_THREADS. Anyway I am looking into AS for my scripting language it seem the easy es to embed with c++ compared to everything else I have looked at. I also like the c/c++ style syntax, that is a big plus. I have 3 questions that are keeping me from making my decision. 1) Like I said before, to what extent can I use multithreading? 2) On it's own does the language support any OO features? Can I create a class like object in the script and derive new objects from it. Say I have a base class for vehicles in my c++ code and I expose that to the script, if I create a base vehicle in the script can I make new vehicle from it else where in my script? 3) Can I compile the script in to binarys to reduce load times and to protect people form getting into the script files if I were ever to ship something with it. Thanks for any help!
  13. Ten games every designer should play

    My 10 cents (1 cent per game) in no order. There are a million other great games which other people have mentioned but these are ones that stand out in my mind as very unique games. 1) Super Mario 3 2) Super Metroid 3) Beatmania IIDX series (Japanese music game) 4) Zelda 3 5) Metal Gear 6) Myth II (IMHO the best Bungie game ever, yes better than Halo) 7) Halo 8) Half-Life 2 (the first one as well they go hand and hand) 9) Final Fantasy 7 (great system) 10) Pac-Man (much love for the yellow pill popper) and shameless plug for 11) In The Groove
  14. discreet suck!!! crack em

    "Software piracy is banned from these forums. Posts asking for pirated software or for how to find pirated software will not be tolerated. Admitting to using pirated software is a bannable offense." *goodbye stealth2007*
  15. Object Mater Transparency

    So here is what I found so far: color = D3DCOLOR_ARGB(a,r,g,b); SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE); SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ONE); SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ONE); SetTextureStageState(0,D3DTSS_COLOROP, D3DTOP_MODULATE); SetTextureStageState(0,D3DTSS_COLORARG1, D3DTA_TEXTURE); SetTextureStageState(0,D3DTSS_COLORARG2, D3DTA_TFACTOR ); SetRenderState(D3DRS_TEXTUREFACTOR,color); //draw object here Am I getting warmer? Also what values do you use for RGB so they only the alpha value will have an effect (no color?)?