Page 2 of 2
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 16 Feb 2010, 21:01
by imbaczek
got more fixes done. turns out /water 1 and /water 3 were leaking texture memory - glBindTexture(GL_TEXTURE_2D, 0) fixed them. removed immediate mode from there for great justice.
moral: clean up after yourself...
edit: i guess i'll have to change the topic - from 'do not' to 'avoid if possible because they can leak but not always do and i don't know when it happens'.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 16 Feb 2010, 21:35
by hoijui
they up required system specs of their games.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 16 Feb 2010, 21:36
by Argh
I just tested CA's customformations2... it doesn't draw anything. I am kinda scratching my head- the Widget's working, just nothing happens when it goes through DrawWorld, etc. This is on nVidia hardware. My stuff with GroundCircles works atm, but I'm wondering if I should remove the stipples, etc. to avoid crashes with ATi or not.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 16 Feb 2010, 21:38
by imbaczek
lemme check that out. edit: master+ca 6796 (stable) works for me.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 16 Feb 2010, 21:45
by Argh
That's bad news for me, then. I haven't the foggiest what could be breaking it.
Had another thought- instead of using LINES, we could use QUAD_STRIP and use a shader to move the texture coordinates every draw frame. That's probably what the pros are doing.
[EDIT]Tested with latest version from CA... it draws in the minimap, but nothing shows up in DrawWorld.[/EDIT]
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 16 Feb 2010, 22:05
by Argh
Moving the draw call to DrawWorldPreUnit() fixed the not-drawing issue over here. Probably some screwup on my part.
Hmm. Here's another thought. May be useless, but... has anybody tried explicitly declaring gl.Texture(0,false) as a safety precaution before invoking GL.LINES? Maybe ATi's drivers are just being really picky about attempting to texture lines... sorry if that sounds crazy, but in all my "fun" experiences with ATi's drivers, it mainly seems like their engineers are obsessed with adhering to the strict letter of the specifications, whereas nVidia's a little more... understanding about these things.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 17 Feb 2010, 09:17
by imbaczek
i think you may be onto something. haven't tried it though.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 18 Feb 2010, 23:31
by imbaczek
it seems catalyst 10.2 fixed this problem. need independent confirmation.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 19 Feb 2010, 01:38
by Argh
Even so... you know how people are about drivers... it'd be safer to just make sure that the behavior can't happen, tbh.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 19 Feb 2010, 06:13
by det
imbaczek wrote:it seems catalyst 10.2 fixed this problem. need independent confirmation.
I can confirm that.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 19 Feb 2010, 09:21
by imbaczek
Argh wrote:Even so... you know how people are about drivers... it'd be safer to just make sure that the behavior can't happen, tbh.
absolutely, engine fixes for both command lines and water are in master.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 19 Feb 2010, 09:42
by Argh
Wow, that was fast! GJ people!
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 19 Feb 2010, 11:48
by hoijui
baczek had the idea before you mentioned that on the forum.
... somehow even ... finished it before you mentioned it!

(time travel involved?!?)
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 21 Feb 2010, 11:58
by dizekat
You could emulate immediate mode to some extent in engine (for Lua), by storing all the attributes into an array and drawing it on glEnd. The inconvenient part is determining what attributes are actually used (this could be how driver itself screws up. I've a suspicion the immediate mode is emulated like this in the driver). You could simply allow just the colour attribute and nothing else.
This could be made optional just for the ATI.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 21 Feb 2010, 12:57
by imbaczek
there are even libraries for that, specifically targeting opengl es implementations.
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 21 Feb 2010, 20:03
by lurker
There is no replacement in lua? Why can't it use a display list?
Re: ATTN: do NOT use GL_LINES and immediate mode
Posted: 21 Feb 2010, 20:10
by Kloot
Because display lists are not suited as a replacement for IM (being immutable).