I'm making a game and it have circles in ground for some special units, the problem comes that those circles are semi-transparent, but when they overlap, the overlaped area is more opaque... what i want to archivere is getting all circles, even when they overlap, to maintain the same alpha level
What i get in red, what i want in green:
http://imageshack.us/photo/my-images/339/targety.png
http://imageshack.us/f/706/screen00002c.png
Transparency issues
Moderator: Moderators
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Transparency issues
Check out the function HighlightPylons in this gadget and then gl.Utilities.DrawGroundCircle.
Re: Transparency issues
i tried that and i talked about it with jK but the result is "almost" same
EDIT
im going to check again when i finish rewriting my gadget, until that i cant test
EDIT
im going to check again when i finish rewriting my gadget, until that i cant test
Re: Transparency issues
Resurrection finished... Returning to base..., before yeling me that this is a old thread, i dont want to open a new thread for the same topic...
After the long time i returned with the ground circle thing, and after much time
i cant solve this...
As you can see in the image, when the circles overlap their alpha gets added
After the long time i returned with the ground circle thing, and after much time

As you can see in the image, when the circles overlap their alpha gets added

Code: Select all
local cylinder = gl.CreateList(GG.GL_Utilities.DrawMyCylinder,0,0,0,1,1,16)
local function DrawCircles()
local minheight, maxheight = spGetGroundExtremes()
for _, node in spairs(SYNCED.NodeList) do
if (node.type == "node" and node.ready) or (node.type == "citadel" and node.landed) then
local r,g,b = spGetTeamColor(spGetUnitTeam(node.id))
gl.Color(r, g, b, GROUND_ALPHA)
local x,y,z = spGetUnitPosition(node.id)
local radius = node.area
gl.PushMatrix()
gl.Translate(x, minheight, z)
gl.Scale(radius, (maxheight-minheight)*3 , radius)
GG.GL_Utilities.DrawVolume(cylinder)
gl.PopMatrix()
end
end
end
function gadget:DrawWorldPreUnit()
if NodeChange or not CircleList or not LinkList then
if (CircleList) then
glDeleteList(CircleList)
end
CircleList = glCreateList(DrawCircles)
NodeChange = false
end
gl.CallList(CircleList)
end