Jump to content

Possibility to set WorldModel double-sided


DRW

Recommended Posts

Hi everyone,

After replacing some original models, we found these are not double-sided, which is something we need. Is there any way to retrieve world models and double-side them?

I can only see restoreWorldModel and removeWorldModel exist, and I can't find a way to get all world models using getElementsByType or others.

Thank you in advance.

Link to comment

But I suppose "WorldModels" are not "Objects", also I don't see any function that retrieves WorldModels, so how can I specify I want an original building double-sided if it's not an element per se?

16 minutes ago, Tut said:

Unless you need to enable doublesided across hundreds of models, I would probably just do some basic scripting using setElementDoubleSided function

EDIT: We can set them double-sided in 3ds max, we noticed. Still if there's something I didn't notice and these world models are actually possible to double-side please tell me!

Edited by DRW
Link to comment
  • Administrators

Objects mapped using createObject are world objects and doublesided option can then be enabled when defined as an Element.

It's true that you can work around backface culling by duplicating and flipping polygons in the 3D model, however bear in mind this will add more file size.

Unfortunately I'm not a scripter but hopefully someone will tune in and get you a better response soon.

  • Like 1
Link to comment
34 minutes ago, DRW said:

EDIT: We can set them double-sided in 3ds max, we noticed. Still if there's something I didn't notice and these world models are actually possible to double-side please tell me!

As Tut has suggested, setting them double-sided in 3DS Max can only result in two outcomes:

  • the triangles are doubled, each one for each facing side, causing a massive increase in filesize
  • the function does nothing at all because there it fails to set a backface culling option that does not exist within RenderWare model data

Inside RenderWare the culling mode is defined as "render state" thus GTA SA has these settings defined within its own map files. Unfortunately MTA does not provide functions to modify rendering properties of original map objects. Feel free to suggest such a feature on the official MTA GitHub if you really need it.

MTA would not be MTA if there'd not be a workaround, though. Did you know that you can modify DX9 render states using FX shaders? Consider the dxCreateShader and engineApplyShaderToWorldTexture functions. I find this a very strange work-around though and you might be better off requesting direct access to map rendering properties instead.

Link to comment

You can't control "WorldModel" as element, but you can remove it and create an object in its place using createObject. Such solution looks clean enough to me, although a little more than that may be needed if there are low detail objects involved.

Edited by CrystalMV
Link to comment
20 minutes ago, The_GTA said:

As Tut has suggested, setting them double-sided in 3DS Max can only result in two outcomes:

  • the triangles are doubled, each one for each facing side, causing a massive increase in filesize
  • the function does nothing at all because there it fails to set a backface culling option that does not exist within RenderWare model data

Inside RenderWare the culling mode is defined as "render state" thus GTA SA has these settings defined within its own map files. Unfortunately MTA does not provide functions to modify rendering properties of original map objects. Feel free to suggest such a feature on the official MTA GitHub if you really need it.

MTA would not be MTA if there'd not be a workaround, though. Did you know that you can modify DX9 render states using FX shaders? Consider the dxCreateShader and engineApplyShaderToWorldTexture functions. I find this a very strange work-around though and you might be better off requesting direct access to map rendering properties instead.

This guy knows! 
This is very useful, I will suggest it, thank you. For now, I might have to fight the constant fear of learning HLSL and try doing that haha

 

10 minutes ago, CrystalMV said:

You can't control "WorldModel" as element, but you can remove it and create an object in its place using createObject. Such solution looks clean enough to me, although a little more than that may be needed if there are low detail objects involved.

That’s what I thought too, but didn’t have a very good experience with custom mapping and draw distances, and some “fixes” can affect performance greatly when thinking about scalability.

By the way, love your scripts!

  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...