Files
OldThink/Resources/Textures/Shaders/gradient_circle_mask.swsl
GraniteSidewalk 549d84174c Singularity Shaders and a lot of Shader Stuff (#2517)
* Beginnings of singulo shader

* LOTS of changes!!

* Minor changes

* Singulo stuff

* Aesthetic changes to singulo

* Combining singulo change

* ShaderAura uses IEntities now, not IPlayerSession

* Fixes?

* Fixes draw order for atmos

* using fix

* Address reviews

* nuget.config whaaa

* nuget haha

* nuget why are you so dum

* happy now

* Preparing for omegachange

* Merge from seventh level of hell

* woork

* Ignorecomponents add

* mmf

* RobustToolbox?

* Fixes

* Fixes Robust?

* adds sprite

* Nullables

* Crit overlay stuff

* Commits Robust
2021-03-09 02:33:41 -08:00

26 lines
970 B
Plaintext

//This shader defines two circles - everything inside the inner circle will be darkened, while everything outside the outer circle
//will be full black. Between the inner and outer circle it LERPs from the inner darkness to full black.
light_mode unshaded;
const highp float darknessAlphaInner = 0.6;
const highp float innerCircleRadius = 40; //Note: this is in pixels
const highp float outerCircleRadius = 80;
void fragment() {
highp vec2 pixelSize = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
highp vec2 pixelCenter = pixelSize*0.5;
highp float distance = length(FRAGCOORD.xy - pixelCenter);
if(distance > outerCircleRadius){
COLOR = vec4(0.0, 0.0, 0.0, 1.0);
}
else if(distance < innerCircleRadius){
COLOR = vec4(0.0, 0.0, 0.0, darknessAlphaInner);
}
else{
highp float intensity = (distance-innerCircleRadius)/(outerCircleRadius-innerCircleRadius);
COLOR = vec4(0.0, 0.0, 0.0, (1-intensity)*darknessAlphaInner + intensity);
}
}