Inversion

This commit is contained in:
JozsefA 2021-04-30 14:28:18 -07:00
parent 37e8e87553
commit dc3517eb3a
3 changed files with 6 additions and 4 deletions

View file

@ -107,7 +107,7 @@ public class ChromaticProjectorScreen extends AbstractSimiScreen {
.titled(Lang.translate("gui.chromatic_projector.strength")) .titled(Lang.translate("gui.chromatic_projector.strength"))
.withStepFunction(ctx -> step(ctx, 5)) .withStepFunction(ctx -> step(ctx, 5))
.calling(tile::setStrength) .calling(tile::setStrength)
.withRange(0, 101) .withRange(-100, 101)
.setState((int) (tile.strength * 100)); .setState((int) (tile.strength * 100));
Collections.addAll(widgets, blend, rChannel, gChannel, bChannel, fieldEffect, strength); Collections.addAll(widgets, blend, rChannel, gChannel, bChannel, fieldEffect, strength);

View file

@ -41,8 +41,8 @@ public class FilterSphere {
surface ? 1 : 0, surface ? 1 : 0,
field ? 1 : 0, field ? 1 : 0,
strength, Math.abs(strength),
0, // padding strength < 0 ? 1 : 0,
rMask ? 1 : 0, rMask ? 1 : 0,
gMask ? 1 : 0, gMask ? 1 : 0,

View file

@ -17,7 +17,7 @@ uniform vec3 uCameraPos;
struct SphereFilter { struct SphereFilter {
vec4 sphere;// <vec3 position, float radius> vec4 sphere;// <vec3 position, float radius>
vec4 d1;// <float feather, float fade, float density, float blend mode> vec4 d1;// <float feather, float fade, float density, float blend mode>
vec4 strength;// <float surfaceStrength, float bubbleStrength, float strength> vec4 strength;// <float surfaceStrength, float bubbleStrength, float strength, float invert>
vec4 channelMask;// <vec3 rgb> vec4 channelMask;// <vec3 rgb>
mat4 colorOp; mat4 colorOp;
}; };
@ -126,6 +126,8 @@ vec3 applyFilters(vec3 worldDir, float depth, vec3 diffuse) {
float strength = filterStrength(worldDir, depth, s); float strength = filterStrength(worldDir, depth, s);
strength = invert(strength, s.strength.w);
if (strength > 0) { if (strength > 0) {
const float fcon = 0.; const float fcon = 0.;