Files
OldThink/Resources/Textures/Shaders/texture.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

23 lines
950 B
Plaintext

//Draws the given texture at the given screen coords. Useful in specific scenarios (i.e. this was made for drawing singularity sprites over the lensing effect but below FOV)
//Currently does not work with AtlasTextures, going to need some work.
uniform sampler2D tex;
uniform highp vec2 positionInput = vec2(0,0);
uniform highp vec2 pixelSize = vec2(32, 32);
uniform highp float alphaCutoff = 0.0;
uniform bool removeTransparency = false;
void fragment() {
float pixelLength = pixelSize.x*2;
float halvedLength = pixelLength/2;
if(FRAGCOORD.x > positionInput.x - halvedLength && FRAGCOORD.x < positionInput.x + halvedLength && FRAGCOORD.y > positionInput.y - halvedLength && FRAGCOORD.y < positionInput.y + halvedLength){
vec2 finalCoords = (FRAGCOORD.xy-positionInput+(pixelLength/2))/pixelLength;
vec4 color = texture(tex, finalCoords);
if(color.a > alphaCutoff){
if(removeTransparency)
color.a = 1.0;
COLOR = color;
}
}
}