Transparency issues

Transparency issues

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Cubex
Posts: 56
Joined: 11 Jul 2012, 00:07

Transparency issues

Post by Cubex »

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
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Transparency issues

Post by Google_Frog »

Check out the function HighlightPylons in this gadget and then gl.Utilities.DrawGroundCircle.
User avatar
Cubex
Posts: 56
Joined: 11 Jul 2012, 00:07

Re: Transparency issues

Post by Cubex »

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
User avatar
Cubex
Posts: 56
Joined: 11 Jul 2012, 00:07

Re: Transparency issues

Post by Cubex »

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 :oops: i cant solve this...
screen00008.png
my nightmares
(1.51 MiB) Downloaded 3 times
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
Post Reply

Return to “Game Development”