Skip to content

Commit

Permalink
Fix clockwise triangles at MakeTexRectVAO and gui_metalspots. (#4066)
Browse files Browse the repository at this point in the history
Fix clockwise triangles.
  • Loading branch information
saurtron authored Dec 27, 2024
1 parent 590c3c8 commit 33c25c2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions luaui/Widgets/Include/instancevbotable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1283,11 +1283,11 @@ function MakeTexRectVAO(minX,minY, maxX, maxY, minU, minV, maxU, maxV)
rectVBO:Upload({

minX,minY, minU, minV, --bl
minX,maxY, minU, maxV, --tr
maxX,maxY, maxU, maxV, --tr
minX,maxY, minU, maxV, --tl
maxX,maxY, maxU, maxV, --tr
maxX,minY, maxU, minV, --br
minX,minY, minU, minV, --bl
maxX,minY, maxU, minV, --br
})

--[[rectVBO:Upload( {
Expand Down
2 changes: 2 additions & 0 deletions luaui/Widgets/gfx_bloom_shader_deferred.lua
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ local function Bloom()
df = df + 1
gl.DepthMask(false)
gl.Color(1, 1, 1, 1)
gl.Culling(true)

glUseShader(brightShader)
glUniform( brightShaderIllumLoc, illumThreshold)
Expand Down Expand Up @@ -633,6 +634,7 @@ local function Bloom()

gl.Blending("reset")
gl.DepthMask(false) --"BK OpenGL state resets", was true
gl.Culling(false)
end

function widget:DrawWorld()
Expand Down
2 changes: 1 addition & 1 deletion luaui/Widgets/gfx_norush_timer_gl4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function widget:DrawWorldPreUnit()
end
end

glCulling(GL.FRONT)
glCulling(true)
glDepthTest(false)
gl.DepthMask(false)

Expand Down
4 changes: 3 additions & 1 deletion luaui/Widgets/gui_metalspots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ local function makeSpotVBO()
arrayAppend(VBOData, {billboardsize, billboardsize, 1, 2})
arrayAppend(VBOData, {-billboardsize, 0, 1, 2})
arrayAppend(VBOData, {billboardsize, billboardsize, 1, 2})
arrayAppend(VBOData, {-billboardsize, 0, 1, 2})
arrayAppend(VBOData, {-billboardsize, billboardsize, 1, 2})
arrayAppend(VBOData, {-billboardsize, 0, 1, 2})
end

spotVBO:Define(#VBOData/4, VBOLayout)
Expand Down Expand Up @@ -519,6 +519,7 @@ function widget:DrawWorldPreUnit()
local clockDifference = (os.clock() - previousOsClock)
previousOsClock = os.clock()

gl.Culling(true)
gl.Texture(0, "$heightmap")
gl.Texture(1, AtlasTextureID)
gl.DepthTest(false)
Expand All @@ -532,6 +533,7 @@ function widget:DrawWorldPreUnit()
needsInit = false
end

gl.Culling(false)
gl.Texture(0, false)
gl.Texture(1, false)
end
Expand Down
8 changes: 4 additions & 4 deletions luaui/Widgets/map_startbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ local fullScreenRectVAO
local startPolygonShader
local startPolygonBuffer = nil -- GL.SHADER_STORAGE_BUFFER for polygon

local function DrawStartPolygons(inminimap)
local function DrawStartPolygons(inminimap)
local advUnitShading, advMapShading = Spring.HaveAdvShading()

if advMapShading then
Expand All @@ -322,7 +322,7 @@ local function DrawStartPolygons(inminimap)

startPolygonBuffer:BindBufferRange(4)

gl.Culling(GL.FRONT)
gl.Culling(true)
gl.DepthTest(false)
gl.DepthMask(false)

Expand All @@ -339,7 +339,7 @@ local function DrawStartPolygons(inminimap)
gl.Texture(2, false)
gl.Texture(3, false)
gl.Texture(4, false)
gl.Culling(GL.BACK)
gl.Culling(false)
gl.DepthTest(false)
end

Expand Down Expand Up @@ -504,7 +504,7 @@ local function DrawStartboxes3dWithStencil()

gl.CallList(startboxDListStencil) --// draw

gl.Culling(GL.BACK)
gl.Culling(true)
gl.DepthTest(false)

gl.ColorMask(true, true, true, true)
Expand Down
2 changes: 1 addition & 1 deletion luaui/Widgets/map_startpolygon_gl4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ local function DrawStartPolygons(inminimap)

startPolygonBuffer:BindBufferRange(4)

gl.Culling(GL.FRONT)
gl.Culling(true)
gl.DepthTest(false)
gl.DepthMask(false)

Expand Down

0 comments on commit 33c25c2

Please sign in to comment.