Re: 2D overlay on top of 3D

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I prefer you draw the GUI _after_ the 3D scene. This way you can acheive
nice transparency effects in your GUI without trouble. It might be required
that you clear the z-buffer before drawing the GUI. This depends on your
GUI's rendering actually. A complex 3D GUI with overlapping parts might
require z-testing, thus, you'd better clear the z-buffer for it before you
start rendering the GUI.
2D and simple 3D GUIs generally don't need z-testing in the first place, so
just disable z-writes and z-tests...
Oh, and don't forget ID3DXSprite... :)


--
Wessam Bahnassi
Microsoft DirectX MVP,
Lead Programmer
In|Framez
--
In|Structurez Arabic Gamedev Community
www.instructurez.com


<nospam@xxxxxxxxxx> wrote in message news:du0ui902u0q@xxxxxxxxxxxxxxxxxxxx
Hello,

I'm writing a graphical role playing game. Right now, I have a nice 3D
view of my environment, but now it's time to add a decorative overlay to
the interface. I need to draw borders around the sides of the screen,
buttons, character portraits, an automap, perhaps a compass, etc.

I can think of a couple of ways of doing this. My first approach would be
after all of the 3D objects are draw, to clear the depth buffer and then
draw the 2D overlay on top. My 2D overlay would simply be a flat mesh with
the center portion cut out.

Does this sound like a valid approach? Do I need to clear the depth buffer
before drawing the overlay? I would think it would be necessary to prevent
any 3D objects from poking through the overlay.

It seems to me an alternative (and possibly higher performance) design
would be to only draw the 2D overlay only once, and then draw the 3D
portion of the scene using clipping, but that sounds like a much more
complex approach.

Thanks...

-----------------------------------------------------------
Posted using Android Newsgroup Downloader:
.... http://www.sb-software.com/android
-----------------------------------------------------------


.



Relevant Pages

  • Re: A GUI toolkit for Python that is NOT x-windows dependent
    ... >being able to draw menus). ... >so it needs to have an easy to follow GUI interface. ... All you need on the client side is the X server, and all the X server does ... If your terminals are in a very narrow grey zone where X is still too big ...
    (comp.lang.python)
  • Is stencil what I want?
    ... all the pixels that weren't drawn into. ... want to draw the overlay first and count on the geometry to obscure it. ... In order to get the overlay to draw only on those pixels that haven't ...
    (comp.graphics.api.opengl)
  • Re: Omaha BAHH
    ... Here if the nut low + gutterball straight draw folds, ... in a 3 way pot (2.07% overlay). ... No matter what we do here, we are getting a lower and lower overlay each ... missed are equally likely to have come along preflop. ...
    (rec.gambling.poker)
  • Failed to GetDC for overlays surface
    ... More specifically I want to draw some lines and also enlange a piece of the screen and draw to my overlay. ... Initializes DirectX and creates a overlay surface ... DebugLoc:= $1; ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: How to draw to the screen not the form?
    ... this on Vista with Aero enabled, dragging those rectangles around ... on XP (or Vista with the standard, ... draw my rectangles on the overlay. ...
    (microsoft.public.dotnet.framework.drawing)