<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Renard712</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Renard712"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Renard712"/>
	<updated>2026-04-25T03:32:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45783</id>
		<title>Resource:Object preview</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45783"/>
		<updated>2015-08-22T22:57:53Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets you create an object that will be drawn on the screen &lt;br /&gt;
provided size and position - just like when drawing an image. This way it is easy to&lt;br /&gt;
create object preview on GUI (supports drawing in a separate render target).&lt;br /&gt;
Works with peds, world objects and vehicles.&lt;br /&gt;
&lt;br /&gt;
== Overview == &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported client-side functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Creates the preview for provided world,ped or vehicle element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:createObjectPreview(element object, float rotX rotY, rotZ, projPosX, projPosY, projSizeX, projSizeY [, bool isRelative = false, postGUI = false, isSecRT = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float rotX, rotY, rotZ:''' Object rotation in camera space.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
*'''bool postGUI:''' Should the object be drawn before or after MTA GUI elements.&lt;br /&gt;
*'''isSecRT:''' Should the object be drawin to second render target.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Destroys previously created preview - without destroying the object it was applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:destroyObjectPreview(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====saveRTToFile====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Save render target to png file. (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:saveRTToFile(element objectPreviewElement, string path)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''string path:''' An exact client resource path the file is to be saved to.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise. It saves the image in client resource path.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotation(element objectPreviewElement,float rotX, rotX, rotZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float rotX, rotX, rotZ:''' Object rotation in camera space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setProjection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object on screen position and size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setProjection(element objectPreviewElement, float projPosY, projSizeX, projSizeY [, bool isRelative = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setAlpha====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object alpha transparency.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setAlpha(element objectPreviewElement,int alpha)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''int alpha:''' Object alpha (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====getRenderTarget====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function returns a renderTarget (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:getRenderTarget()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns render target if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDistanceSpread====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the difference between object to camera distance set by MTA and that set by shader.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setDistanceSpread(element objectPreviewElement,float zSpread)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float zSpread:''' Object Distance spread.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setPositionOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object position to camera offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setPositionOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object position to camera offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotationOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation centre offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotationOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object rotation centre offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize ()&lt;br /&gt;
local myObject,myElement, guiWindow = nil, nil, nil&lt;br /&gt;
local myRotation = {0,0,0}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	local x1, y1, z1 = getCameraMatrix()&lt;br /&gt;
	myElement = createVehicle (429, x1, y1, z1)&lt;br /&gt;
&lt;br /&gt;
	myObject = exports.objectPreview:createObjectPreview(myElement,0, 0, 0, 0.5, 0.5, 1, 1, true, true, true)&lt;br /&gt;
	guiWindow = guiCreateWindow((scx/2)-100,(scy/2) - 100,200,200, &amp;quot;Test area&amp;quot;, false, false)&lt;br /&gt;
	guiSetAlpha(guiWindow, 0.05 + 0.2)&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)	&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY,true,true)&lt;br /&gt;
	exports.object_preview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3])&lt;br /&gt;
	&lt;br /&gt;
	bindKey ( &amp;quot;num_4&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_6&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_add&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_sub&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_2&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_8&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, function() exports.object_preview:saveRTToFile(myObject,math.random(100)..&amp;quot;.png&amp;quot;) end)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if not myElement or not myObject then return end&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true)&lt;br /&gt;
end, true, &amp;quot;high&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	exports.object_preview:destroyObjectPreview(myObject)&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a vehicle, applies object preview and scales it using dimensions of a window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the object_preview resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=11836 Object Preview resource on community]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45584</id>
		<title>Resource:Object preview</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45584"/>
		<updated>2015-07-30T10:54:29Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets you create an object that will be drawn on the screen &lt;br /&gt;
provided size and position - just like when drawing an image. This way it is easy to&lt;br /&gt;
create object preview on GUI (supports drawing in a separate render target).&lt;br /&gt;
Works with peds, world objects and vehicles.&lt;br /&gt;
&lt;br /&gt;
== Overview == &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported client-side functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Creates the preview for provided world,ped or vehicle element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:createObjectPreview(element object, float rotX rotY, rotZ, projPosX, projPosY, projSizeX, projSizeY [, bool isRelative = false, postGUI = false, isSecRT = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float rotX, rotY, rotZ:''' Object rotation in camera space.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
*'''bool postGUI:''' Should the object be drawn before or after MTA GUI elements.&lt;br /&gt;
*'''isSecRT:''' Should the object be drawin to second render target.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Destroys previously created preview - without destroying the object it was applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:destroyObjectPreview(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====saveRTToFile====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Save render target to png file. (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:saveRTToFile(element objectPreviewElement, string path)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''string path:''' An exact client resource path the file is to be saved to.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise. It saves the image in client resource path.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotation(element objectPreviewElement,float rotX, rotX, rotZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float rotX, rotX, rotZ:''' Object rotation in camera space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setProjection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object on screen position and size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setProjection(element objectPreviewElement, float projPosY, projSizeX, projSizeY [, bool isRelative = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setAlpha====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object alpha transparency.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setAlpha(element objectPreviewElement,int alpha)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''int alpha:''' Object alpha (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====getRenderTarget====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function returns a renderTarget (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:getRenderTarget(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns render target if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDistanceSpread====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the difference between object to camera distance set by MTA and that set by shader.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setDistanceSpread(element objectPreviewElement,float zSpread)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float zSpread:''' Object Distance spread.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setPositionOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object position to camera offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setPositionOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object position to camera offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotationOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation centre offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotationOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object rotation centre offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize ()&lt;br /&gt;
local myObject,myElement, guiWindow = nil, nil, nil&lt;br /&gt;
local myRotation = {0,0,0}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	local x1, y1, z1 = getCameraMatrix()&lt;br /&gt;
	myElement = createVehicle (429, x1, y1, z1)&lt;br /&gt;
&lt;br /&gt;
	myObject = exports.objectPreview:createObjectPreview(myElement,0, 0, 0, 0.5, 0.5, 1, 1, true, true, true)&lt;br /&gt;
	guiWindow = guiCreateWindow((scx/2)-100,(scy/2) - 100,200,200, &amp;quot;Test area&amp;quot;, false, false)&lt;br /&gt;
	guiSetAlpha(guiWindow, 0.05 + 0.2)&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)	&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY,true,true)&lt;br /&gt;
	exports.object_preview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3])&lt;br /&gt;
	&lt;br /&gt;
	bindKey ( &amp;quot;num_4&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_6&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_add&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_sub&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_2&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_8&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, function() exports.object_preview:saveRTToFile(myObject,math.random(100)..&amp;quot;.png&amp;quot;) end)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if not myElement or not myObject then return end&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true)&lt;br /&gt;
end, true, &amp;quot;high&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	exports.object_preview:destroyObjectPreview(myObject)&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a vehicle, applies object preview and scales it using dimensions of a window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the object_preview resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=11836 Object Preview resource on community]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=45583</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=45583"/>
		<updated>2015-07-29T21:21:34Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. Billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;billboardElement exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns billboardElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardDepthBias====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
On createBillboard the depthBias is set properly (0-1). You can however set other value depending on your needs. To see the results you'll need to set enableDepthBiasScale to true.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardDepthBias(element billboardElement,float depthBiasValue)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float depthBiasValue:''' depthBias value.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====enableDepthBiasScale====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Standard depthBias for GTASA coronas is about 1 unit, despite the corona scale. This function elables depthBias scaling.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:enableDepthBiasScale(bool isDepthScaleEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isDepthScaleEnabled:''' Enable/disable depthBias scaling.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_billboards:createBillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createBillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setBillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/vvsvua1kmrpjxaz/custom_billboards_test.zip?dl=0 Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=45582</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=45582"/>
		<updated>2015-07-29T21:19:06Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createSpotLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShadersLayered====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the main shader effects be created in a separate render pass ? As default only the vehicle effect is layered.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShadersLayered(bool isWorld, isVeh, isPed)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isWorld, isVeh, isPed:''' Should the shader effects be created in a separate render pass.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1, float normalStrength.z = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xyz:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light. NOTE: Forcing the effects on or using any other lights is required for directional light to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45581</id>
		<title>Resource:Blur box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45581"/>
		<updated>2015-07-29T21:15:21Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create simple gaussian blur boxes onClientRender.&lt;br /&gt;
Using that - You can make your game GUI a bit more fancy.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage blur boxes. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a blur box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:createBlurBox(float posX,posY,sizeX,sizeY,int colorR,colorG,colorB,colorA,postGUI)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the box.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:destroyBlurBox(element blurBoxElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxEnabled====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function enables or disables a created blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxEnabled(element blurBoxElement, bool isEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''bool isEnabled:''' Enable/Disable the blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxPosition(element blurBoxElement,float posX,posY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxSize(element blurBoxElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float sizeX,sizeY:''' Size of the blur box.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxColor(element blurBoxElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurIntensity====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur amount for all the blur boxes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurIntensity(float blurFactor)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float blurFactor:''' Set blur amount for all the blur boxes. (default 0.6)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setScreenResolutionMultiplier====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets screen relative resolution multiplier for the screenSource&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setScreenResolutionMultiplier(element blurBoxElement, float x,y)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blurBox element.&lt;br /&gt;
*'''float x,y:''' Set sampled screen relative resolution multiplier (0-1)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize()&lt;br /&gt;
local guiWindowElement = nil&lt;br /&gt;
local blurBoxElement = nil&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientPreRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
		if guiWindowElement and blurBoxElement then&lt;br /&gt;
			local xPos, yPos = guiGetPosition ( guiWindowElement , false )&lt;br /&gt;
			local xSize, ySize = guiGetSize ( guiWindowElement , false )&lt;br /&gt;
			exports.blur_box:setBlurBoxPosition( blurBoxElement, xPos, yPos )&lt;br /&gt;
			exports.blur_box:setBlurBoxSize( blurBoxElement, xSize, ySize )		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
,true ,&amp;quot;high-3&amp;quot; )	&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	guiWindowElement = guiCreateWindow ( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, &amp;quot;BlurBox test&amp;quot;, false )&lt;br /&gt;
	guiWindowSetMovable ( guiWindowElement, true )&lt;br /&gt;
	guiWindowSetSizable ( guiWindowElement, true )&lt;br /&gt;
	guiSetAlpha ( guiWindowElement, 0.3 )&lt;br /&gt;
	blurBoxElement = exports.blur_box:createBlurBox( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, 255, 255, 255, 255, false )&lt;br /&gt;
	--exports.blur_box:setBlurBoxColor( blurBoxElement, 255, 100, 100, 255)&lt;br /&gt;
	exports.blur_box:setScreenResolutionMultiplier( 0.5, 0.5 )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	destroyElement( guiWindowElement )&lt;br /&gt;
	blurBoxElement = not exports.blur_box:destroyBlurBox( blurBoxElement )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a blur box and attaches it to a created window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the blur_box resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10163 Community resource]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/db13n4l62k21x19/blurBox_test.zip?dl=0 Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45580</id>
		<title>Resource:Blur box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45580"/>
		<updated>2015-07-29T21:14:14Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create simple gaussian blur boxes onClientRender.&lt;br /&gt;
Using that - You can make your game GUI a bit more fancy.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage blur boxes. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a blur box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:createBlurBox(float posX,posY,sizeX,sizeY,int colorR,colorG,colorB,colorA,postGUI)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the box.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:destroyBlurBox(element blurBoxElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxEnabled====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function enables or disables a created blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxEnabled(element blurBoxElement, bool isEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''bool isEnabled:''' Enable/Disable the blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxPosition(element blurBoxElement,float posX,posY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxSize(element blurBoxElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float sizeX,sizeY:''' Size of the blur box.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxColor(element blurBoxElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurIntensity====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur amount for all the blur boxes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurIntensity(float blurFactor)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float blurFactor:''' Set blur amount for all the blur boxes. (default 0.6)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setScreenResolutionMultiplier====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets screen relative resolution multiplier for the screenSource&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setScreenResolutionMultiplier(element blurBoxElement, float x,y)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blurBox element.&lt;br /&gt;
*'''float x,y:''' Set sampled screen relative resolution multiplier (0-1)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize()&lt;br /&gt;
local guiWindowElement = nil&lt;br /&gt;
local blurBoxElement = nil&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientHUDRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
		if guiWindowElement and blurBoxElement then&lt;br /&gt;
			local xPos, yPos = guiGetPosition ( guiWindowElement , false )&lt;br /&gt;
			local xSize, ySize = guiGetSize ( guiWindowElement , false )&lt;br /&gt;
			exports.blur_box:setBlurBoxPosition( blurBoxElement, xPos, yPos )&lt;br /&gt;
			exports.blur_box:setBlurBoxSize( blurBoxElement, xSize, ySize )		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
,true ,&amp;quot;high-3&amp;quot; )	&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	guiWindowElement = guiCreateWindow ( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, &amp;quot;BlurBox test&amp;quot;, false )&lt;br /&gt;
	guiWindowSetMovable ( guiWindowElement, true )&lt;br /&gt;
	guiWindowSetSizable ( guiWindowElement, true )&lt;br /&gt;
	guiSetAlpha ( guiWindowElement, 0.3 )&lt;br /&gt;
	blurBoxElement = exports.blur_box:createBlurBox( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, 255, 255, 255, 255, false )&lt;br /&gt;
	--exports.blur_box:setBlurBoxColor( blurBoxElement, 255, 100, 100, 255)&lt;br /&gt;
	exports.blur_box:setScreenResolutionMultiplier( 0.5, 0.5 )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	destroyElement( guiWindowElement )&lt;br /&gt;
	blurBoxElement = not exports.blur_box:destroyBlurBox( blurBoxElement )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a blur box and attaches it to a created window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the blur_box resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10163 Community resource]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/db13n4l62k21x19/blurBox_test.zip?dl=0 Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45579</id>
		<title>Resource:Blur box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45579"/>
		<updated>2015-07-29T21:13:05Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create simple gaussian blur boxes onClientRender.&lt;br /&gt;
Using that - You can make your game GUI a bit more fancy.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage blur boxes. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a blur box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:createBlurBox(float posX,posY,sizeX,sizeY,int colorR,colorG,colorB,colorA,postGUI)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the box.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:destroyBlurBox(element blurBoxElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxEnabled====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function enables or disables a created blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxEnabled(element blurBoxElement, bool isEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''bool isEnabled:''' Enable/Disable the blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxPosition(element blurBoxElement,float posX,posY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxSize(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float sizeX,sizeY:''' Size of the blur box.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurIntensity====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur amount for all the blur boxes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurIntensity(float blurFactor)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float blurFactor:''' Set blur amount for all the blur boxes. (default 0.6)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setScreenResolutionMultiplier====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets screen relative resolution multiplier for the screenSource&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setScreenResolutionMultiplier(element blurBoxElement, float x,y)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blurBox element.&lt;br /&gt;
*'''float x,y:''' Set sampled screen relative resolution multiplier (0-1)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize()&lt;br /&gt;
local guiWindowElement = nil&lt;br /&gt;
local blurBoxElement = nil&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientHUDRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
		if guiWindowElement and blurBoxElement then&lt;br /&gt;
			local xPos, yPos = guiGetPosition ( guiWindowElement , false )&lt;br /&gt;
			local xSize, ySize = guiGetSize ( guiWindowElement , false )&lt;br /&gt;
			exports.blur_box:setBlurBoxPosition( blurBoxElement, xPos, yPos )&lt;br /&gt;
			exports.blur_box:setBlurBoxSize( blurBoxElement, xSize, ySize )		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
,true ,&amp;quot;high-3&amp;quot; )	&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	guiWindowElement = guiCreateWindow ( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, &amp;quot;BlurBox test&amp;quot;, false )&lt;br /&gt;
	guiWindowSetMovable ( guiWindowElement, true )&lt;br /&gt;
	guiWindowSetSizable ( guiWindowElement, true )&lt;br /&gt;
	guiSetAlpha ( guiWindowElement, 0.3 )&lt;br /&gt;
	blurBoxElement = exports.blur_box:createBlurBox( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, 255, 255, 255, 255, false )&lt;br /&gt;
	--exports.blur_box:setBlurBoxColor( blurBoxElement, 255, 100, 100, 255)&lt;br /&gt;
	exports.blur_box:setScreenResolutionMultiplier( 0.5, 0.5 )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	destroyElement( guiWindowElement )&lt;br /&gt;
	blurBoxElement = not exports.blur_box:destroyBlurBox( blurBoxElement )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a blur box and attaches it to a created window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the blur_box resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10163 Community resource]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/db13n4l62k21x19/blurBox_test.zip?dl=0 Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45578</id>
		<title>Resource:Blur box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=45578"/>
		<updated>2015-07-29T21:12:44Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create simple gaussian blur boxes onClientRender.&lt;br /&gt;
Using that - You can make your game GUI a bit more fancy.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage blur boxes. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a blur box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:createBlurBox(float posX,posY,sizeX,sizeY,int colorR,colorG,colorB,colorA,postGUI)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the box.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:destroyBlurBox(element blurBoxElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxEnabled====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function enables or disables a created blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxEnabled(element blurBoxElement, bool isEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''bool isEnabled:''' Enable/Disable the blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxPosition(element blurBoxElement,float posX,posY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxSize(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float sizeX,sizeY:''' Size of the blur box.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurIntensity====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur amount for all the blur boxes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurIntensity(float blurFactor)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float blurFactor:''' Set blur amount for all the blur boxes. (default 0.6)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setScreenResolutionMultiplier====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets screen relative resolution multiplier for the screenSource&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setScreenResolutionMultiplier(element blurBoxElement, float x,y)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blurBox element.&lt;br /&gt;
*'''float x,y:''' Set sampled screen relative resolution multiplier (0-1)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize()&lt;br /&gt;
local guiWindowElement = nil&lt;br /&gt;
local blurBoxElement = nil&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
		if guiWindowElement and blurBoxElement then&lt;br /&gt;
			local xPos, yPos = guiGetPosition ( guiWindowElement , false )&lt;br /&gt;
			local xSize, ySize = guiGetSize ( guiWindowElement , false )&lt;br /&gt;
			exports.blur_box:setBlurBoxPosition( blurBoxElement, xPos, yPos )&lt;br /&gt;
			exports.blur_box:setBlurBoxSize( blurBoxElement, xSize, ySize )		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
,true ,&amp;quot;high-3&amp;quot; )	&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	guiWindowElement = guiCreateWindow ( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, &amp;quot;BlurBox test&amp;quot;, false )&lt;br /&gt;
	guiWindowSetMovable ( guiWindowElement, true )&lt;br /&gt;
	guiWindowSetSizable ( guiWindowElement, true )&lt;br /&gt;
	guiSetAlpha ( guiWindowElement, 0.3 )&lt;br /&gt;
	blurBoxElement = exports.blur_box:createBlurBox( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, 255, 255, 255, 255, false )&lt;br /&gt;
	--exports.blur_box:setBlurBoxColor( blurBoxElement, 255, 100, 100, 255)&lt;br /&gt;
	exports.blur_box:setScreenResolutionMultiplier( 0.5, 0.5 )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	destroyElement( guiWindowElement )&lt;br /&gt;
	blurBoxElement = not exports.blur_box:destroyBlurBox( blurBoxElement )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a blur box and attaches it to a created window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the blur_box resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10163 Community resource]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/db13n4l62k21x19/blurBox_test.zip?dl=0 Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45577</id>
		<title>Resource:Object preview</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45577"/>
		<updated>2015-07-29T21:07:30Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets you create an object that will be drawn on the screen &lt;br /&gt;
provided size and position - just like when drawing an image. This way it is easy to&lt;br /&gt;
create object preview on GUI (supports drawing in a separate render target).&lt;br /&gt;
Works with peds, world objects and vehicles.&lt;br /&gt;
&lt;br /&gt;
== Overview == &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported client-side functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Creates the preview for provided world,ped or vehicle element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:createObjectPreview(element object, float rotX rotY, rotZ, projPosX, projPosY, projSizeX, projSizeY [, bool isRelative = false, postGUI = false, isSecRT = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float rotX, rotY, rotZ:''' Object rotation in camera space.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
*'''isSecRT:''' Should drawing to second render target is enabled.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Destroys previously created preview - without destroying the object it was applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:destroyObjectPreview(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====saveRTToFile====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Save render target to png file. (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:saveRTToFile(element objectPreviewElement, string path)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''string path:''' An exact client resource path the file is to be saved to.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise. It saves the image in client resource path.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotation(element objectPreviewElement,float rotX, rotX, rotZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float rotX, rotX, rotZ:''' Object rotation in camera space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setProjection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object on screen position and size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setProjection(element objectPreviewElement, float projPosY, projSizeX, projSizeY [, bool isRelative = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setAlpha====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object alpha transparency.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setAlpha(element objectPreviewElement,int alpha)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''int alpha:''' Object alpha (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====getRenderTarget====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function returns a renderTarget (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:getRenderTarget(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns render target if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDistanceSpread====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the difference between object to camera distance set by MTA and that set by shader.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setDistanceSpread(element objectPreviewElement,float zSpread)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float zSpread:''' Object Distance spread.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setPositionOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object position to camera offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setPositionOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object position to camera offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotationOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation centre offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotationOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object rotation centre offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize ()&lt;br /&gt;
local myObject,myElement, guiWindow = nil, nil, nil&lt;br /&gt;
local myRotation = {0,0,0}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	local x1, y1, z1 = getCameraMatrix()&lt;br /&gt;
	myElement = createVehicle (429, x1, y1, z1)&lt;br /&gt;
&lt;br /&gt;
	myObject = 	exports.objectPreview:createObjectPreview(myElement,0, 0, 0, 0.5, 0.5, 1, 1, true, true)&lt;br /&gt;
	guiWindow = guiCreateWindow((scx/2)-100,(scy/2) - 100,200,200, &amp;quot;Test area&amp;quot;, false, false)&lt;br /&gt;
	guiSetAlpha(guiWindow, 0.05 + 0.2)&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)	&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY,true,true)&lt;br /&gt;
	exports.object_preview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3])&lt;br /&gt;
	&lt;br /&gt;
	bindKey ( &amp;quot;num_4&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_6&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_add&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_sub&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_2&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_8&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, function() exports.object_preview:saveRTToFile(myObject,math.random(100)..&amp;quot;.png&amp;quot;) end)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if not myElement or not myObject then return end&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true)&lt;br /&gt;
end, true, &amp;quot;high&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	exports.object_preview:destroyObjectPreview(myObject)&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a vehicle, applies object preview and scales it using dimensions of a window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the object_preview resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=11836 Community resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45576</id>
		<title>Resource:Object preview</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45576"/>
		<updated>2015-07-29T20:46:52Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets you create an object that will be drawn on the screen &lt;br /&gt;
provided size and position - just like when drawing an image. This way it is easy to&lt;br /&gt;
create object preview on GUI (supports drawing in a separate render target).&lt;br /&gt;
Works with peds, world objects and vehicles.&lt;br /&gt;
&lt;br /&gt;
== Overview == &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported client-side functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Creates the preview for provided world,ped or vehicle element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:createObjectPreview(element object, float rotX rotY, rotZ, projPosX, projPosY, projSizeX, projSizeY [, bool isRelative = false, postGUI = false, isSecRT = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float rotX, rotY, rotZ:''' Object rotation in camera space.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
*'''isSecRT:''' Should drawing to second render target is enabled.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Destroys previously created preview - without destroying the object it was applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:destroyObjectPreview(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====saveRTToFile====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Save render target to png file. (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:saveRTToFile(element objectPreviewElement, string path)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''string path:''' An exact client resource path the file is to be saved to.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise. It saves the image in client resource path.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotation(element objectPreviewElement,float rotX, rotX, rotZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float rotX, rotX, rotZ:''' Object rotation in camera space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setProjection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object on screen position and size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setProjection(element objectPreviewElement, float projPosY, projSizeX, projSizeY [, bool isRelative = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setAlpha====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object alpha transparency.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setAlpha(element objectPreviewElement,int alpha)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''int alpha:''' Object alpha (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====getRenderTarget====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function returns a renderTarget (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:getRenderTarget(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns render target if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDistanceSpread====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the difference between object to camera distance set by MTA and that set by shader.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setDistanceSpread(element objectPreviewElement,float zSpread)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float zSpread:''' Object Distance spread.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setPositionOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object position to camera offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setPositionOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object position to camera offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotationOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation centre offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotationOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object rotation centre offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize ()&lt;br /&gt;
local myObject,myElement, guiWindow = nil, nil, nil&lt;br /&gt;
local myRotation = {0,0,0}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	local x1, y1, z1 = getCameraMatrix()&lt;br /&gt;
	myElement = createVehicle (429, x1, y1, z1)&lt;br /&gt;
&lt;br /&gt;
	myObject = 	exports.objectPreview:createObjectPreview(myElement,0, 0, 0, 0.5, 0.5, 1, 1, true, true)&lt;br /&gt;
	guiWindow = guiCreateWindow((scx/2)-100,(scy/2) - 100,200,200, &amp;quot;Test area&amp;quot;, false, false)&lt;br /&gt;
	guiSetAlpha(guiWindow, 0.05 + 0.2)&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)	&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY,true,true)&lt;br /&gt;
	exports.object_preview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3])&lt;br /&gt;
	&lt;br /&gt;
	bindKey ( &amp;quot;num_4&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_6&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_add&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_sub&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_2&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_8&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, function() exports.object_preview:saveRTToFile(myObject,math.random(100)..&amp;quot;.png&amp;quot;) end)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if not myElement or not myObject then return end&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)&lt;br /&gt;
	exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true)&lt;br /&gt;
end, true, &amp;quot;high&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	exports.object_preview:destroyObjectPreview(myObject)&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a vehicle, applies object preview and scales it using dimensions of a window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the object_preview resource in meta.&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45575</id>
		<title>Resource:Object preview</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Object_preview&amp;diff=45575"/>
		<updated>2015-07-29T20:44:30Z</updated>

		<summary type="html">&lt;p&gt;Renard712: Created page with &amp;quot;{{Resource page}} This resource lets you create an object that will be drawn on the screen  provided size and position - just like when drawing an image. This way it is easy t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets you create an object that will be drawn on the screen &lt;br /&gt;
provided size and position - just like when drawing an image. This way it is easy to&lt;br /&gt;
create object preview on GUI (supports drawing in a separate render target).&lt;br /&gt;
Works with peds, world objects and vehicles.&lt;br /&gt;
&lt;br /&gt;
== Overview == &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported client-side functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Creates the preview for provided world,ped or vehicle element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:createObjectPreview(element object, float rotX rotY, rotZ, projPosX, projPosY, projSizeX, projSizeY [, bool isRelative = false, postGUI = false, isSecRT = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float rotX, rotY, rotZ:''' Object rotation in camera space.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
*'''isSecRT:''' Should drawing to second render target is enabled.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyObjectPreview====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Destroys previously created preview - without destroying the object it was applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:destroyObjectPreview(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====saveRTToFile====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Save render target to png file. (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:saveRTToFile(element objectPreviewElement, string path)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''string path:''' An exact client resource path the file is to be saved to.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise. It saves the image in client resource path.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotation(element objectPreviewElement,float rotX, rotX, rotZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float rotX, rotX, rotZ:''' Object rotation in camera space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setProjection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object on screen position and size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setProjection(element objectPreviewElement, float projPosY, projSizeX, projSizeY [, bool isRelative = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float projPosX, projPosY:''' Projector left corner on the screen.&lt;br /&gt;
*'''float projSizeX, projSizeY:''' Projector size.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isRelative:''' Are the projector parameters relative.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setAlpha====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object alpha transparency.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setAlpha(element objectPreviewElement,int alpha)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''int alpha:''' Object alpha (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====getRenderTarget====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function returns a renderTarget (Only when drawing to second render target is enabled)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:getRenderTarget(element objectPreviewElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns render target if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDistanceSpread====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the difference between object to camera distance set by MTA and that set by shader.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setDistanceSpread(element objectPreviewElement,float zSpread)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float zSpread:''' Object Distance spread.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setPositionOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object position to camera offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setPositionOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object position to camera offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setRotationOffsets====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets object rotation centre offsets (standard is 0,0,0)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.object_preview:setRotationOffsets(element objectPreviewElement,float posX, posX, posX)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element objectPreviewElement:''' A previously declared preview element.&lt;br /&gt;
*'''float posX, posX, posX:''' Object rotation centre offsets.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize ()&lt;br /&gt;
local myObject,myElement, guiWindow = nil, nil, nil&lt;br /&gt;
local myRotation = {0,0,0}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	local x1, y1, z1 = getCameraMatrix()&lt;br /&gt;
	myElement = createVehicle (429, x1, y1, z1)&lt;br /&gt;
&lt;br /&gt;
	myObject = 	exports.objectPreview:createObjectPreview(myElement,0, 0, 0, 0.5, 0.5, 1, 1, true, true)&lt;br /&gt;
	guiWindow = guiCreateWindow((scx/2)-100,(scy/2) - 100,200,200, &amp;quot;Test area&amp;quot;, false, false)&lt;br /&gt;
	guiSetAlpha(guiWindow, 0.05 + 0.2)&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)	&lt;br /&gt;
	exports.objectPreview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY,true,true)&lt;br /&gt;
	exports.objectPreview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3])&lt;br /&gt;
	&lt;br /&gt;
	bindKey ( &amp;quot;num_4&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_6&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[1] = myRotation[1] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_add&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_sub&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[2] = myRotation[2] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_2&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] - 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;num_8&amp;quot;, &amp;quot;down&amp;quot;, function() myRotation[3] = myRotation[3] + 5 end)&lt;br /&gt;
	bindKey ( &amp;quot;o&amp;quot;, &amp;quot;down&amp;quot;, function() exports.objectPreview:saveRTToFile(myObject,math.random(100)..&amp;quot;.png&amp;quot;) end)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if not myElement or not myObject then return end&lt;br /&gt;
	local projPosX, projPosY = guiGetPosition(guiWindow,true)&lt;br /&gt;
	local projSizeX, projSizeY = guiGetSize(guiWindow, true)&lt;br /&gt;
	exports.objectPreview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true)&lt;br /&gt;
end, true, &amp;quot;high&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()), function()&lt;br /&gt;
	exports.objectPreview:destroyObjectPreview(myObject)&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a vehicle, applies object preview and scales it using dimensions of a window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the object_preview resource in meta.&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42775</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42775"/>
		<updated>2014-11-04T15:49:04Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShadersLayered====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the main shader effects be created in a separate render pass ? As default only the vehicle effect is layered.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShadersLayered(bool isWorld, isVeh, isPed)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isWorld, isVeh, isPed:''' Should the shader effects be created in a separate render pass.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light. NOTE: Forcing the effects on or using any other lights is required for directional light to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42758</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42758"/>
		<updated>2014-11-03T02:55:50Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light. NOTE: Forcing the effects on or using any other lights is required for directional light to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42716</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42716"/>
		<updated>2014-10-25T00:38:33Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona (width and height).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaSizeXY(element coronaElement,float width,height)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float width, height:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaDepthBias====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
On createCorona the depthBias is set properly (0-1). You can however set other value depending on your needs. To see the results you'll need to set enableDepthBiasScale to true.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaDepthBias(element coronaElement,float depthBiasValue)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float depthBiasValue:''' depthBias value.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====enableDepthBiasScale====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Standard depthBias for GTASA coronas is about 1 unit, despite the corona scale. This function elables depthBias scaling.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:enableDepthBiasScale(bool isDepthScaleEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isDepthScaleEnabled:''' Enable/disable depthBias scaling.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42715</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42715"/>
		<updated>2014-10-25T00:35:17Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. Billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;billboardElement exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns billboardElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardDepthBias====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
On createBillboard the depthBias is set properly (0-1). You can however set other value depending on your needs. To see the results you'll need to set enableDepthBiasScale to true.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardDepthBias(element billboardElement,float depthBiasValue)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float depthBiasValue:''' depthBias value.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====enableDepthBiasScale====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Standard depthBias for GTASA coronas is about 1 unit, despite the corona scale. This function elables depthBias scaling.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:enableDepthBiasScale(bool isDepthScaleEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isDepthScaleEnabled:''' Enable/disable depthBias scaling.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_billboards:createBillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createBillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setBillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/07ea100174/custom_billboards_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42697</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42697"/>
		<updated>2014-10-24T15:20:51Z</updated>

		<summary type="html">&lt;p&gt;Renard712: /* enableDepthBiasScale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona (width and height).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSizeXY(element coronaElement,float width,height)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float width, height:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaDepthBias====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
On createCorona the depthBias is set properly (0-1). You can however set other value depending on your needs. To see the results you'll need to set enableDepthBiasScale to true.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaDepthBias(element coronaElement,float depthBiasValue)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float depthBiasValue:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====enableDepthBiasScale====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Standard depthBias for GTASA coronas is about 1 unit, despite the corona scale. This function elables depthBias scaling.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:enableDepthBiasScale(bool isDepthScaleEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isDepthScaleEnabled:''' Enable/disable depthBias scaling.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42696</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42696"/>
		<updated>2014-10-24T15:19:47Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona (width and height).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSizeXY(element coronaElement,float width,height)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float width, height:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaDepthBias====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
On createCorona the depthBias is set properly (0-1). You can however set other value depending on your needs. To see the results you'll need to set enableDepthBiasScale to true.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaDepthBias(element coronaElement,float depthBiasValue)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float depthBiasValue:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====enableDepthBiasScale====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Standard depthBias for GTASA coronas is about 1 unit, despise the corona scale. This function elables depthBias scaling.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:enableDepthBiasScale(bool isDepthScaleEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isDepthScaleEnabled:''' Enable/disable depthBias scaling.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42204</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42204"/>
		<updated>2014-09-28T21:08:21Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;lightElement exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns lightElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light. NOTE: Forcing the effects on or using any other lights is required for directional light to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42203</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42203"/>
		<updated>2014-09-28T21:06:33Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;coronaElement exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns coronaElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona (width and height).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSizeXY(element coronaElement,float width,height)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float width, height:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42202</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42202"/>
		<updated>2014-09-28T21:04:57Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. Billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;billboardElement exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns billboardElement if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_billboards:createBillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createBillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setBillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/07ea100174/custom_billboards_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42190</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=42190"/>
		<updated>2014-09-27T10:58:33Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light. NOTE: Forcing the effects on or using any other lights is required for directional light to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42189</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=42189"/>
		<updated>2014-09-27T10:54:27Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona (width and height).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSizeXY(element coronaElement,float width,height)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float width, height:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42188</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42188"/>
		<updated>2014-09-27T10:51:45Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. The billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard size.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_billboards:createBillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createBillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setBillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/07ea100174/custom_billboards_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42187</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42187"/>
		<updated>2014-09-27T10:50:51Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. The billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			exports.custom_billboards:createBillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createBillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setBillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/07ea100174/custom_billboards_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=42186</id>
		<title>Resource:Blur box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=42186"/>
		<updated>2014-09-27T10:31:47Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create simple gaussian blur boxes onClientRender.&lt;br /&gt;
Using that - You can make your game GUI a bit more fancy.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage blur boxes. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a blur box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:createBlurBox(float posX,posY,sizeX,sizeY,int colorR,colorG,colorB,colorA,postGUI)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the box.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:destroyBlurBox(element blurBoxElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxEnabled====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function enables or disables a created blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxEnabled(element blurBoxElement, bool isEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''bool isEnabled:''' Enable/Disable the blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxPosition(element blurBoxElement,float posX,posY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxSize(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float sizeX,sizeY:''' Size of the blur box.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurIntensity====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur amount for all the blur boxes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurIntensity(float blurFactor)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float blurFactor:''' Set blur amount for all the blur boxes. (default 0.6)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setScreenResolutionMultiplier====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets screen relative resolution multiplier for the screenSource&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setScreenResolutionMultiplier(element blurBoxElement, float x,y)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blurBox element.&lt;br /&gt;
*'''float x,y:''' Set sampled screen relative resolution multiplier (0-1)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize()&lt;br /&gt;
local guiWindowElement = nil&lt;br /&gt;
local blurBoxElement = nil&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
		if guiWindowElement and blurBoxElement then&lt;br /&gt;
			local xPos, yPos = guiGetPosition ( guiWindowElement , false )&lt;br /&gt;
			local xSize, ySize = guiGetSize ( guiWindowElement , false )&lt;br /&gt;
			exports.blur_box:setBlurBoxPosition( blurBoxElement, xPos, yPos )&lt;br /&gt;
			exports.blur_box:setBlurBoxSize( blurBoxElement, xSize, ySize )		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
,true ,&amp;quot;high-3&amp;quot; )	&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	guiWindowElement = guiCreateWindow ( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, &amp;quot;BlurBox test&amp;quot;, false )&lt;br /&gt;
	guiWindowSetMovable ( guiWindowElement, true )&lt;br /&gt;
	guiWindowSetSizable ( guiWindowElement, true )&lt;br /&gt;
	guiSetAlpha ( guiWindowElement, 0.3 )&lt;br /&gt;
	blurBoxElement = exports.blur_box:createBlurBox( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, 255, 255, 255, 255, false )&lt;br /&gt;
	--exports.blur_box:setBlurBoxColor( blurBoxElement, 255, 100, 100, 255)&lt;br /&gt;
	exports.blur_box:setScreenResolutionMultiplier( 0.5, 0.5 )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	destroyElement( guiWindowElement )&lt;br /&gt;
	blurBoxElement = not exports.blur_box:destroyBlurBox( blurBoxElement )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a blur box and attaches it to a created window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the blur_box resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10163 Community resource]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/f45a107b42/blurBox_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=42185</id>
		<title>Resource:Blur box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Blur_box&amp;diff=42185"/>
		<updated>2014-09-27T10:30:07Z</updated>

		<summary type="html">&lt;p&gt;Renard712: Created page with &amp;quot;{{Resource page}} This resource lets You create simple gaussian blur boxes onClientHUDRender. Using that - You can make your game GUI a bit more fancy.  == Overview ==  It is ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create simple gaussian blur boxes onClientHUDRender.&lt;br /&gt;
Using that - You can make your game GUI a bit more fancy.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage blur boxes. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a blur box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:createBlurBox(float posX,posY,sizeX,sizeY,int colorR,colorG,colorB,colorA,postGUI)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the box.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
*'''bool postGUI:''' Should the box be drawn before or after MTA GUI elements.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns the element if set successfully, 'false' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBlurBox====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:destroyBlurBox(element blurBoxElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxEnabled====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function enables or disables a created blur box element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxEnabled(element blurBoxElement, bool isEnabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''bool isEnabled:''' Enable/Disable the blur box element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxPosition(element blurBoxElement,float posX,posY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float posX, posY:''' Position in screen space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxSize(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float sizeX,sizeY:''' Size of the blur box.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurBoxColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur box color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurBoxColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blur box element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' RGBA color (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBlurIntensity====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets blur amount for all the blur boxes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setBlurIntensity(float blurFactor)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float blurFactor:''' Set blur amount for all the blur boxes. (default 0.6)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setScreenResolutionMultiplier====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets screen relative resolution multiplier for the screenSource&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.blur_box:setScreenResolutionMultiplier(element blurBoxElement, float x,y)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element blurBoxElement:''' A previously declared blurBox element.&lt;br /&gt;
*'''float x,y:''' Set sampled screen relative resolution multiplier (0-1)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local scx, scy = guiGetScreenSize()&lt;br /&gt;
local guiWindowElement = nil&lt;br /&gt;
local blurBoxElement = nil&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
		if guiWindowElement and blurBoxElement then&lt;br /&gt;
			local xPos, yPos = guiGetPosition ( guiWindowElement , false )&lt;br /&gt;
			local xSize, ySize = guiGetSize ( guiWindowElement , false )&lt;br /&gt;
			exports.blur_box:setBlurBoxPosition( blurBoxElement, xPos, yPos )&lt;br /&gt;
			exports.blur_box:setBlurBoxSize( blurBoxElement, xSize, ySize )		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
,true ,&amp;quot;high-3&amp;quot; )	&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	guiWindowElement = guiCreateWindow ( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, &amp;quot;BlurBox test&amp;quot;, false )&lt;br /&gt;
	guiWindowSetMovable ( guiWindowElement, true )&lt;br /&gt;
	guiWindowSetSizable ( guiWindowElement, true )&lt;br /&gt;
	guiSetAlpha ( guiWindowElement, 0.3 )&lt;br /&gt;
	blurBoxElement = exports.blur_box:createBlurBox( scx/2-scy/4, scy/2 - scy/4, scy/2, scy/2, 255, 255, 255, 255, false )&lt;br /&gt;
	--exports.blur_box:setBlurBoxColor( blurBoxElement, 255, 100, 100, 255)&lt;br /&gt;
	exports.blur_box:setScreenResolutionMultiplier( 0.5, 0.5 )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStop&amp;quot;, getResourceRootElement( getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
	destroyElement( guiWindowElement )&lt;br /&gt;
	blurBoxElement = not exports.blur_box:destroyBlurBox( blurBoxElement )&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a blur box and attaches it to a created window element.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the blur_box resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10163 Community resource]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/f45a107b42/blurBox_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42162</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42162"/>
		<updated>2014-09-24T23:54:43Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. The billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Billboard RGBA color emitted by the billboard (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Billboard RGBA color emitted by the billboard (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_billboards:createBillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createBillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setBillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
&lt;br /&gt;
[http://www.solidfiles.com/d/07ea100174/custom_billboards_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42161</id>
		<title>Resource:Custom billboards</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_billboards&amp;diff=42161"/>
		<updated>2014-09-24T23:52:43Z</updated>

		<summary type="html">&lt;p&gt;Renard712: Created page with &amp;quot;{{Resource page}} This resource lets You create billboards. The billboard is a quad that always faces the camera. In this case billboard Elements are created using dxDrawMater...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create billboards. The billboard is a quad that always faces the camera.&lt;br /&gt;
In this case billboard Elements are created using dxDrawMaterialLine3d MTA function. &lt;br /&gt;
I have changed the behaviour of the material to act as cylindrical billboards do.&lt;br /&gt;
There are many possibilities to use this resource. But that's all up to you.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage billboards. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d billboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:createBillboard(float posX,posY,posZ,sizeX,sizeY,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float sizeX, sizeY:''' Size of the billboard.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Billboard RGBA color emitted by the billboard (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyBillboard====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d billboard element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:destroyBillboard(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the billboard material (ex. texture).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardMaterial(element billboardElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardPosition(element billboardElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSize(element billboardElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float size:''' Size of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets billboard width and height.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardSizeXY(element billboardElement,float sizeX,sizeY)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float sizeX,sizeY:''' The width and height of the billboard.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setbillboardColor(element billboardElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element billboardElement:''' A previously declared billboard element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Billboard RGBA color emitted by the billboard (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setBillboardsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the billboard to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setBillboardsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the billboard to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the billboard starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_billboards:createbillboard(tex,i * 7,j * 7,10,4,4,math.random()*255,math.random()*255,math.random()*255,1*255) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates 400 lovely billboards near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local tex = dxCreateTexture(&amp;quot;hello.jpg&amp;quot;)&lt;br /&gt;
local carLight = exports.custom_billboards:createbillboard(tex,0,0,0,4,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_billboards:setbillboardPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a billboard and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_billboards resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=10156 Resource download link]&lt;br /&gt;
[http://www.solidfiles.com/d/07ea100174/custom_billboards_test.zip Test resource]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=41946</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=41946"/>
		<updated>2014-09-12T10:28:33Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSizeXY====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona (width and height).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSizeXY(element coronaElement,float width,height)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float width, height:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=41942</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=41942"/>
		<updated>2014-09-11T21:16:39Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====createMaterialCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona with a custom material.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createMaterialCorona(element material,float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaMaterial====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets custom material for the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaMaterial(element coronaElement,element material)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''element material:''' Material to replace the standard corona texture with.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=41886</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=41886"/>
		<updated>2014-09-11T13:23:15Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaSize====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets size of the corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_billboards:setCoronaSize(element coronaElement,float size)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=41389</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=41389"/>
		<updated>2014-08-16T11:23:27Z</updated>

		<summary type="html">&lt;p&gt;Renard712: /* setDirLightEnable */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light. NOTE: Forcing the effects on or using any other lights is required for directional light to work.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=41387</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=41387"/>
		<updated>2014-08-15T18:53:42Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function setd light direction values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightEnable====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a vertex shader directional light.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightEnable(bool enable = false)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable the directional light.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light direction.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightDirection(float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setDirLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets the directional light color value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setDirLightColor(float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:ShaderPedNormal&amp;diff=40568</id>
		<title>Resource:ShaderPedNormal</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:ShaderPedNormal&amp;diff=40568"/>
		<updated>2014-07-06T01:44:29Z</updated>

		<summary type="html">&lt;p&gt;Renard712: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This is a normal map resource for MTA. It enables normal mapping effect for peds. Also adds sun and moon light to make gtasa lighting a bit more interesting. It is compatible with the peds created to work with normalmap plugin for gtasa.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
You'll have to extract normals from the txd file and apply them with the applyNormalToPedTexture function.&lt;br /&gt;
&lt;br /&gt;
This test resource should present a better explanation. [http://www.solidfiles.com/d/be237103ee/  Download here] Choose (!SKIN ID 7!) after starting.&lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====applyNormalToPedTexture====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function applies the normal mapping effect to ped textures. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:applyNormalToPedTexture( table filepath strings )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath strings:''' The table of filepaths to apply. Those should be paths for the normals extracted from the txd archive.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====removeNormalFromPedTexture====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This function removes the normal mapping effect from ped textures. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:removeNormalFromPedTexture( table filepath strings )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath strings:''' The table of previously applied normals to be disabled.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====applySpecularToGTAPeds====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This function applies a custom specular lighting effect to ped by ID. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:applySpecularToGTAPeds(table ped model id table,bool sobel)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''ped model id table:''' The ped model id table If left blank the effect is applied to all standard ped textures. &lt;br /&gt;
*'''sobel:''' The second argument generates normals based on original textures if set true. Sobel filter works only when your graphics card supports shader model 3.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====removeSpecularFromGTAPeds====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This function removes custom specular lighting effect from ped by ID.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:removeSpecularFromGTAPeds(table ped model ids)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''ped model ids:''' the ped model id table If left blank the effect is removed from all ped textures.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local resourceName = &amp;quot;:&amp;quot;..getResourceName(getThisResource())..&amp;quot;/&amp;quot; &lt;br /&gt;
exports.shaderPedNormal:applyNormalToPedTexture({resourceName..&amp;quot;normals/face_nrm1.0.png&amp;quot;,resourceName..&amp;quot;normals/skin_nrm1.0.png&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This applies normal map effect to textures &amp;quot;face&amp;quot; and &amp;quot;skin&amp;quot;. Notice that the nrm textures should be placed in the resource the function is being called from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.shaderPedNormal:applySpecularToGTAPeds({0,7,121},false)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This applies the specular effect to peds by id 0,7,121&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.shaderPedNormal:removeSpecularFromGTAPeds()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
removes the specular effect from all the peds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use theese functions in your resources you have to include&lt;br /&gt;
the ShaderPedNormal resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=7665 Resource page on community.mtasa]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:ShaderPedNormal&amp;diff=40567</id>
		<title>Resource:ShaderPedNormal</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:ShaderPedNormal&amp;diff=40567"/>
		<updated>2014-07-06T01:19:42Z</updated>

		<summary type="html">&lt;p&gt;Renard712: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This is a normal map resource for MTA. It enables normal mapping effect for peds. Also adds sun and moon light to make gtasa lighting a bit more interesting. It is compatible with the peds created to work with normalmap plugin for gtasa.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
You'll have to extract normals from the txd file and apply them with the applyNormalToPedTexture function.&lt;br /&gt;
&lt;br /&gt;
This test resource should present a better explanation. [http://www.solidfiles.com/d/be237103ee/  Download here] Choose (!SKIN ID 7!) after starting.&lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====applyNormalToPedTexture====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function applies the normal mapping effect to ped textures. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:applyNormalToPedTexture( table filepath strings )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath strings:''' The table of filepaths to apply. Those should be paths for the normals extracted from the txd archive.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====removeNormalFromPedTexture====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This function removes the normal mapping effect from ped textures. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:removeNormalFromPedTexture( table filepath strings )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''filepath strings:''' The table of previously applied normals to be disabled.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====applySpecularToGTAPeds====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This function applies a custom specular lighting effect to ped by ID. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:applySpecularToGTAPeds(table ped model id table,bool sobel)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''ped model id table:''' The ped model id table If left blank the effect is applied to all standard ped textures. &lt;br /&gt;
*'''sobel:''' The second argument generates normals based on original textures if set true. Sobel filter works only when your graphics card supports shader model 3.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====removeSpecularFromGTAPeds====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
This function removes custom specular lighting effect from ped by ID.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.shaderPedNormal:removeSpecularFromGTAPeds(table ped model ids)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''ped model ids:''' the ped model id table If left blank the effect is removed from all ped textures.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local resourceName = &amp;quot;:&amp;quot;..getResourceName(currentResource)..&amp;quot;/&amp;quot;&lt;br /&gt;
exports.shaderPedNormal:applyNormalToPedTexture({resourceName..&amp;quot;normals/face_nrm1.0.png&amp;quot;,resourceName..&amp;quot;normals/skin_nrm1.0.png&amp;quot;})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This applies normal map effect to textures &amp;quot;face&amp;quot; and &amp;quot;skin&amp;quot;. Notice that the nrm textures should be placed in the resource the function is being called from.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.shaderPedNormal:applySpecularToGTAPeds({0,7,121},false)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This applies the specular effect to peds by id 0,7,121&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.shaderPedNormal:removeSpecularFromGTAPeds()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
removes the specular effect from all the peds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use theese functions in your resources you have to include&lt;br /&gt;
the ShaderPedNormal resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=7665 Resource page on community.mtasa]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40544</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40544"/>
		<updated>2014-07-05T10:50:45Z</updated>

		<summary type="html">&lt;p&gt;Renard712: /* createCorona */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA,[bool isSoftParticle = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isSoftParticle:''' The aim with soft particles is to remove the ugly artifact that appears when the particle quad intersects the scene. The option requires DepthBuffer access.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40543</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40543"/>
		<updated>2014-07-05T03:30:45Z</updated>

		<summary type="html">&lt;p&gt;Renard712: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declared corona element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = exports.custom_coronas:createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=40542</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=40542"/>
		<updated>2014-07-05T03:26:16Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declared light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40501</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40501"/>
		<updated>2014-07-02T17:48:25Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoroaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
	for i=1,30 do&lt;br /&gt;
		for j=1,30 do&lt;br /&gt;
			corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource()), addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40500</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40500"/>
		<updated>2014-07-02T17:44:25Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoroaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
&lt;br /&gt;
for i=1,30 do&lt;br /&gt;
	for j=1,30 do&lt;br /&gt;
	corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;r&amp;quot;,&amp;quot;down&amp;quot;,addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40499</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40499"/>
		<updated>2014-07-02T17:39:50Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoroaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
&lt;br /&gt;
for i=1,30 do&lt;br /&gt;
	for j=1,30 do&lt;br /&gt;
	corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;r&amp;quot;,&amp;quot;down&amp;quot;,addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local vehicle1 = nil&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function(thePlayer, seat)&lt;br /&gt;
        if thePlayer == getLocalPlayer() then&lt;br /&gt;
            vehicle1 = source&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
local carLight = exports.custom_coronas:createCorona(0,0,0,4,math.random()*255,math.random()*255,math.random()*255,1*255)&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;, root, function()&lt;br /&gt;
	if vehicle1 then &lt;br /&gt;
		xxx1,yyy1,zzz1 = getElementPosition(vehicle1)&lt;br /&gt;
		exports.custom_coronas:setCoronaPosition(carLight,xxx1,yyy1,zzz1)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a corona and attaches it to a vehicle that the player enters.&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=40486</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=40486"/>
		<updated>2014-07-02T16:12:37Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''int textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(int maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(int timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderNightMod====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable nightMod effect - requires proper manipulation of setTextureBrightness and SetShaderDayTime, also some additional shaders.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderNightMod(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable nightMod effect&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderDayTime====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Another additional variable to control texture colors - requires setShaderNightMod(true)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderDayTime(float dayTime)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float dayTime:''' Another additional variable to control texture colors - requires setShaderNightMod(true) set 1 as default&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderPedDiffuse====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Enable or disable gta directional lights for ped.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderPedDiffuse(bool enable)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool enable:''' Enable or disable gta directional lights for ped (enabled as default)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40473</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40473"/>
		<updated>2014-07-01T22:33:57Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoroaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
&lt;br /&gt;
for i=1,30 do&lt;br /&gt;
	for j=1,30 do&lt;br /&gt;
	corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;r&amp;quot;,&amp;quot;down&amp;quot;,addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40472</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40472"/>
		<updated>2014-07-01T22:33:24Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoroaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
&lt;br /&gt;
for i=1,30 do&lt;br /&gt;
	for j=1,30 do&lt;br /&gt;
	corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;r&amp;quot;,&amp;quot;down&amp;quot;,addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video]&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40471</id>
		<title>Resource:Custom coronas</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Custom_coronas&amp;diff=40471"/>
		<updated>2014-07-01T22:31:50Z</updated>

		<summary type="html">&lt;p&gt;Renard712: Created page with &amp;quot;{{Resource page}} This resource lets You create some coronas. Not just your typical gtasa coronas  that often times fail to appear. Since in this case corona Elements are crea...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create some coronas. Not just your typical gtasa coronas &lt;br /&gt;
that often times fail to appear. Since in this case corona Elements are created using&lt;br /&gt;
dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material &lt;br /&gt;
to act as cylindrical billboards do.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to manage coronas. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a shadered materialLine3d Corona.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
*'''float size:''' Size of the corona.&lt;br /&gt;
*'''int colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyCorona====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a shadered materialLine3d Corona element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:destroyCorona(element coronaElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronaPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets corona position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired corona element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoroaColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color values.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element coronaElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Corona RGBA color emitted by the corona (0 - 255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setCoronasDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int MaxEffectFade:''' Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).&lt;br /&gt;
*'''int MinEffectFade:''' Set the distance on which the corona starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local corTable = {}&lt;br /&gt;
&lt;br /&gt;
function addStuff()&lt;br /&gt;
&lt;br /&gt;
for i=1,30 do&lt;br /&gt;
	for j=1,30 do&lt;br /&gt;
	corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) &lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;r&amp;quot;,&amp;quot;down&amp;quot;,addStuff)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a 400 coronas near position (0,0,0)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the custom_coronas resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9558 Custom Coronas resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39981</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39981"/>
		<updated>2014-06-20T14:05:36Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''integer textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsDistFade====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance of the light to sync and the distance on which the light starts to fade out.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsDistFade(integer MaxEffectFade,integer MinEffectFade)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''integer MaxEffectFade:''' Set the Max distance of the light to sync.(Must be greater than MinEffectFade and lower than maxEffectRange).&lt;br /&gt;
*'''integer MinEffectFade:''' Set the distance on which the light starts to fade out.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightsEffectRange====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Set the Max distance from the camera the shader effects are applied to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightsEffectRange(integer maxEffectRange)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''integer maxEffectRange:''' If non-zero, the shaders will be applied to textures nearer than maxDistance only.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(integer timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''integer timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39954</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39954"/>
		<updated>2014-06-17T20:43:29Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setGenerateBumpNormals====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect generate bump normals from texture0. Doesn't work when normal shadowing is set to false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setGenerateBumpNormals(bool isTrue,[int textureSize = 512, float normalStrength.x = 1, float normalStrength.y = 1])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isTrue:''' Turn on or off bump mapping.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''integer textureSize:''' The size of the input texture.&lt;br /&gt;
*'''float normalStrength.xy:''' How bumpy should the surface be ?&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(integer timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''integer timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39801</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39801"/>
		<updated>2014-06-09T17:59:14Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(integer timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''integer timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39800</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39800"/>
		<updated>2014-06-09T17:50:20Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(bool timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[http://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=9398 Dynamic Lighting resource on MTA Community]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39796</id>
		<title>Resource:Dynamic lighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dynamic_lighting&amp;diff=39796"/>
		<updated>2014-06-09T16:41:09Z</updated>

		<summary type="html">&lt;p&gt;Renard712: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
This resource lets You create dynamic lights in MTA. It gives you a list of exported functions that You can use to create per pixel pointlights and spotlights. It should be considered a preview of what [https://wiki.multitheftauto.com/wiki/MTA:Eir MTA:Eir] will offer. The future solution should be more FPS friendly. Yet i see that resource as an example of what the future holds.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
It is easy to use, gives a few options to create per pixel lights in gtasa. &lt;br /&gt;
&lt;br /&gt;
The resource itself adds exported clientside functions:&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
====createPointLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader pointlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createPointLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,attenuation,[bool normalShadow = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
====createSpotLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates a pixel shader spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:createSpottLight(float posX,posY,posZ,colorR,colorG,colorB,colorA,dirX,dirY,dirZ, bool isEuler,float falloff,theta,phi,attenuation,[bool normalShadowing = true])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''bool isEuler:''' Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
*'''float falloff:''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
*'''float theta: (radians)''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
*'''float phi: (radians)''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====destroyLight====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:destroyLight(element lightElement)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightDirection====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function destroys a light element.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightDirection(element lightElement,float dirX,dirY,dirZ,[bool isEuler = false])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float dirX,dirY,dirZ:''' Direction that the light is pointing in world space. It's a vector as default.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''bool isEuler:'''Is the angle set as an &amp;quot;ZXY&amp;quot; euler andgle or a vector.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPosition====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light position value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPosition(element lightElement,float posX,posY,posZ)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float posX, posY, posZ:''' Light position in world space.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightColor====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets light color value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightColor(element lightElement,float colorR,colorG,colorB,colorA)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float colorR,colorG,colorB,colorA:''' Light RGBA color emitted by the light (0 - 1 instead of 0-255).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightAttenuation====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets setLightAttenuation value for both a pointlight and a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightAttenuation(element lightElement,float attenuation)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float attenuation:''' Value specifying how the light intensity changes over distance.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightFalloff====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets falloff value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightFalloff(element lightElement,float falloff)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float falloff (radians):''' Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi). &lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightTheta====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets theta value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightTheta(element lightElement,float theta)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float theta (radians):''' Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightPhi====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function sets phi value for a spotlight.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightPhi(element lightElement,float phi)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float phi (radians):''' Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setLightNormalShadowing====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setLightNormalShadowing(element lightElement,bool normalShadow)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''bool normalShadow:''' Determine if the light source should be obscured when lighting a surface on opposite angles.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setNormalShadowingAmount====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Determine global shadowing value ( for all lights).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setNormalShadowingAmount(element lightElement,float normalShadowAmmount)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element lightElement:''' A previously declaired light element.&lt;br /&gt;
*'''float normalShadowAmmount:''' Determine global shadowing value (1-full 0-nil).&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderForcedOn====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off when no lightsources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderForcedOn(bool isShaderForcedOn)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool isShaderForcedOn:''' Should the shader effect turn off when no lightsources.&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====setShaderTimeOut====&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool exports.dynamic_lighting:setShaderTimeOut(bool timeOut)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''bool timeOut:''' Should the shader effect turn off after number of seconds (when no lightsources)&lt;br /&gt;
===Returns===&lt;br /&gt;
The function returns true if set successfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;exports.dynamic_lighting:createPointLight(0,0,5,1,0,0,1,15)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This creates a red pointlight in world position (0,0,5)&lt;br /&gt;
&lt;br /&gt;
Of course when you want to use these functions in your resources you have to include&lt;br /&gt;
the dynamic_lighting resource in meta.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/windows/desktop/bb174697%28v=vs.85%29.aspx Light Types (Direct3D 9)]&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=2t_bje_XjUY Vehicle lights video]&lt;/div&gt;</summary>
		<author><name>Renard712</name></author>
	</entry>
</feed>