3D lighting
3D lighting methods allow you to create complex lighting scenes inside DirectGPU.
Methods
Section titled “Methods”addAmbientLight
Section titled “addAmbientLight”Adds ambient light affecting the whole scene evenly.
Requires: DisplayID, r : number, g : number, b : number, intensity : number
Example
Section titled “Example”gpu.addAmbientLight(displayId, 40, 40, 40, 0.3)addDirectionalLight
Section titled “addDirectionalLight”Adds a directional light shining in the given direction.
Requires: DisplayID, dirX : number, dirY : number, dirZ : number, r : number, g : number, b : number, intensity : number
Example
Section titled “Example”gpu.addDirectionalLight(displayId, 0, -1, 0, 255, 255, 255, 0.8)clearLights
Section titled “clearLights”Removes all lights from the display’s 3D scene.
Requires: DisplayID
Example
Section titled “Example”gpu.clearLights(displayId)setBackfaceCulling
Section titled “setBackfaceCulling”Turns backface culling on or off. Useful for performance and cleaner solid models.
Requires: DisplayID, enabled : boolean
Example
Section titled “Example”gpu.setBackfaceCulling(displayId, true)setPhongShading
Section titled “setPhongShading”Turns phong shading on or off. Use it if you want smoother lighting on supported geometry.
Requires: DisplayID, enabled : boolean
Example
Section titled “Example”gpu.setPhongShading(displayId, true)