; Requires Extended language mode. ; Bright edge markers make vignette radius and softness easy to judge. Include "_common\ShowcaseCamera.bb" Graphics3D 960,600,0,2:SetBuffer BackBuffer() camera=CreateCamera():PositionEntity camera,0,0,-9:CameraClsColor camera,20,25,42 light=CreateLight(1):RotateEntity light,35,-30,0:AmbientLight 45,45,55 floor=CreateCube():ScaleEntity floor,8,.08,10:PositionEntity floor,0,-2,5:EntityColor floor,45,55,75 For ring=0 To 2 For index=0 To 11 angle#=index*30+ring*10 sphere=CreateSphere(16):ScaleEntity sphere,.32,.32,.32 PositionEntity sphere,Cos(angle)*(2+ring*1.25),Sin(angle)*(1.2+ring*.75),2+ring*2 EntityColor sphere,70+ring*65,70+index*13,255-index*12 EntityFX sphere,1 Next Next centre=CreateSphere(32):PositionEntity centre,0,0,4:EntityColor centre,255,220,110:EntityFX centre,1 effect=LoadShader("builtin:vignette") If effect=0 Then RuntimeError "Could not load builtin:vignette" CameraEffect camera,effect strength#=.8:radius#=.48:softness#=.25:bypass=False:ResetShowcaseCameraTimer() While Not KeyHit(1) UpdateShowcaseCamera camera,4,70 If KeyHit(57) Then bypass=Not bypass If KeyDown(44) Then strength=strength-.01 If KeyDown(45) Then strength=strength+.01 If KeyDown(26) Then radius=radius-.005 If KeyDown(27) Then radius=radius+.005 If KeyDown(12) Then softness=softness-.005 If KeyDown(13) Then softness=softness+.005 If strength<0 Then strength=0:If strength>1 Then strength=1 If radius<.1 Then radius=.1:If radius>.9 Then radius=.9 If softness<.02 Then softness=.02:If softness>.8 Then softness=.8 ShaderFloat effect,"Strength",strength:ShaderFloat effect,"Radius",radius ShaderFloat effect,"Softness",softness:CameraEffectEnabled camera,effect,Not bypass RenderWorld Color 255,255,255:Text 12,12,"VIGNETTE CAMERA EFFECT" Text 12,32,"SPACE before/after Z/X strength "+Int(strength*100)+"% [/] radius "+Int(radius*100)+"%" Text 12,50,"-/= softness: "+Int(softness*100)+"% Edge markers reveal the falloff" DrawShowcaseCameraHelp 570:Flip Wend FreeShader effect:End