[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/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 - making a better texture managment system for tenebrae

making a better texture managment system for tenebrae

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

making a better texture managment system for tenebrae

Postby revelator » Fri May 25, 2012 6:55 am

As the title says, im trying to refurbish tenebraes texture managment system.
So far i got most working but im stumbling on a few buggers so anyone willing to give a hand is most welcome.

Whats done so far:
Moved from using boolean checks to struct to avoid having a ton of different image upload code.
Added correct check for fullbrights on luma.
Updated zlib Png and Tga code to newest.

Bugs:
Moving the genNormalmap function from GL_UploadBump to GL_UpLoad8 breaks bumpmapping causing all kinds of weird behaviour with both bump and gloss (gloss in stripes vertical and horizontal).
Moving to a struct based system broke luma allthough i think it was allready broken. Fullbrights on plats doors etc. Fixed by doing a check for fullbrights in gl_model.c Mod_LoadTextures.
New Tga code can handle gray tga but im not sure if my size check (1 for gray 4 for color) works as expected. Png works like a charm though.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: making a better texture managment system for tenebrae

Postby taniwha » Fri May 25, 2012 12:44 pm

If you want, take a look at QuakeForge's tga code: it's very fast and for reading, fully implemented (I went through the spec), though I can't guarantee correctness for all cases.

Unless I'm mistaken, GL_UpLoad8 doesn't sound appropriate for normal maps, as they would be 3xN bit (usually 24) rgb (though I've heard of using alpha for height). I haven't tried to implement normal or bump maps yet, so I can't say more. However...
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: making a better texture managment system for tenebrae

Postby Spike » Fri May 25, 2012 9:04 pm

its fullbright if it uses the last 16 bytes of the palette. though you can measure how many fullbright palette indexes there should be by comparing different parts of the colormap.
I think fullbrights are generally additively blended, which is wrong really, but means that you can just use an rgb texture with the non-fullbright pixels coloured black.

tenebrae traditionally takes the regular 8bit paletted image, generates height as 4*palette index, then converts that height into normals.
whereas if you give it a _bump texture, it does exactly the same but doesn't multiply it by 4.
while a _norm texture is directly uploaded as-is. many existing _norm textures have the height at that pixel stored in the alpha channel for various sorts of offset mapping, but not sure tenebrae ever supported that.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: making a better texture managment system for tenebrae

Postby taniwha » Sat May 26, 2012 12:21 am

Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: making a better texture managment system for tenebrae

Postby Spike » Sat May 26, 2012 7:05 am

'right' is defined by what the content you're targetting uses. :P
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: making a better texture managment system for tenebrae

Postby taniwha » Sat May 26, 2012 10:19 am

True, thus the quotes :)
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: making a better texture managment system for tenebrae

Postby revelator » Sun May 27, 2012 9:29 pm

ok gonna use your input and try to improve on it :) thanks.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: making a better texture managment system for tenebrae

Postby revelator » Sun May 27, 2012 9:40 pm

btw tenebrae does no checking at all for fullbright in GL_Draw.c it just uploads the _luma image directly to GL_Upload32 with alpha set :S hence my comment about it being sortof broken initially.
Though the blend modes in GL_Rsurf.c and GL_Rmain.c should handle that. Something is going wrong though so i might have to move those out and into the actuall function for luma.
Tenebrae uses an odd system GL_Upload8 handles both normal bump and gloss maps besides checking for alpha pixels and doing palette conversions. So its a bit hard working with.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: making a better texture managment system for tenebrae

Postby revelator » Mon May 28, 2012 8:18 pm

slowly getting there...
fixed fullbrights on plats/doors still todo fullbright on models.
bit of texture corruption detected (might be my updated tga code hmm ???).
cubemap projection acts a little weird on the mirror effect (works fine for the lavaball effect).
seems my checking for fullbright on textures instead of relying on the blendmodes and user quality also fixed a long standing bug where the image went dark after being in slime/lava (odd one ?).
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: making a better texture managment system for tenebrae

Postby revelator » Tue May 29, 2012 7:40 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: making a better texture managment system for tenebrae

Postby revelator » Wed May 30, 2012 9:39 pm

Source code.


If someone could have a look it would be much appreciated as im running into a weird bug.
Try diving in slime and notice the lightmaps turning off... also happens with lava but not with water.

Source has project files for both msvc 2010 and codeblocks.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: making a better texture managment system for tenebrae

Postby revelator » Sat Jun 02, 2012 4:45 pm

agh ok the diving in slime lava thingy was the pain flash resetting the lightmap brightness tenebrae doesnt seem to take into account that it could have invalid values so i rewritten the entire thing.
another bug to look at is when changing level while being damaged the pain flash stays on in the next level ...

besides the above i think i managed to make it a whole lot better now.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: making a better texture managment system for tenebrae

Postby mh » Sun Jun 03, 2012 6:23 pm

Fullbrights - with an alpha/replace blend instead of add, check out the red pixels on the right-hand arrow leading to e1 in start.bsp - they're actually darker than if fullbrights were disabled (especially noticeable with a LIT file).

The formula I use is "final = max (diffuse * lightmap * overbright, fullbright)" which corrects this but - as Spike pointed out - won't work well with external textures which assume additive blending. IMO getting the native texture look correct should overrule that. Some day I'll do a second shader for externals.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: making a better texture managment system for tenebrae

Postby Baker » Mon Jun 04, 2012 2:43 am

The screenshot is all nifty looking and stuff. :D
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: making a better texture managment system for tenebrae

Postby revelator » Tue Jun 05, 2012 3:22 am

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

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest