EntityGlow
Makes an entity give off light that glows.
EntityGlow entity,amount#
Parameters
- entity
- entity handle
- amount#
- how much light the entity gives off. 0 switches glowing off; 1 to 3 suits most uses.
Description
Makes an entity give off light in its own colour (and texture), so it shines even in the dark and glows when the camera has CameraGlow switched on. Use it for lasers, engine exhausts, neon signs, lava, magic and anything else that should look bright.
The entity does not light up other things around it; add a light with CreateLight for that.
EntityGlow works on meshes, sprites and full-bright entities, and copies made with CopyEntity keep their glow.
Example
; Ambient occlusion and glow example (ArcBasic extensions); A toggles ambient occlusion, G toggles glow, Escape quitsGraphics3D 640,480SetBuffer BackBuffer()camera=CreateCamera()PositionEntity camera,0,4,-9TurnEntity camera,20,0,0CameraClsColor camera,10,10,25AmbientLight 120,120,130light=CreateLight()RotateEntity light,60,40,0LightColor light,140,140,140ground=CreatePlane()EntityColor ground,180,180,180For i=0 To 2 box=CreateCube() PositionEntity box,-3+i*3,1,2+(i Mod 2) EntityColor box,200,200,200Next; this ball gives off its own light, so it glowslava=CreateSphere(16)PositionEntity lava,-1.5,1,-1EntityColor lava,255,80,40EntityGlow lava,2ball=CreateSphere(16)PositionEntity ball,1.5,1,-1EntityColor ball,60,160,255ao=True : glow=TrueCameraAmbientOcclusion camera,aoCameraGlow camera,glowWhile Not KeyDown(1) If KeyHit(30) Then ao=Not ao : CameraAmbientOcclusion camera,ao If KeyHit(34) Then glow=Not glow : CameraGlow camera,glow RenderWorld Text 0,0,"A: ambient occlusion G: glow" FlipWendEnd
