Class: Three::Postprocessing::UnrealBloomPass

Inherits:
Object
  • Object
show all
Defined in:
lib/three/postprocessing/unreal_bloom_pass.rb

Constant Summary collapse

PROPERTY_NAMES =
{
  enabled: "enabled",
  strength: "strength",
  radius: "radius",
  threshold: "threshold"
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resolution: [1, 1], strength: 1, radius: 0, threshold: 0, backend: nil, composer: nil, **parameters) ⇒ UnrealBloomPass

Returns a new instance of UnrealBloomPass.



18
19
20
21
22
23
24
25
26
27
# File 'lib/three/postprocessing/unreal_bloom_pass.rb', line 18

def initialize(resolution: [1, 1], strength: 1, radius: 0, threshold: 0, backend: nil, composer: nil, **parameters)
  @backend = backend || composer&.backend || Backends::ThreeJS.new
  @resolution = coerce_resolution(resolution)
  @enabled = true
  @strength = strength
  @radius = radius
  @threshold = threshold
  @handle = @backend.create_unreal_bloom_pass(@resolution, @strength, @radius, @threshold)
  set_values(parameters)
end

Instance Attribute Details

#backendObject (readonly)

Returns the value of attribute backend.



15
16
17
# File 'lib/three/postprocessing/unreal_bloom_pass.rb', line 15

def backend
  @backend
end

#handleObject (readonly)

Returns the value of attribute handle.



15
16
17
# File 'lib/three/postprocessing/unreal_bloom_pass.rb', line 15

def handle
  @handle
end

#resolutionObject (readonly)

Returns the value of attribute resolution.



15
16
17
# File 'lib/three/postprocessing/unreal_bloom_pass.rb', line 15

def resolution
  @resolution
end