BrushEmissive brush,red#,green#,blue#[,strength#]
Parameters
|
brush - brush handle red#, green#, blue# - emission colour from 0 to 255 strength# (optional) - intensity multiplier, 0 or higher; 1.0 (default) |
Description
|
Makes a Standard material glow with its own light. Emission is for things that are themselves light sources to the eye: neon signs, monitor screens, lava, engine exhausts, LED strips. An emissive surface stays visible in a pitch-black scene. It does not illuminate nearby entities, though - it is a surface property, not a light - so pair it with a point light if the surroundings should glow too. With HDRRendering enabled, a strength above 1 pushes emission beyond white in the scene buffer, which is exactly what the builtin:bloom camera effect feeds on - the classic recipe for glowing signage is emissive strength 2-4 plus bloom. An emissive map, when present, multiplies this colour, letting a texture pick out which pixels glow. Strength is clamped to 0 or above. Calling this command attaches the Standard material to the brush automatically. Requires Extended mode. See also: BrushEmissiveMap, BrushStandard, HDRRendering, CreateLight. |
Example
; BrushEmissive Example ; --------------------- ; Requires Extended mode. Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,0,-5 ; A dark night sky makes the glow stand out (no lights needed) CameraClsColor camera,5,5,15 ; A dark base colour so almost all visible light is emission brush=CreateStandardBrush(20,20,20) sphere=CreateSphere(32) strength#=2.0 angle#=0 While Not KeyDown(1) ; Press [ / ] to change the emission strength If KeyDown(26) And strength>0 Then strength=strength-0.05 If KeyDown(27) And strength<5 Then strength=strength+0.05 ; Make the sphere emit cyan light and repaint it BrushEmissive brush,30,140,255,strength PaintEntity sphere,brush ; Bob the glowing orb gently angle=angle+2 PositionEntity sphere,0,Sin(angle)*0.3,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Color 255,255,255 Text 0,0,"[ / ] : emission strength Arrow keys: move camera Esc: exit" Text 0,20,"BrushEmissive brush,30,140,255,"+strength Flip Wend FreeBrush brush End
Index