MTA:Eir/functions/isWorldDualAlphaRenderingEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
Line 26: Line 26:


-- Somewhere along the lines:
-- Somewhere along the lines:
triggerEvent( "onClientReady" );
triggerEvent( "onClientReady", root );
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Latest revision as of 09:41, 11 December 2013

This function returns whether world dual alpha rendering is enabled. If enabled, first all opaque pixels of entities are rendered and then the alpha pixels, depending on whether they are closer to the screen or not. Otherwise the original rendering method is used which does not use two-pass depth layer rendering.

By enabling world dual alpha rendering, rendering artifacts related to alpha such as seeing through solid surfaces are avoided. By default, it is disabled.

Syntax

bool isWorldDualAlphaRenderingEnabled ()

Returns

Returns true if world dual alpha rendering is enabled, false otherwise.

Example

Click to collapse [-]
Client

This snippet notifies the user upon join whether this server wants to have alpha issues or not.

addEvent( "onClientReady", true );
addEventHandler( "onClientReady", root,
    function()
        if not ( isWorldDualAlphaRenderingEnabled() ) then
            outputChatBox( "This server may have alpha issues." );
        end
    end
);

-- Somewhere along the lines:
triggerEvent( "onClientReady", root );