Skip to content

Commit

Permalink
Merge remote-tracking branch 'bar/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron committed Dec 21, 2024
2 parents b2e3077 + 1f8184d commit 1ad515e
Show file tree
Hide file tree
Showing 44 changed files with 417 additions and 887 deletions.
2 changes: 1 addition & 1 deletion common/platformFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local function checkRequires(allRequires)
return false
elseif req == 'shaders' and not hasShaders then
return false
elseif req == 'fbo' and not hasVBO then
elseif req == 'fbo' and not hasFBO then
return false
end
end
Expand Down
19 changes: 2 additions & 17 deletions luaui/Widgets/Shaders/attack_range_gl4.vert.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ uniform float lineAlphaUniform = 1.0;
uniform float cannonmode = 0.0;
uniform float fadeDistOffset = 0.0;
uniform float drawMode = 0.0;
uniform float inMiniMap = 0.0;


uniform sampler2D heightmapTex;
uniform sampler2D losTex; // hmm maybe?
Expand Down Expand Up @@ -145,7 +143,7 @@ void main() {
// rotate the circle into unit space, wierd that it has to be rotated on other direction
float maxAngleDif = 1;
float mainDirDegrees = 0;
if (MAXANGLEDIF > 0.0) {
if (MAXANGLEDIF != 0) {
maxAngleDif = fract(MAXANGLEDIF);// goes from 0.0 to 1.0, where 0.25 would mean a 90 deg cone
mainDirDegrees = MAXANGLEDIF - maxAngleDif;// Is the offset in degrees.
}
Expand Down Expand Up @@ -251,22 +249,14 @@ void main() {

//--- DISTANCE FADE ---
vec4 camPos = cameraViewInv[3];

// Note that this is not the same as the distance from the unit to the camera, but the distance from the circle to the camera
float distToCam = length(modelWorldPos.xyz - camPos.xyz); //dist from cam
// FadeStart, FadeEnd, StartAlpha, EndAlpha
float fadeDist = visibility.y - visibility.x;

if (ISDGUN > 0.5) {
FADEALPHA = clamp((visibility.y + fadeDistOffset + 1000 - distToCam)/(fadeDist),visibility.w,visibility.z);
} else {
FADEALPHA = clamp((visibility.y + fadeDistOffset - distToCam)/(fadeDist),visibility.w,visibility.z);
}

if (inMiniMap> 0.5){
FADEALPHA = 1.0;
}

//FADEALPHA = clamp((visibility.y + fadeDistOffset - distToCam)/(fadeDist),visibility.w,visibility.z);

//--- Optimize by anything faded out getting transformed back to origin with 0 range?
Expand Down Expand Up @@ -307,12 +297,7 @@ void main() {
//worldPos = circleWorldPos;
//worldPos.a = RANGE;
alphaControl.x = circlepointposition.z; // save circle progress here

if (inMiniMap < 0.5) {
gl_Position = cameraViewProj * vec4(circleWorldPos.xyz, 1.0);
} else {
gl_Position = mmDrawViewProj * vec4(circleWorldPos.xyz, 1.0);
}
gl_Position = cameraViewProj * vec4(circleWorldPos.xyz, 1.0);

//lets blend the alpha here, and save work in FS:
float outalpha = OUTOFBOUNDSALPHA * (MOUSEALPHA + FADEALPHA * lineAlphaUniform);
Expand Down
39 changes: 0 additions & 39 deletions luaui/Widgets/Shaders/weapon_range_rings_unified_gl4.frag.glsl

This file was deleted.

Loading

0 comments on commit 1ad515e

Please sign in to comment.