Sign in to follow this  
Tut

Using alpha in 3D models

Recommended Posts

Introduction

3D models using alpha transparency (or known as alpha; opacity; transparency) can at many times be glitchy and not render correctly. In the following guide, common uses and step by step methods will be shown.
The guide assumes the user is familiar with 3ds Max and knows how to export models with their textures to test on MTA.


TOC

  • Identifying the issues with alpha transparency in MTA
  • How to properly model glass that renders anything behind it (but water)
  • Modeling gradient alpha at the expense of extra geometry

Identifying the issues with alpha transparency in MTA

Understanding how MTA renders objects behind alpha, reading FAQ #8 on this topic is necessary. In many cases 3D modelers has done an oopsie by assigning alpha material an ID that's lower in hierarchy by other diffuse materials - thus renders the alpha before opaque materials, causing glitches. 
It is also worth noting that MTA natively does not have any support for custom .ide and .ipl files which contain crucial information for models, including "secondary alpha transparency flag". This flag (property) is required for semi-transparent textures to properly render what's behind them.
Window glass is suffering from the lack of model settings available. Thus the only way to draw glass in MTA is either using no bitmap for the glass material, or using a simple 4x4 bitmap that has a flat color with transparency, in other words a simple "fill color".

 

How to properly model glass that renders anything behind it (but water)

One may want to use transparent glass for their custom model but haven't had any luck. Fortunately there are very simple ways of producing glass-like models.

unknown.png

  1. Give the window frame a texture of its own.
  2. Attach the window glass to the frame if not done already.
  3. Give the window glass a new material which has opacity set to 35/100. Do not give it any bitmap/texture.
  4. Make sure that the glass material ID is higher than any other material in the model (follow #8 on this topic).
  5. Model now contains glass and can be exported to MTA.
  6. On MTA DFF replacement script, alphaTransparency must be enabled.
  7. Enjoy!

For troubleshooting, window above is available for download here. (by Tut)

 

Modeling gradient alpha at the expense of extra geometry

Due to MTA not supporting 2nd alpha property in models, the only way to replicate gradients e.g for lamp lights, neon etc., one must add 'steps' of alpha where the opacity decreases per step of geometry, as seen below.

unknown.png

Note that the third sample is mirrored top-bottom giving it a gradient look. Whereas the second has 20 triangles, the third was made with 100 segments and then optimised. The third sample has around 19 steps of alpha meaning 19 materials and climbs from an opacity level of 100 to 81.

gradient19step.png

  • Like 3
  • Thanks 1

Share this post


Link to post
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.