Jump to content

Possibility to set WorldModel double-sided


DRW

Recommended Posts

Posted

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.

tJ5zeFm.gif

Proud owner and developer of ZNEXT: Aftermath.

Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience.

Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. 

Español, Pусский, Türk, عربى, Polski, Português

IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB

  • Moderators
Posted

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

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime - Lao Tzu

Posted (edited)

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

tJ5zeFm.gif

Proud owner and developer of ZNEXT: Aftermath.

Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience.

Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. 

Español, Pусский, Türk, عربى, Polski, Português

IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB

  • Moderators
Posted

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

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime - Lao Tzu

Posted
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.

8MF74XW.pngZr2Ufps.png

Developer of Magic.TXD • Developer of MTA:Eir, Eir Lua • Company owner of EirDev

Posted (edited)

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

-

Posted
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

tJ5zeFm.gif

Proud owner and developer of ZNEXT: Aftermath.

Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience.

Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. 

Español, Pусский, Türk, عربى, Polski, Português

IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB

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...