-
-
Notifications
You must be signed in to change notification settings - Fork 496
Modify dxDraw(Material)Primitive to use same queue as other dxDraw functions #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depth-buffering is not required for 2D draws, so D3DRS_ZENABLE should be set to D3DZB_FALSE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about stuff like this: https://www.youtube.com/watch?v=CbJerQJBM0M where 2D images, or in this case primitives are placed in 3D world using shaders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, the 2D drawing functions draw in front of the final world render (The video shows the logo always in front of the car). So the depth buffer should be
disabled by default.
For drawing primitives in the 3D world, we could add dxDrawPrimitive3D (similar to dxDrawLine3D)
@CrosRoad95
CrosRoad95
Sep 26, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no we could, we must add 3d version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, disabled the depth buffering for material primitives :)
ghost
commented
Sep 23, 2018
You did a very great job with refactoring code. Looks much better.
Thank you!
Uh oh!
There was an error while loading. Please reload this page.
This pull requests is my suggestion of fixing #434.
Instead of using separate queues for primitives, they are now processed along with other dxDraws.
I had some problems with not being able to use smart pointers, due to the fact that draw queue items are stored as union, and they ain't that happy with unique/shared_ptr's. I would be glad if someone with more c++ experience looked over the code to confirm that it's the correct way of solving it.
There's a simple screenshot showing that the order is properly processed (rectangle > primitive >primitiveMaterial > rectangle):
image
This pull request also includes a bit of code cleanup for primitive batchers, as well as CLuaDrawingDefs.cpp primitive functions.