• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

270 Neutral

About rjackets

  • Rank
  1. Mouse Accuracy

    The problem with that is that however much you shrink the value you're still taking an INT with no floating point precision and converting it -- therefore, it cannot gain any precision. If I shrink the value I just need to expand it again later to get any meaningful data. I was wondering if there is any stardard interpolation or something? I can always interpolate between the current value and the next, but that effectively just divides the movement by two and we don't improve the resolution. I know that should be something that can do what I need, my mouse has 2400dpi resolution and DirectInput is supposed to harness raw data from the device ...
  2. Mouse Accuracy

    Hey everyone. I hope you're all have a good holiday. I have a quick question regarding mouse input. I am using DirectInput and writing to the DIMOUSESTATE2 stucture... no problems there... the only issue is that it samples in as 3 LONG's. So in attaching this mouse input the the camera pan, I get a very noticable jitter as a result of the lack of floating point accuracy. I know this is the problem because I got the same effect when I accidentally defined my objects' locations in INT's rather than FLOATs. As soon as I switched it, no problem. So, the question is: How do I improve the smoothness of the mouse and remove this jitter? Thanks in advance [wink] [Edited by - rjackets on December 24, 2005 7:11:54 PM]
  3. Hrm. An additional question to this answer... is it a better idea to use the win32 message handler and send my own messages through it (as mentioned above) or would it be more prudent to create a custom message handler class. I understand that if you need the messages you send to be more complex or in a different format or whatever it would be beneficial to make ones own, but for a simple messaging system, does using the win32 message handler have any drawbacks?
  4. Particles are one way to do it, but the way those games you mentioned do it (such as homeworld, etc) is actually with a dynamically generated mesh. The simplest type would be where what you want to do is generate 2 points every couple frames (higher frequency will increase smoothness, but will also be move resource intensive). These two points will orient along the same direction of where your trail emiter is. For instance, =: : : : : :, etc the = is the emiter, the : are the two points. As you can imagine, as the trail curves the points curve along with it. Next, you use a simple indexed triangle strip (a triangle-list would be more expensive) and connect the dots. If you want more complicated trails you can use more than 2 points per segment. Finally, you 1) want to set it so that the edges are alpha blended, 2) you want to set it so it gradually fades to nothing (ie. the last points should be almost invisible), and 3) you wan to track each set of points and allow them to decay so that they will disappear over time. Good luck.
  5. Program target directory?

    Great, THANKS :)
  6. Quick question regarding Visual Studio 2005 and the target directory. This was not a problem when I was using C#, but now with C++ is seems to be acting a little off. My game uses external resources (obviously) and to access those resources there the game requires paths. For instance, my 'art' directory. Problem is, when I run the program via the F5 key (ie. Debug->Start Debugging) it creates the files correctly in their given directories, but it the program seems to think it is running from the directory that the solution file is in, and not the location the executable is. As such, if I want to run it using F5 I need to either duplicate the resource directories to one folder up, or I need to use a macro in the source to say whether it is running in this Debug mode or not. NOTE: The compiler is set to be compiling to "Release" mode at the moment. Thanks in advance.
  7. 60 frames per second?

    Ah! Perfect. Thanks for that. Running at a nice 500fps now. I think I will include an option to enable/disable v-sync.
  8. Hi all. I have a (hopefully) quick question: I initially learned the DX API using C#, but then once I had the basics down I switched to C/C++. It was a rather simple switch and, personally, I find I perfer the freedom C/C++ gives me. However, in C# my fps counter gave me very high render rates (around 3000) when there was nothing being drawn. Obviously it went down substantially once I started drawing stuff. Nonetheless, with a simple low-poly scene I was still getting around 700-800fps. Now, however, in C++, I am running at a very consistent 60fps. I thought maybe this might be due to some sort of interaction with the refresh rate of my monitor. However, even when I switch the render call down to a basic loop it still gives the same. It is not linked with the WM_PAINT call or anything either. Thoughts?
  9. Just a quick question. In regards to quad/oct-trees. Do I include non-static things like the position of my player(s) in this tree and move them around within it dynamically? Or is it mostly useful for "mostly-static" stuff like terrain, objects, etc. I can imagine that the number of things you need to check in an entire environment is much larger than checking 32 players (or whatever) to see if they need to be rendered. Nonetheless, i figure it couldn't hurt to double check. SUMMARY: Should oct/quad-tree be preloaded and include only static objects?
  10. I'm assuming that you want to do is to make your entire model (or rendered object) consistently transparent with bump-mapping. If what you mean is that only certain parts are transparent or you have varying transparency, the following would need to be modified (ex. like using an alpha texture or something). Anyway, on the to answer: You are probably using a pixel shader to draw your object. This returns a 4x4 color float. That is, ARBG. You want to create a value (either static or variable) for the alpha channel. For instance, if you set this to 0.5 you will get 50% transparency. Next, you need to enable alpha-blending. I wont go into exactly how to set that up here, but it's not hard to find (EDIT: Refer to what circlesoft said above). Finally, you might want to consider how this is going to affect the appearance of your rendered model, because if you do not have backface culling on it may reveal an effect you're not quite looking for. On the other hand, if you do disable backface culling ( ie. CullMode = None; in your shader pass) for this effect, you must consider that you're increasing your draw call by all the backfacing triangles -- which can potentially double the triangles rendered. (NOTE: This will be a pure "see-through" effect. If you want something like a glassy effect, you will also need to include refraction and the like.) Feel free to reply with any questions. I appologize for any mistakes -- it's late [wink]
  11. OpenGL Direct3D material shininess?

    It is true the power parameter will affect the specular brightness of your lights, but if you want a decent result you definately need to look to shaders. As was mentioned earlier, you can either have two shaders, one flat and another with specular. Or you can just have one and vary your own 'specular level' variable in that shader. This way you can have full control over exactly how 'shiney' your objects are. ie. You object can contain a parameter of it shineyness (or even have various subsets with differing shineyness if you want) and then on render you can set the HLSL variable, CommitChanges(), and off you go. Good luck [wink]
  12. Simple HLSL question

    The post above is a great place to start. It's where I began. ATI's rendermokey is also a good tool. However, Rendermonkey will export to HLSL but it uses a proprietary format in its design. nVidia Composer is more intuitive. Keep in mind though, both these IDEs have features that they use that you're engine will not have by default. In particular, render targets can be tricky. My best advice is to learn about simple shaders, and then make a very basic program yourself and use that to work with your shader scripts. That way you know exactly what you're getting and how to implement it.
  13. vectors and virtual functions?

    lol, got a couple of the same answer [wink] but thanks all for the fast help. That is exactly what I was looking for. It seems like a very simple solution to a problem that could have been a real headache if I hadn't used it. Thanks again!
  14. You brought up slow downs based on having extra polygons. Each hit should have (at MOST) a single quad. If you want you could also make a single triangle and have the bullet hit located in the center... it would have some wasted space and maybe some distortion though. Either way, what you want to do is draw a whole bunch of those triangles in the same draw call. Instead of having 500 draw calls each with that texture, you should have a couple (2 or 3, or whatever works best) where you draw a large number of triangles at once. This is much more efficient in terms of both texturing (only one texture instance per hit effect) and in polygonal draw calls. You might also want to look up INSTANCING. The CryTek engine uses this to draw large amounts of grass and stuff.
  15. I am trying to create a container for my user interface. Essentially it comprises of the base 'window' and then that window contains a bunch of objects which all inherit from UIEntity. I would like to be able to make it so that the window class is authoritative over all its children. My question in particular is, I would like to have a function in the window class called Draw() (or Render, or whatever) which simply iterates through and draws all the UI elements. Problem is (obviously) that different elements have different properties and need to render with different calls. So, if I have a 'virtual' function in the base UIElement class called Draw() which does nothing, but is defined in the children, when I call UIElement->Draw() will it call the function defined in the CHILD or the PARENT UIElement class? For instance, in pseudo-code vector<UIElement> elements; elements.push_back( some UITextBox ) (which may be a child type) for each element in elements { element->Draw(); } Will this call what is defined in UIElement or UITextBox? Thanks in advance.
  • Advertisement