project-navigation
Personal tools

Author Topic: New Feature: "Glow" textures  (Read 57312 times)

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #90 on: April 19, 2010, 07:53:24 pm »
Mattn,

Try applying this patch, and then post the output for me.  I'm thinking that maybe somehow the glowmap pointers that should be NULL are winding up pointing to arbitrary memory on your system; that would account for everything being glowy (since the pointer is used to check if a glow texture exists), and it would also account for the rainbow-colors (since the contents of that memory segment would be arbitrary).  I'm not sure exactly how that's even possible, but that would be my best guess at a cause.   Actually, why don't you post your copy of r_image.c while you're at it, just so I can make sure nothing odd is going on.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Feature: "Glow" textures
« Reply #91 on: April 19, 2010, 08:17:05 pm »
here is the log

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Feature: "Glow" textures
« Reply #92 on: April 19, 2010, 08:20:04 pm »
oh, and no local changes here - so my r_image.c is the one that is in the svn

btw. did you revert my changes for glow map loading for it_world and it_skin intentionally?

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #93 on: April 19, 2010, 10:31:32 pm »
Yes, I did revert those changes because they were preventing the loading of other types of glow-map images that we wanted.  Also, as I recall, the way it was written it didn't actually load glowmaps for it_world images, either (because it was an "else if" clause after one that had checked for it_world).  At the moment, I don't see the harm in testing for glowmaps for all images; we might want them eventually.  If you'd like to add some restrictions back in, we can do so.

And your logfile seems normal as far as i can tell, which means I'm still stumped by your magical-rainbow glow.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Feature: "Glow" textures
« Reply #94 on: April 20, 2010, 07:31:43 am »
i will try to run valgrind on a map with postprocessing activated - will keep you informed

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #95 on: April 20, 2010, 10:51:39 am »
I made a (decent) glowmap for the interior of the Herakles dropship (base/models/aircraft/drop_herakles).
Attached is the 'posterized % color-palette reduced version' of the glowmap already (reduced size from 6.62 to 1.83 kb):
« Last Edit: April 20, 2010, 01:16:14 pm by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #96 on: April 20, 2010, 11:57:51 am »
Some other important information for the glowmap makers out there  ;):

If you want to influence the glow via the glowmap texture it makes no difference which brightness the colors have there (on my computer).
You can influence the color of the glow though with the colors you choose in your glowmap...
If you want to make the glow less intense via the texture you have to delete some pixels in your glowmap or make the glowing areas smaller...

Here a example of this:
1st picture: appearance in-game
2nd picture: glowmap of the fighters engines
« Last Edit: April 20, 2010, 05:47:51 pm by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #97 on: April 20, 2010, 12:04:17 pm »
I will adjust the glowmaps of ufo-fighter & ufo-scout for the default glow-strength of 1.0 to make them glow less intense & more detailed & will also use the method described in the post below to optimize their filesize  ;)...
« Last Edit: April 20, 2010, 01:25:25 pm by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #98 on: April 20, 2010, 12:28:00 pm »
Important Information II:

Everyone making glowmaps should use the posterize function of his/her image-editor to reduce the colors effectively used by the glowmap.
As the brightness of the colors does have no effect in-game on my computer @ all, even the most complicated (rainbow) glowmaps should never have to use more than 256 colors...
So after posterizing your glowmap you should reduce the color-palette used to @ least 8bit = 256 colors.

This will help us reducing filesize needed by our glowmaps in a massive way.

Most of the glowmaps will use less than 10 different colors I suppose, our green fighter-engines glowmap for example can be reduced from 24 to 2.78 kb (!) using this method without changing the effect in-game...

With this optimization our glowmaps will be loaded into memory real fast  ;)...
« Last Edit: April 20, 2010, 05:44:37 pm by MCR »

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #99 on: April 20, 2010, 04:55:05 pm »
Actually, the brightness of your texture *will* affect the brightness of the glow.  As an example, take the following two screenshots; the only difference was which version of the plasrifle_gm texture was used.  As you can clearly see, the glow is brighter in the second screenshot, due to the fact that the colors in the glowmap are brighter in the second version of the texture.

It should still generally be possible to reduce the colorspace, given that the majority of models shouldn't have that many different colors of glow (Mattn's computer aside).  If you're using PNGs, there are even automated tools that will do the colormap for you (eg. pngrewrite).

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #100 on: April 20, 2010, 05:28:31 pm »
Hey arisian,

really great work you delivered here. Fun to play with.  ;)
Sorry if I misinterpreted my first test results... :-\ But this is my experience on my computer here.

I did not fake those pictures here, I swear  ;):

http://ufoai.ninex.info/forum/index.php?topic=4674.msg37078#msg37078
 :-[

Nevertheless I am sure that you are right, but IMO it is still a good idea to reduce the colorpalette of the glowmaps to make them small & fast to load & this automated tool you mentioned can be very interesting. I will check that one out...

Now I do not know what to do with my previous posts regarding this, because I do not want to create false myths about this here  ::)...

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #101 on: April 20, 2010, 05:33:10 pm »
I downloaded your plasma-rifle glowmap pngs to check them out & they do not have an alpha channel ?!

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #102 on: April 20, 2010, 05:51:29 pm »
arisian, it would be very nice if you could test the fighter_engines_gm.png from my above post on your computer, then I will know for sure that something is wrong here  :-\

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New Feature: "Glow" textures
« Reply #103 on: April 20, 2010, 05:53:46 pm »
Glowmaps don't need an alpha channel. The brightness of the texture is the glow intensity (so black is no glow).

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #104 on: April 20, 2010, 06:04:59 pm »
Here is the latest version of the U.F.O. Scout (color-reduced, palette-reduced ultrasmall filesize glowmaps).

I also looked @ the suggestions that came from BTAxis & Kildor & reduced the glow to make it less intense...
Also I deleted the glow from several buttons to make the glow effect look more diverse & interesting there...

It would be nice if someone could test this: