Inside3D!
     

Fullbright textures..

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon May 03, 2010 2:05 am    Post subject: Fullbright textures.. Reply with quote

Been messing around with this for a while. I want texture with the prefix "fb_" to be unaffected by the lightmap, but for some reason I can't figure it out.

Hopefully someone else can help me out here :/

No matter what I do, the lightmap either still renders on top of it, or the engine just takes a shit whenever the specific brush enters the player's PVS.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon May 03, 2010 2:35 am    Post subject: Reply with quote

replacement texture names:
mytexture_luma
mytexture_glow
one of them, depends on which engine you're using
some engines will use alphablending, others will use alpha testing. if you want it to look identical in both sorts of engines, use only 0% or 100% alpha, not anything between. Just avoid < 5%.

legacy textures:
the quake engine 'blends' lighting by looking it up in a table - the colormap.
Actually, GL engines don't use the colormap though. Instead most expect the last 32 palette indexes to be fullbright, and the others not (FTE attempts to look at the colormap to see how many were meant to be fullbright). This behaviour matches the output of software, but can fail if you have mods using custom palettes/colormaps. ID's glquake does not support fullbrights at all, thus you need a modified engine to get fullbrights in GL.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon May 03, 2010 2:39 am    Post subject: Reply with quote

Yeah, mate, I threw this in the Engine Programming subforum because I'd like to add it to my engine, heh.

I've looked through the brush loading code, as well as brush drawing, and I can't really figure this out. For the sake of argument, where would one have to look to add this to an unmodified GLQuake?
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon May 03, 2010 3:10 am    Post subject: Reply with quote

you would have to generate new textures.
find the pixels with 224+ values and pass them through unmolested. for everything else, clear out the alpha channel to 0.
then upload those 32bit textures.
the add an extra pass to the entire world where you draw only those fullbright textures, after any lightmapping effects.
on anything with more than 2 tmus you can use register combiners/multitexturing. set up the first three stages to do texture*lightmap+fullbright. and that should work on anything past a geforce2.
But yeah, multitexture isn't required. You can just enable blending and do it as an extra pass. GL is state-based so you'll need to undo state changes in order to fix the rest of the scene again.

Ideally, choose an engine that already has ARB multitexturing implemented and optimised.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon May 03, 2010 3:29 am    Post subject: Reply with quote

The PSP engine does lighting in a second pass. That's the engine I'm working with. Can't I simply mark certain textures as fullbright and ignore the second pass on them?

glpoly_t surface flags?
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon May 03, 2010 9:43 am    Post subject: Reply with quote

probably.
however, consider that that requires the entire texture to be full bright.
consider a dark room... actually, consider any room in quake... it has a light. a nice fullbright light. and the textured fitting around the light is just as bright as the bulb. but the floor right next to it is dark.
perhaps a better example is the fullbright runes on maps like dm4. but hey :)

you'll need to provide some way to tag such a fullbright texture as fullbright. by name would work, I suppose. check the miptex_t's name at load time and set a flag on the surface to skip it when rendering the lighting pass after.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Mon May 03, 2010 5:28 pm    Post subject: Reply with quote

be aware glquake has two codepaths (gl_texsort 1 and gl_texsort 0).

I believe texsort 0 uses multitexture for lighting, while texsort 0 does two passes. You'll have to make sure you add support to both codepaths to make it work for everyone.
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon May 03, 2010 11:25 pm    Post subject: Reply with quote

Again, lol, this is for the PSP.

I'm really only using this for a strange case in which I need it in order to accomplish a special effect I'm trying to replicate from another game. Honestly, I could even be doing it on the compiler's end and it wouldn't make a difference.

And, well, what I've been doing has been working from the start. I just thought it wasn't fullbright for some reason Rolling Eyes
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Tue May 04, 2010 2:18 am    Post subject: Reply with quote

lol downsider you should never doubt yourself , your too good at what you do.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Tue May 04, 2010 2:34 am    Post subject: Reply with quote

ceriux wrote:
lol downsider you should never doubt yourself , your too good at what you do.


Very Happy You should hop on AIM more =)

How's school?
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Tue May 04, 2010 9:15 pm    Post subject: Reply with quote

all forms of aim and what not is blocked here i cant even get on youtube =( no facebook no nothing, i3d used to be blocked on and off here and there too. they gave up though.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Wed May 05, 2010 1:18 am    Post subject: Reply with quote

ceriux wrote:
all forms of aim and what not is blocked here i cant even get on youtube =( no facebook no nothing, i3d used to be blocked on and off here and there too. they gave up though.


Have someone you know host a proxy for you, or host one at your house.
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Wed May 05, 2010 1:28 am    Post subject: Reply with quote

lol my house is far away from campus and i know no one besides me who would know how to host a proxy... -.-
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed May 05, 2010 8:16 am    Post subject: Reply with quote

tor?... though I'm guessing half the entry points are blocked - but maybe not all
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Wed May 05, 2010 9:02 pm    Post subject: Reply with quote

every proxy site iv tried on google has been blocked .
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group