• Content count

  • Joined

  • Last visited

Community Reputation

137 Neutral

About matt3d

  • Rank
  1. ShaderX2 books are freely available and cover SM 3.0, as averagejoe said, SM 3.0 is kind of the standard, yes there is shader model 5.0 these days but a ton is still done in 3.0. [url=""][/url] You can skip ShaderX first book as it is about programming shaders in assembly.
  2. Game multithreading

    [quote name='dublindan' timestamp='1303409728' post='4801321'] You are right, though - the OP needs to do some research and find out what his needs are before diving in. Still, I think he can't go wrong with TBB. As for [i]"all these open source libraries"[/i], what do you mean by that? OpenMP has corporate backing. TBB is developed by Intel and was proprietary for a few years before they open sourced it and you can still get non-GPL commercial versions with commercial support contracts if you need. [/quote] Nothing wrong with those libraries, they just might be overkill depending on what someone is doing.
  3. Game multithreading

    It all depends on what you want to use your threads for. I think you should do a bit of background research about threads and it will become clear how you should use them. For instance, one thing I am using them for is that I have a very large terrain that is not built entirely at run-time, so I build it in a background thread as the player moves around. Instead of using all these open source thread libraries, I just use thread calling with these: [url=""]http://msdn.microsof...b(v=vs.80).aspx[/url] They're windows only but that is my target platform
  4. Find point between 2 points?

    What you are looking for is the midpoint - [url=""][/url]
  5. Unlocking/locking the vertex buffer is a bad idea for performance reasons as kdmilller said. This is a perfect example of needing a vertex/pixel shader.
  6. Tictactoe check if spot taken?

    I'd think you'd need to first initialize tic tac toe board as a multidimensional array like and fill it up with 0's for blank, then you can apply 1's for Xs and 2's for Os [code] board[3][3]; for(int i = 0 ; i < 3 ; i++) for(int j = 0 ; j < 3 ; j++) board[i][j] = 0; [/code] [code] void setBoard(int x, int y, int pieceType) { board[x][y] = pieceType; } int getBoard(int x, int y) { return board[x][y]; } [/code]
  7. I've dabbled in it in the past. I was always looking to make a dialog in the style of Black Isle/Bioware/Bethesda RPGs. So the dialogs have to be represented as a data tree. One way to do this is to implement SQLite for data storage, another is to just store the data in XML. I'd recommend the latter. You also will need a way to allow script/engine callbacks from dialog choices. For instance, choosing a particular dialog might cause someone to attack the player, receive an item or change reputation. Have a look at Neverwinter Nights or Dragon Age's conversation editor and look at how they do it. [img][/img]
  8. Displaying Asserts on PC

    Would creating a console system and dumping asserts with a timestamp be useful?
  9. Pre Deformed Sphere Textures

    Count me in as one of the people currently doing this. I've currently got my planet working well at 6 levels of detail with a premade heightmap (no fractals at this point).
  10. Just Cause 2 claims to have 400km square
  11. I am sure they use some sort of LOD. Look up quadtree terrain LODs or Chunked LODs. In the grand scheme of large open worlds, RDR is pretty small at around 30km2 from what I understand. Other games and simulations especially have even greater sizes.
  12. Ah okay that makes sense. Wasn't thinking - what I had in there before was per-vertex lighting. So now I need to calculate per pixel lighting using the normal map I've generated.
  13. I have a HLSL shader I have written that accomplishes multiple tasks for terrain I have. 1) Applies base texture to whole terrain 2) Applies detail texture that is tiled -- Eventually this will also be where I use multi texturing to have different texture maps at different altitudes 3) Apply normal lighting from the sun using the vertex normals I have now added code to generate normal maps from the original height map. I am not sure how I am supposed to blend all of this together. Basically in my pixel shader all I was doing was... [code] ... detailLayer.a = 0.3f; // Detail layer should not be too intensive to drown out the base layer or the lights Out.color = baseLayer * detailLayer * lightLayer; [/code] Now with the normal maps I can do the same thing [code] Out.color = baseLayer * detailLayer * lightLayer * normalMapLayer; [/code] But it just seems like doing all that I might end up losing some intensity from the normal map because of blending it with all the other textures. Am I even doing this the correct way? The normal map is blues/greens so this would mess up layers that might have snow on them if I just blend them directly with the diffuse.
  14. One example we use them for is resource loading. When you have a ton of different types of resources (meshes, images, sounds, etc) that you are loading it might be a good idea to use templates. Obviously it isn't required and the same thing can be accomplished without it.
  15. [quote name='GregMichael' timestamp='1301300631' post='4791244'] When I did something like this I did it all on GPU - very fast. Only problem I found was that generating the height map on GPU, was getting data back for collision detection. Not an impossible problem to solve though....but I've stopped working on it for now. [/quote] Not to hijack the original posters thread but as I recommended GPU as well, do you have any advice for how to get the height data back from the gpu? It is a part I actually do not quite understand yet. I would think you would need it back both for collision and error metrics (calculating which terrain patches are closer to user) In my implementation I am only using Shader Model 3.0 (restrictions of engine I am using).