Author Topic: Draw graphic over 3D objects?  (Read 1787 times)

0 Members and 1 Guest are viewing this topic.

Offline Kiloku

  • 27
  • Buzzbuzz!
    • Minecraft
Draw graphic over 3D objects?
I'm nearly certain this is possible, because I've seen it done before, but I couldn't figure out how.

I have a script where I use both gr.drawRectangle and gr.drawCircle. However, whenever they overlap an object in the game world, they get occluded by the object. 

How do I set them to draw on top of the 3D objects? Even better, if I can set a distance so that they still get hidden by objects close to the camera, that'd be perfect.
Potato!

 

Offline m!m

  • 211
Re: Draw graphic over 3D objects?
Can you post a screenshot of the issue you are having? From your description it sounds like you are drawing with depth testing enabled but that is explicitly disabled for the 2D draw operations.

Also, explicitly setting a depth is not something that is possible with those functions. They will always draw on top of every thing that is behind the drawn to area.

 

Offline Kiloku

  • 27
  • Buzzbuzz!
    • Minecraft
Re: Draw graphic over 3D objects?
I figured it out just as I opened the script to set "filled" to true with the intent of making it more visible for the screenshot. I was calling it on $On Object Render, when I should have been using $On Frame.

With $On Object Render:


With $On Frame:
Potato!

  

Offline m!m

  • 211
Re: Draw graphic over 3D objects?
Yes, On Object Render is a very specific hook. On Frame is the correct hook to render 2D graphics.