Jump to content
  • Advertisement

Nedelman

Member
  • Content count

    86
  • Joined

  • Last visited

Community Reputation

166 Neutral

About Nedelman

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Nedelman

    3ds loader [source]

    In addition to some of the things jpetrie mentioned: 1)You have memory leaks all over the place. I see a lot of 'new' allocations, but no corresponding 'delete's. You should use std::vector for your mesh components to fix this, or at least add destructors that free the data you allocate. 2)When you load names, the repeated character concatenations are excessive. Since 3DS file format has limits on name lengths, you should load into a char array instead, then copy that into the name string object when the name loading has completed. 3)You automatically convert the meshes so that they have Y axis as the up axis. That's not a good idea since many people, such as myself, prefer to use Z up. You should make the conversion an option. 4)Your vertex normal calculations don't take the face smoothing groups into account. This is a problem since even simple objects, such as a cube, will not be lit properly. 5)No camera or light support. These are extremely useful to have in a scene importer. I've also written a 3DS importer myself, along with a viewer, which you can find at http://www.gameprojects.com/project/?id=6c3eea10eb . It's written in C# for XNA, but I think you'll find the code easy to follow if you'd like to use it as a reference.
  2. Try using the HINSTANCE that is passed by the system to your DLL's DLLMain() function.
  3. Nedelman

    Untitled

    As of DirectX 9, DirectDraw is a legacy feature and isn't available as a version 9 interface, so I don't recommend learning that. DirectX 10 will evidently be bringing back DirectDraw in some form but since you probably don't have a DirectX 10 card, that's probably not an option either. If all you really want to do is code 2D games, you should take a look at SDL or XNA, both of which have very simple interfaces for drawing 2D graphics. Otherwise, you will have to familiarize yourself with setting up 2D parameters in a 3D API which, while flexible, is probably more complexity than you need when you're starting out. Also, since you asked, I prefer D3D to OpenGL.
  4. Nedelman

    Trouble with reflections

    Quote:Original post by madox ....by rendering copies of the game pieces upside down, and blending them with the board. The pixel shader sets the reflected object's alpha to 0.5 You should draw the reflected objects normally (with no transparency), then blend the board on top of them. Then draw the non-reflected objects. That is the usual way.
  5. Your idea sounds a little more complex that it needs to be. Why not just check the caps directly for your application?
  6. Yeah, do yourself a favor and just go buy yourself a wired controller. For entertainment I like wireless, but when I'm at my computer I work and I don't want to be bothered with having to charge/replace batteries.
  7. Nedelman

    namespaces!!!!

    Namespaces are used to help prevent naming clashes in different code modules. For example, lots of graphics programs and libraries have their own Vector3 definition. Namespaces allow same-named types to be used simultaneously. Personally, I'm happy when I see code that uses namespaces because I know it's going to be less troublesome to work with. I say you should always use namespaces, even if your usage is a simple as having one namespace called "MyGame". Whatever you do, don't go namespace crazy and create more namespaces than you need. Keep the number and depth of your namespaces small and general so that you can your code stays flexible. This is important because if you end up moving things around and you have to rename your namespaces, you won't create extra work for yourself. The only time you shouldn't use namespaces is if you are certain the code will need to be compiled with a compiler that does not support namespaces. I've not worked with such compilers, so I don't know how relevant this issue even is.
  8. Nedelman

    Using the stencil buffer

    Disabling color writes does not enable stencil writes. Just like enabling depth writes does not enable color writes. These are all things that you can enable or disable as you choose. The best practice is to explicitly enable the things you need and disable the things you don't need.
  9. Nedelman

    Gaming Project

    If you have extensive knowledge of Java that would take too long to relearn on another language/platform, then stick with Java. But if you've only used Java casually and you have some flexibility with your platform choice, and you don't have to run in a browser, you should take a look at Microsoft's XNA Game Studio Express. Having used it myself (you can find some of my projects on my site, in my signature) I can say that it's one of the cleanest graphics API's I've used, and especially if you're doing 2D stuff, the ease of use and flexibility are hard to beat.
  10. Nedelman

    XNA type of input question

    It only works with 360 gamepads
  11. Nedelman

    Strange fxc

    You get the 'maximum constant register index exceeded' when you...well...use too many constant registers. This can occur if you have a lot of if()s, or you access a lot of different variables. There are couple of possible solutions to your problem: 1)Use a higher shader model. Shader model 2.0 is pretty restrictive, 3.0 is substantially more flexible. 2)Compile out your constant if() blocks, with #ifdef blocks. This will likely require a good amount of reworking in your program if you haven't already set it up to work with multiple shaders.
  12. Hello Spk. I've done something similar to what you're doing. I created a 3DS Viewer application that does multiple lights, bump mapping, and other things in a single pass. The light data (positions, directions, colors, etc) are stored as effect parameters. Doing lighting in a single pass like this, on a per pixel basis, requires very long pixel shader instruction sequences, so the rendering only looks nice on shader model 3.0 hardware, though I do have a fallback for shader model 2.0 hardware that uses vertex lighting. The fallback looks pretty bad, as you might imagine. I've posted the application with the full source code, so you may want to take a look at it. I'd be glad to answer any questions you have about the approach that I took for other aspects of the program.
  13. Nedelman

    The shading of PS2 game okami

    I have this game. The characters use cell shading but the environment uses a different technique, best described by example... Imagine you have a box that you want to draw. What they do is they first draw the "black border" version of the box by expanding the box outward along its vertex normals, and reversing the culling so that only backfaces are drawn. The expanded box is then drawn with just a solid black color. After that, the box is drawn normally using cartoony looking textures. This produces an imperfect looking outline, but it's good enough for games. If you really get up close and move the camera around, you can clearly see the object doesn't have a real outline, and that it's a black "shell" drawn in the way I have just described. Still, the technique is fast and easy to implement.
  14. Nedelman

    Water splashes on screen

    And just to elaborate on what WilyCoder said, you could achieve the water distortion effect (or any other distortion effect) by reading from a normal map that defines the shape of the distortion and using the x/y coordinates as an offset from where you would normally read from the buffer. You can scale this offset to make the effect more or less distorted.
  15. I'd say what you're attempting to achieve is a bit of a problem with a conventional 2D graphics engine where you have some bitmaps that you draw into a back buffer with a simple copy or blend. If you wanted to do something really neat, you could recode your engine to use OpenGL (since you're using SDL and probably going for portability) and then pass your rendering through some custom fragment shaders. Then you could achieve pretty much any color shifting effect you could think of. It's quite a bit more complex than your usual 2D engine, but if the effect is absolutely essential then it's worth looking into.
  • 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!