Skip to content

Feature: dxDrawModel3d #3172

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

Merged
merged 9 commits into from
Oct 14, 2023
Merged

Feature: dxDrawModel3d #3172

merged 9 commits into from
Oct 14, 2023

Conversation

CrosRoad95
Copy link

This pull request adds function to draw arbitrary model in simillar fasion as other dxDraw* functions

syntax: bool dxDrawModel3d(model, position, rotation, optional scale) ( draw in onClientRender/onClientPreRender loop )

You can draw as many objects as you want, it has no limits both amount of models and draw distance.
Rendered models has no collision, they look exactly the same as objects created using "createObject" ( possibly transparency will be an issue )
use cases:

  1. draw vegetation
  2. draw ped/vehicles visual accessories
  3. draw miscellaneous objects on ground as an items player can pick up

example: dxDrawModel3d(3276, -719.64984, 951.26685, 12.13281, 0, 0,90) - as you can see, it look 1:1 as createObject
image
image

No limits:
image
image

sebajura1234@gmail.com added 3 commits July 6, 2023 16:12
(cherry picked from commit 279c8ac549fd58168e7968b056338111edd9ff79)
@Einheit-101
Copy link

This is nice. I guess you trade performance for free object streaming slots?

@CrosRoad95
Copy link
Author

you can call it that

@Pirulax
Copy link
Contributor

Pirulax commented Sep 8, 2023

Eh I'd argue this is faster than having objects, as they have a lot of overhead.
These don't have collisions either, so there's that.

@lopezloo lopezloo added the enhancement New feature or request label Sep 19, 2023
@CrosRoad95 CrosRoad95 marked this pull request as ready for review October 10, 2023 04:54
@Lpsd Lpsd merged commit f886a35 into multitheftauto:master Oct 14, 2023
MTABot pushed a commit that referenced this pull request Oct 14, 2023
f886a35 Feature: dxDrawModel3d (#3172)
97e6c7b Update client en_US pot
@CrosRoad95 CrosRoad95 deleted the feature/dxDrawModel branch October 14, 2023 06:16
@tederis
Copy link
Member

tederis commented Oct 14, 2023

There is a lot of commented out lines. I doubt that it should be merged in this "dirty" condition. But now it is too late to worry anyway.

Lpsd added a commit to Lpsd/mtasa-blue that referenced this pull request Oct 14, 2023
@Lpsd
Copy link
Member

Lpsd commented Oct 14, 2023

It's never too late to worry. #3210

@onikyannn
Copy link
Contributor

Object is rendered at zero coordinates in any dimension other than 0.

@Xenius97
Copy link
Contributor

What about dxDrawModel2D?
Non shadered version of https://wiki.multitheftauto.com/wiki/Resource:Object_preview

@tederis
Copy link
Member

tederis commented Oct 16, 2023

What about dxDrawModel2D? Non shadered version of https://wiki.multitheftauto.com/wiki/Resource:Object_preview

It will be enough just to call dxDrawModel3d inside a render target.

@PlatinMTA
Copy link
Contributor

It will be enough just to call dxDrawModel3d inside a render target.

wiki says no rendertarget support

@tederis
Copy link
Member

tederis commented Oct 16, 2023

It will be enough just to call dxDrawModel3d inside a render target.

wiki says no rendertarget support

Of course there is no RT support now. But it can be easily added.

Lpsd added a commit to Lpsd/mtasa-blue that referenced this pull request Oct 16, 2023
Dutchman101 pushed a commit that referenced this pull request Oct 16, 2023
MTABot pushed a commit that referenced this pull request Oct 16, 2023
@Dutchman101
Copy link
Member

Reverted in 5b44a09 as a result of dev discord feedback:

TEDERIs — Today at 2:24 PM
I respect the efforts of CrosRoad95. But I think #3172 (dxDrawModel3d feature) should be revoked. It's very buggy now, has a lot of internal problems and even cause crashes. It renders an object randomly (due to the nature of CClientGame::GameEntityRenderHandler) which leads to an unpredictable appearience(and can even disappear). Even after #3210 it contains unused code(see HOOKPOS_CRenderer__RenderFadingInEntities_MID). And it can crash the game(see model handling in DxDrawModel3D). This is nice PR, but it still has a long way to go before it is ready for production use

@StrixG StrixG added this to the 1.6.1 milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.