There is a period of time when developing a new renderer and you decide to make the move from 2D to 3D. You submit your 3D draws. Nothing. Black screen. Make a change. See a flicker. Keep changing things. Eventually you shake it enough to start seeing something.
-
-
Part of what can make this dark night easier to venture through are the right tools. I've done this a few times now and here are a few things I use to help me get to the dawn. These are in no particular order.
Näytä tämä ketju -
1. Draw reference stuff first. I like axis lines. They reach up to effectively infinity in every direction, give you a frame of reference for where you expect future draws to be on screen, and give you a sense of place. A floor grid goes the next step.
Näytä tämä ketju -
2. Give yourself camera controls. WASD and mouse-look. Don't bother with acceleration or anything. make it absurdly stupid. Being able to look around is incredibly helpful in finding the draws in the void.
Näytä tämä ketju -
3. If controls aren't in the cards, a rotating camera with a fairly wide fov works okay. The most important thing is to get full scene coverage. Position the camera away from the origin too, so you know your cam isn't inside your draws.
Näytä tämä ketju -
4. Use a debugger. Visual Studio's graphics debugger is very usable for D3D, and stepping through shader code is a huge feature. RenderDoc is also good. Hardware vendors also have tools and YMMV with them. Always good to get versed in several.
Näytä tämä ketju -
5. Disable backface culling. Disable depth testing. Disable stencil testing. Remove absolutely anything that would prevent pixels from being drawn on screen. Once you can see it, you can begin bringing those in one at a time.
Näytä tämä ketju -
6. When drawing your first object, make it a tetrahedron. The verts/indices are easy to generate. They can be figured out in your head and hardcoded without too much trouble. If you draw a quad, you might look at it on side and not see it. A cube works too I guess.
Näytä tämä ketju
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.