[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - weird behaviour after changing to vertex arrays

weird behaviour after changing to vertex arrays

Discuss programming topics that involve the OpenGL API.

Moderator: InsideQC Admins

weird behaviour after changing to vertex arrays

Postby revelator » Fri Mar 10, 2017 6:18 am

I used the tut by MH for vertex arrays on an old project of mine, but i seem to run into some rather obscure problems.

Monster skins go all weird at certain angles (sometimes the texture dissapears completely) also model lighting on those seems to be affected making them flash wildly.

World and viewmodel textures seem unaffected :shock:

Any ideas what may cause this ?
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby revelator » Fri Mar 10, 2017 6:28 pm

Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby Spike » Fri Mar 10, 2017 8:00 pm

glClientActiveTexture(GL_TEXTURE0); ?
did you disable texturing, or bind the wrong texture? or enable some other sort of texture instead?
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: weird behaviour after changing to vertex arrays

Postby revelator » Sat Mar 11, 2017 1:19 pm

Joequake which was the base for this engine originally did quite a few texturing state changes to support luma and fullbright on alias models so yeah a borked
TMU somewhere would also be my guess, no luck so far hunting it down though :S
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby mh » Sun Mar 12, 2017 12:30 pm

Check your glTexEnv calls as well.

It's actually a good idea to set state before drawing rather than unset state after drawing. The latter approach can often leave unwanted left-over state that affects drawing of subsequent objects (or performance) in weird and unexpected ways. Stock Quake code is, unfortunately, full of it.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: weird behaviour after changing to vertex arrays

Postby revelator » Sun Mar 12, 2017 5:13 pm

No luck so far, might have a case of a bad blendfunc or texenv call from another function which the old immediate mode didnt catch.
I have a hunch this might become a real goose chase :S since i found the bugger in my realm engine was actually caused by a function which did not immediatly seem connected to such an issue. Atleast that one seems to work now, but changing to C++ after dabbling with Doom3 makes you forget the quirks in older C based engines. But i agree quake was quite the mess with things like that.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby revelator » Tue Mar 14, 2017 1:54 pm

Ok i put it on the backburner for the moment, my realm engine is getting quite nice allthough i do have a bit of a problem with fullbrights since MHQuake9 which i based it on used a somewhat different approach to that. It does lumas with no problem whatsoever but does not use the old way of checking alphamasked textures for fullbrights, instead all this has moved to gl_rlight.c where everything is precalculated. The nice thing is that i dont need another texture pointer, but its a bit confusing
to find out where fullbrights are actually calculated. One snag -> the lumas from qrp's monster skins are either broken or something else is acting up cause those skin lumas turn up fully black with realm :S strangely the same code works for everything else.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby Spike » Tue Mar 14, 2017 3:22 pm

its quite common for luma textures to have alpha=1 throughout (eg jpg-based lumas). This means you can't use traditional alpha blending, but rather you need to use glBlendFunc(GL_SRC_ALPHA, GL_ONE);
if you're using glTexEnv(...,GL_ADD) then you'll probably need to premultiply the alpha or something, so you can discard the alpha and add just the rgb parts.
yes, this implies that your 8bit textures should be filled with black in their fullbright ranges, to avoid double brightness.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: weird behaviour after changing to vertex arrays

Postby mh » Tue Mar 14, 2017 4:18 pm

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: weird behaviour after changing to vertex arrays

Postby revelator » Wed Mar 15, 2017 3:11 am

So the general idea is to darken the lumas ? well that one was new to me.

Ill give it a go with glBlendEquation thanks MH.

Oh before i forget, i noticed one thing, on some maps underwater fog goes bonkers with some surfs being completely unfogged while others are.
It happens pretty rarely so its hard to miss when it does turn up. One particular mod comes to mind that experiences this in some nasty ways is zerstoerer.
It seems to be related to vissed maps cause i noticed some other weirdness on maps that vis had some warnings on.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby revelator » Wed Mar 15, 2017 6:16 am

Another P.s replacing skins on bmodels only works with md3 ? or is there some other trick i can use.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: weird behaviour after changing to vertex arrays

Postby mh » Wed Mar 15, 2017 10:21 am

No, the idea isn't to darken the lumas.

Darkening the lumas is the bad behaviour that happens with other methods. Using a max blend doesn't darken the lumas.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: weird behaviour after changing to vertex arrays

Postby revelator » Wed Mar 15, 2017 1:49 pm

Ok thought i had entered an alternate dimension there :lol: tried the method you described but my entire screen goes white :shock: so instead i tried with some older models that had luma textures and they work so either the code is very picky with correct masks or those textures need work.

Btw i stumbled upon some rather neat replacment models for quakes monsters :) mighty detailed. Especially the shambler,
he looks scary as hell tbh. Im not asure who the author is, found them on some russian only site. Ill upload a few pics some time.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger


Return to OpenGL Programming

Who is online

Users browsing this forum: No registered users and 1 guest