Difference between revisions of "RLVa RFC setsphere"

From Catznip
Jump to navigation Jump to search
Line 1: Line 1:
 +
==Mode: Blur (2)==
 +
{| class="wikitable"
 +
! style="text-align:left;"| Command
 +
! Value(s)
 +
! Description
 +
|-
 +
|setsphere_mode
 +
|2
 +
|Switches @setsphere to 'variable kernel blur' mode
 +
|-
 +
|setsphere_param
 +
|<kernel size>/0/0/0
 +
|The first number specifies the kernel size for the Gaussian blur (needs to be set in combination with valuemin/valuemax)
 +
|-
 +
|setsphere_distmin
 +
|<distance>
 +
|Sets the distance (in m) at which the effect should start
 +
|-
 +
|setsphere_distmax
 +
|<distance>
 +
|Sets the distance (in m) at which the effect should end
 +
|-
 +
|setsphere_distextend
 +
| 0, 1, 2 or 3
 +
|See documentation above
 +
|-
 +
|setsphere_valuemin
 +
|<float>
 +
|Sets the strength of the effect at distmin (useful range values depend on kernel size param)
 +
|-
 +
|setsphere_valuemax
 +
|<float>
 +
|Sets the strength of the effect at distmax (useful range values depend on kernel size param)
 +
|-
 +
|}
 +
 +
===Notes===
 +
* The kernel size determines how many neighbouring pixels are sampled. A higher kernel size will result in a more blurred out end result (dependent on the sigma value in min/max value)
 +
* Avoid using large value for kernel since this will likely be clamped in the future once the impact on FPS can be determined
 +
 +
===Example===
 +
# Clear all modifiers and switch @setsphere to 'variable blur' mode
 +
#: <pre>@clear,setsphere=n,setsphere_mode:2=force</pre>
 +
# Set the kernel size to 15 and sigma value to 5
 +
#: <pre>@setsphere_param:15/0/0/0=force,setsphere_valuemax:5=force</pre>
 +
# Enforce the effect only when >=2m away (only objects >2m will look blurry)
 +
#: <pre>@setsphere_distmin:2=force</pre>
 +
 +
{| width="100%"
 +
| [[File:setsphere blur2 1.png|500px|thumb|center|(Step 2) Red shifted by 8 left and 0 down. Blue shifted by 8 right and 0 down.]]
 +
| [[File:setsphere blur2 2.png|500px|thumb|center|(Step 3) Using valuemin/valuemax blends the original colour with the effect making it appear more like a ghost artifact]]
 +
|}
 +
 
==Mode: Chromatic Aberration==
 
==Mode: Chromatic Aberration==
 
{| class="wikitable"
 
{| class="wikitable"

Revision as of 23:09, 8 January 2021

Mode: Blur (2)

Command Value(s) Description
setsphere_mode 2 Switches @setsphere to 'variable kernel blur' mode
setsphere_param <kernel size>/0/0/0 The first number specifies the kernel size for the Gaussian blur (needs to be set in combination with valuemin/valuemax)
setsphere_distmin <distance> Sets the distance (in m) at which the effect should start
setsphere_distmax <distance> Sets the distance (in m) at which the effect should end
setsphere_distextend 0, 1, 2 or 3 See documentation above
setsphere_valuemin <float> Sets the strength of the effect at distmin (useful range values depend on kernel size param)
setsphere_valuemax <float> Sets the strength of the effect at distmax (useful range values depend on kernel size param)

Notes

  • The kernel size determines how many neighbouring pixels are sampled. A higher kernel size will result in a more blurred out end result (dependent on the sigma value in min/max value)
  • Avoid using large value for kernel since this will likely be clamped in the future once the impact on FPS can be determined

Example

  1. Clear all modifiers and switch @setsphere to 'variable blur' mode
    @clear,setsphere=n,setsphere_mode:2=force
  2. Set the kernel size to 15 and sigma value to 5
    @setsphere_param:15/0/0/0=force,setsphere_valuemax:5=force
  3. Enforce the effect only when >=2m away (only objects >2m will look blurry)
    @setsphere_distmin:2=force
(Step 2) Red shifted by 8 left and 0 down. Blue shifted by 8 right and 0 down.
(Step 3) Using valuemin/valuemax blends the original colour with the effect making it appear more like a ghost artifact

Mode: Chromatic Aberration

Command Value(s) Description
setsphere_mode 3 Switches @setsphere to 'chromatic aberration' mode
setsphere_param <horiz red shift>/<vert red shift>/<horiz blue shift>/<vert blue shift> The first 2 numbers specify the offset of the red component; the last 2 the offset of the green component
setsphere_distmin <distance> Sets the distance (in m) at which the effect should start
setsphere_distmax <distance> Sets the distance (in m) at which the effect should end
setsphere_distextend 0, 1, 2 or 3 See documentation above
setsphere_valuemin 0.0-1.0 Sets the strength of the effect at distmin
setsphere_valuemax 0.0-1.0 Sets the strength of the effect at distmax

Notes

  • If both values (valuemin and valuemax) and both distances (distmin and distmax) are different then - much like the blending mode - the offsets for the colour components of each pixel will gradually increase (or decrease) depending on the distance

Example

  1. Clear all modifiers and switch @setsphere to 'ca' mode
    @clear,setsphere=n,setsphere_mode:3=force
  2. Shift the red channel to the left by 8 pixels and blue to the right by 8 pixels
    @setsphere_param:8/0/-8/0=force
  3. Increase the color shifts but blend back with the original colour at 50% (animate the change across 5 seconds)
    @setsphere_tween:5=force,setsphere_param:0/-25/0/25=force,setsphere_valuemax:0.5=force,setsphere_tween=force
  4. Enforce the effect only when >=10m away (only objects >10m away appear affected)
    @setsphere_distmin:10=force
(Step 2) Red shifted by 8 left and 0 down. Blue shifted by 8 right and 0 down.
(Step 3) Using valuemin/valuemax blends the original colour with the effect making it appear more like a ghost artifact
(Step 4) Inner sphere radius set to 10m

Mode: Pixelate

Command Value(s) Description
setsphere_mode 4 Switches @setsphere to pixelate mode
setsphere_param <width>/<height>/0/0 Specifies the pixelate block size (in pixels) - last 2 params are unused by this mode
setsphere_distmin <distance> Sets the distance (in m) at which the effect should start
setsphere_distmax <distance> Sets the distance (in m) at which the effect should end
setsphere_distextend 1 or 0 Specify 1 (default) to extend the effect past the maximum distance or 0 to end it
setsphere_valuemin - Unused
setsphere_valuemax - Unused

Notes

  • don't use @setsphere_distextend:1=force with a min/max distance value in this mode; just setting distmin will suffice (see examples)

Example

  1. Clear all modifiers and switch @setsphere to 'pixelate' mode
    @clear,setsphere=n,setsphere_mode:4=force
  2. Set the block size to 10x10 (everything is pixelated)
    @setsphere_param:10/10/0/0=force
  3. Enforce the effect only when >=10m away (only objects >10m away appear pixelated)
    @setsphere_distmin:10=force
  4. Tween to a block size of 25x25 in 15 seconds (and then reset the tween duration for following commands)
    @setsphere_tween:15=force,setsphere_param:25/25/0/0=force,setsphere_tween=force
(Step 2) Block size set to 10x10
(Step 3) Inner sphere radius set to 10m
(Step 4) Block size set to 25x25