Author Topic: grab you pills and prepare for a coronary  (Read 17910 times)

0 Members and 1 Guest are viewing this topic.

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
grab you pills and prepare for a coronary




aw crap, I just looked at the images, jpg compression sucked the life out of them

anyway I've gotten glow mapping to work just now, as far as I can tell it isn't slowing down rendering too much,
to enable it simply make a version of a texture as you would like it to look if completly unlit give it the exact same name with "-glow" taged onto the end of it, I'm going to spent the next few hours makeing glowmaps for a bunch of ships becase there fairly easy to do

there is still a bit of tweaking to do with the alpha values and such, suprizeingly this was realy simple to implement (note it was implemented at the API level for direct X only I recomend one of you OGL boys get a similar effect soon, after a bit more tweaking I am going to commit and post an explaination of how I did it), note this is _not_ a luminance map, it is infact a form of multi-pass textureing, I repete the final step in the rendering proces with verts that have had there lighting values set to fullbright and useing additive alpha, I made an index of glow maps for each texture, the maps are loaded when a texture is loaded for a pof,
remember, it looks for texture_name"-glow"

I just realised I never tested this out in game, you wan'a give it a shot ;7
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
grab you pills and prepare for a coronary
Bob, that's some damn sexy work. :D Very nice. Makes Shivans spookier. :)
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Knight Templar

  • Stealth
  • 212
  • I'm a magic man, I've got magic hands.
grab you pills and prepare for a coronary
Quote
Originally posted by Mikhael

Bob, that's some damn sexy work. :D Very nice. Makes Shivans spookier. :)


:nod:  :yes:
Copyright ©1976, 2003, KT Enterprises. All rights reserved

"I don't want to get laid right now. I want to get drunk."- Mars

Too Long, Didn't Read

 

Offline Turnsky

  • FOXFIRE Artisté
  • 211
  • huh?.. Who?.. hey you kids, git off me lawn!
    • The Foxfire Chronicles
grab you pills and prepare for a coronary
Hmmm, the code is strong in this one.


anywho, nice work, i might give it a try..
The Foxfire Chronicles[/b]

   //Warning\\
---------------------------------------------------------------------------------
do not torment the sleep deprived artist, he may be vicious when cornered,
in case of emergency, administer caffeine to the artist,
he will become docile after that,
and less likely to stab you in the eye with a mechanical pencil
-----------------------------------------------------------------------------------

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
grab you pills and prepare for a coronary
give me a minute and I'll have most of the ships remapped
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Fury

  • The Curmudgeon
  • 213
grab you pills and prepare for a coronary
I wonder what kind of FS2 we're playing next Christmas... :eek:

Well done Bobboau! :yes:

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
grab you pills and prepare for a coronary
there we are
ok, got the right version of the files up,
is the exe working for everyone?

that should keep you prety good, I got most (not all) of the maps that realy need illumination,
now I'm not sure how this is going to affect performence (the effect is only on the highest LOD, this is up to you to maintain if you desire), every poly is geting rendered twice (note it isn't geting transformed lit rotated and everything twice), I'm gona do  some testing and go to sleep, tomaro I'll upload the code
holy crap! I have been up for over 25 hours!!!
« Last Edit: January 04, 2003, 05:41:36 am by 57 »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Fetty

  • 27
grab you pills and prepare for a coronary
*hands bob a bottle of booze*
great work :nod:

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
grab you pills and prepare for a coronary
there seems to be one decal related bug, I'm gona pave over for the time, I'm going to get a more finlized version working and also I'm going to post all the code I changed to make this work

at the very end of gr_d3d_tmapper_internal, directly below d3d_DrawPrimitive(...blahblahblah...);
Code: [Select]
//this is my hack to get some sort of luminence mapping-Bobboau
if(GLOWMAP[gr_screen.current_bitmap] > 0){

gr_screen.gf_set_bitmap(GLOWMAP[gr_screen.current_bitmap], GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.0f);
if ( !gr_tcache_set(gr_screen.current_bitmap, tmap_type, &u_scale, &v_scale, 0, gr_screen.current_bitmap_sx, gr_screen.current_bitmap_sy )) {
mprintf(( "Not rendering a texture because it didn't fit in VRAM!\n" ));
return;
}

gr_d3d_set_state( TEXTURE_SOURCE_DECAL, ALPHA_BLEND_ALPHA_ADDITIVE, zbuffer_type );

for (i=0; i {
d3d_verts[i].color = RGBA_MAKE(255, 255, 255, 0);
}
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
}


ok right at the end of the main for loop in the ID_TXTR loading section of read_model_file
Code: [Select]

//a quick hack for glow mapping-Bobboau
strcat( tmp_name, "-glow");
mprintf(("looking for glow map %s\n", tmp_name));
GLOWMAP[pm->textures[i]]=bm_load( tmp_name ); //see if there is one
if(GLOWMAP[pm->textures[i]]!=-1){//then fill it into the array
mprintf(("texture '%s' has a glow map, %d, assosiated with it, isn't that nice\n", tmp_name, GLOWMAP[pm->textures[i]]));
bm_lock((GLOWMAP[pm->textures[i]]), 8, BMP_AABITMAP);
bm_unlock((GLOWMAP[pm->textures[i]]));



int GLOWMAP[MAX_BITMAPS] = {-1};

goes into BmpMan.cpp

extern int GLOWMAP[MAX_BITMAPS] ;

goes into BmpMan.h

add    GLOWMAP[n] = -1;//make sure to load a glow map after you have loaded a texture
 at the end of bm_load()
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Ypoknons

  • Ancient
  • 28
    • http://www.xwaupgrade.com
grab you pills and prepare for a coronary
Yeh! :D Wondering whether this could be done with decals too.
Long time ago, you see, there was this thing called the VBB and... oh, nevermind.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
grab you pills and prepare for a coronary
I did just get an asertion failure, but it seems to be running fairly smooth otherwise, I also think I may have solved the decals killing the framerate thing,
I'm gona see if I can track that assertion failure down before makeing a relese build and posting this on the main boards.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
grab you pills and prepare for a coronary
agh, to hell with it I'll fix it tomaro, I'm makeing a relese build and posting a zip on the main forum
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
grab you pills and prepare for a coronary
"french kisses bobboau"
"vomits, but feels better anyway"

Rahhhh! The ONE thing I really wanted, that I kept asking for!!!
"builds a shrine to worship bob"
SCREW CANON!

 

Offline ZylonBane

  • The Infamous
  • 29
Re: grab you pills and prepare for a coronary
Quote
Originally posted by Bobboau
I repete the final step in the rendering proces with verts that have had there lighting values set to fullbright and useing additive alpha
How is the end result different from just rendering -glow textures fullbright in the first place?
ZylonBane's opinions do not represent those of the management.

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
grab you pills and prepare for a coronary
bah, the damn debug file stops at all the tbl anotations :blah:
I'll wait for a clean exe.
SCREW CANON!

 

Offline Solatar

  • 211
grab you pills and prepare for a coronary
Please put this in the next version of fs2_open. Please!


Damn nice.:D

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
grab you pills and prepare for a coronary
im gonna hack this into ogl now


edit: looks like bob has to commit before i do something.
« Last Edit: January 04, 2003, 01:57:49 pm by 31 »
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk

 

Offline Turnsky

  • FOXFIRE Artisté
  • 211
  • huh?.. Who?.. hey you kids, git off me lawn!
    • The Foxfire Chronicles
grab you pills and prepare for a coronary
well the man has to sleep....
The Foxfire Chronicles[/b]

   //Warning\\
---------------------------------------------------------------------------------
do not torment the sleep deprived artist, he may be vicious when cornered,
in case of emergency, administer caffeine to the artist,
he will become docile after that,
and less likely to stab you in the eye with a mechanical pencil
-----------------------------------------------------------------------------------

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
grab you pills and prepare for a coronary
i worked out something for opengl, but i want the other stuff committed before i test it out

edit: 1/8/03 -- updated code

in gr_opengl_tmapper_internal()

Code: [Select]

...
int bitmapidx=gr_screen.current_bitmap % MAX_BITMAPS;
int do_glow=(GLOWMAP[bitmapidx] > 0);

...

if ( flags & TMAP_FLAG_TEXTURED )       {
if (do_glow)
{
//mprintf(("rendering a glow texture %s\n", bm_get_filename(GLOWMAP[bitmapidx])));
glPushAttrib(GL_TEXTURE_BIT);
glActiveTextureARB(GL_TEXTURE0_ARB); //texture is bound in gr_opengl_tcache_set
glEnable(GL_TEXTURE_2D);
texture_source=TEXTURE_SOURCE_DECAL;
}

if ( !gr_tcache_set(gr_screen.current_bitmap, tmap_type, &u_scale, &v_scale, 0, gr_screen.current_bitmap_sx, gr_screen.current_bitmap_sy ))
{
mprintf(( "Not rendering a texture because it didn't fit in VRAM!\n" ));
return;
}

if (do_glow)
{
gr_opengl_set_state(texture_source, alpha_blend, zbuffer_type);
gr_set_bitmap(GLOWMAP[bitmapidx], GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.0f);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
texture_source=TEXTURE_SOURCE_ADD;
//texture is bound in gr_opengl_tcache_set
if ( !gr_tcache_set(gr_screen.current_bitmap, tmap_type, &u_scale, &v_scale, 0, gr_screen.current_bitmap_sx, gr_screen.current_bitmap_sy ))
{
mprintf(( "Not rendering a texture because it didn't fit in VRAM!\n" ));
return;
}
gr_opengl_set_state(texture_source, alpha_blend, zbuffer_type);
}
...

if ( flags & TMAP_FLAG_TEXTURED )       {
tu = va->u*u_scale;
tv = va->v*v_scale;
if (do_glow)
{
//use opengl hardware multitexturing
glMultiTexCoord2fARB(GL_TEXTURE0_ARB,tu,tv);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,tu,tv);
}
else
{
glTexCoord2f(tu, tv);
}
}


in read_model_file()
fixed bounding errors

Code: [Select]

...
strcat( tmp_name, "-glow");
int glow_idx=pm->textures[i] % MAX_BITMAPS;
mprintf(("looking for glow map %s\n", tmp_name));
GLOWMAP[glow_idx]=bm_load( tmp_name ); //see if there is one
if(GLOWMAP[glow_idx]!=-1){//then fill it into the array
mprintf(("texture '%s' has a glow map, %d, assosiated with it, isn't that nice\n", tmp_name, GLOWMAP[glow_idx]));
bm_lock((GLOWMAP[glow_idx]), 8, BMP_AABITMAP);
bm_unlock((GLOWMAP[glow_idx]));

}
« Last Edit: January 08, 2003, 05:01:47 pm by 31 »
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk

 

Offline Anaz

  • 210
grab you pills and prepare for a coronary
:eek2: :eek2: :eek2: :eek2:

good god...the shivans as never before...

*imagines the result of this + tbp's ambient light fix*


not only can this be used for freaky shivans, but it also could be used (in the future probably) for making cap ship lights look bright...
Arrr. I'm a pirate.

AotD, DatDB, TVWP, LM. Ph34r.

You WILL go to warpstorm...