Commit 2192f232 authored by Jari Karppinen's avatar Jari Karppinen

Update VignetteEffect

parent de7a6600
......@@ -2,7 +2,7 @@
<Effect>
<MetaData>
<Property name="vig_color" formalName="Vignet Color" type="Color" default="0.5 0.5 0.5" description="The color to use for the Vignetting."/>
<Property name="vig_strenght" formalName="Strenght" min="0" max="15" default="15.0" description="Strenght of Vignetting."/>
<Property name="vig_strength" formalName="Strength" min="0" max="15" default="15.0" description="Strength of Vignetting."/>
<Property name="vig_radius" formalName="Radius" min="0" max="5" default="0.35" description="Size of Vignetting."/>
</MetaData>
<Shaders>
......@@ -15,20 +15,18 @@
void frag()
{
float radius = vig_radius;
vec4 origColor = texture2D_0(TexCoord);
vec2 uv = TexCoord.xy;
vec2 center = vec2(0.5);
vec4 bg = origColor;
uv *= 1.0 - uv.yx;
float vig = uv.x*uv.y * vig_strenght;
uv *= 1.0 - uv.yx;
float vig = uv.x * uv.y * vig_strength;
vig = pow(vig, vig_radius);
vec4 vigmixcolor = vec4(vig_color,vig) * vec4(vig);
gl_FragColor = vec4(mix(origColor,vigmixcolor,1.0-vig));
vec4 vigColor = vec4(vig_color.rgb, vig) * vig;
gl_FragColor = mix(origColor, vigColor, 1.0 - vig);
}
]]></FragmentShader>
</Shader>
......
......@@ -211,7 +211,7 @@
</Add>
<Add ref="#Material_001" diffusemap="#Material_001_diffusemap" shaderlighting="None" />
<Add ref="#Material_001_diffusemap" sourcepath="../meshes/Gauges/maps/map.jpg" subpresentation="navigationStream" />
<Add ref="#VignetteEffect_001" name="VignetteEffect" vig_color="0 0 0" vig_radius="1.01626" vig_strenght="15" />
<Add ref="#VignetteEffect_001" name="VignetteEffect" vig_color="0 0 0" vig_radius="1.01626" vig_strength="15" />
<Add ref="#__Container" name="__Container" />
<Add ref="#materials//Default" name="materials//Default" />
<State id="Scene-2D" name="2D" playmode="Play Through To..." >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment