Gunnar333
Well-Known Member
So here is what I found out about this CSP Spectators settings and how we can use it for not even spectators with a work around.
So what does these settings do? Let's see it as 3 modes:
mode 1 (default):
in race mode you can see spectators that are defined in camera_facing.ini
in practice mode these spectators are hidden
doesn't effect [SPECTATORS] parameter in ext_config
mode 2:
in race mode you can see spectators that are defined in camera_facing.ini
in practice mode these spectators are also shown.
doesn't effect [SPECTATORS] parameter in ext_config
mode 3 ("Adjust amount of spectators" tick doesn't matter):
in race mode spectators that are defined in camera_facing.ini are hidden.
in practice mode these spectators are also hidden.
meshes defined in ext_config like this:
are also hidden.
I asume most people will use mode1 so hiding meshes with [SPECTATORS] option doesn't make much sense.
But how can we hide an object like a cameraman or a parked safety car in practice mode?
Well here is another CSP option we can use which will allow the following work around:
define a condition
So we get a on/off condition depending on spectator amount
Use it to change material alpha values like this:
In shader replacement we replace the shader from a normal ksPerPixel shader to ksPerPixelAlpha so we will be able to set an alpha value in material adjustment.
Changing BlendMode to Alpha test might also be needed for transparent obects.
in material adjustment:
alpha value = 0 makes the material transparent so the mesh is hidden but still we can see its shadow.
With ksAlphaRef = 2 (value largen than 1) we can hide the shadow, too
I will use this for an updated Norisring (release later today on RD) where I hide cameras, 3Dpeople, cranes, small tents, camping chairs, etc in practice mode.
So you can have a look at it how it works.
So what does these settings do? Let's see it as 3 modes:
mode 1 (default):
in race mode you can see spectators that are defined in camera_facing.ini
in practice mode these spectators are hidden
doesn't effect [SPECTATORS] parameter in ext_config
mode 2:
in race mode you can see spectators that are defined in camera_facing.ini
in practice mode these spectators are also shown.
doesn't effect [SPECTATORS] parameter in ext_config
mode 3 ("Adjust amount of spectators" tick doesn't matter):
in race mode spectators that are defined in camera_facing.ini are hidden.
in practice mode these spectators are also hidden.
meshes defined in ext_config like this:
Code:
[SPECTATORS]
meshes=people01, people02, people03
I asume most people will use mode1 so hiding meshes with [SPECTATORS] option doesn't make much sense.
But how can we hide an object like a cameraman or a parked safety car in practice mode?
Well here is another CSP option we can use which will allow the following work around:
define a condition
Code:
[CONDITION_...]
NAME=SPECTATORS_EVENT
INPUT=SPECTATORS
LUT=(|0=0|0.5=0|0.5=1|1=1|)
Use it to change material alpha values like this:
Code:
[SHADER_REPLACEMENT_...]
DESCRIPTION=replace ksDiffuse Shader
MESHES=mesh01, mesh02, mesh03
SHADER=ksPerPixelAlpha
BLEND_MODE=ALPHA_TEST
[MATERIAL_ADJUSTMENT_...]
MESHES=mesh01, mesh02, mesh03
CONDITION=SPECTATORS_EVENT
KEY_0 = alpha
VALUE_0 = 1
VALUE_0_OFF = 0
KEY_1 = ksAlphaRef
VALUE_1 = 0.5
VALUE_1_OFF = 2
Changing BlendMode to Alpha test might also be needed for transparent obects.
in material adjustment:
alpha value = 0 makes the material transparent so the mesh is hidden but still we can see its shadow.
With ksAlphaRef = 2 (value largen than 1) we can hide the shadow, too
I will use this for an updated Norisring (release later today on RD) where I hide cameras, 3Dpeople, cranes, small tents, camping chairs, etc in practice mode.
So you can have a look at it how it works.