project-navigation
Personal tools

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

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
New Feature: "Glow" textures
« on: April 12, 2010, 04:23:57 pm »
I figured I'd post this over here, rather than in the coding forum, since it's really more of an art question.

I'm planning on introducing the ability to have real-time glow/bloom effects in the battlescape, similar to what I've done for the geoscape (see screenshot).  The coding I can handle, but before that code is useful, it will require some decisions about how to use it with the artwork.

There are essentially two different ways that we can do glow.  The first is to do HDR (high-dynamic-range) rendering, in which case things will "glow" when they're brighter than the maximum brightness that can actually be displayed by your monitor (ie. if the value for the red channel is greater than 255, the "extra" red will spill over into neighboring pixels on the display).  This is how things work in the newer Halflife2 games, for example (though they do some other more complicated things as well, like adjusting the centering of the visible-dynamic-range on the fly).  New art wouldn't be required immediately, but this would wind up changing the appearance of things that were already in the game.  Given that the current textures weren't designed for HDR, this could create some issues that would require fixing textures and/or lighting to get things looking right again.

The other option is to do glow in a style that has come to be known as "Tron" style glow, since it was pioneered by the game Tron 2.0.  The idea here is that you can associate an optional extra texture with a model, much like you would a normal-map, which specifies what regions of the model should glow (along with color and intensity).  This wouldn't change the look of the game initially, but would require new art to define what should be changed and what should be left the same.

My personal preference is for the second option, at least initially (I may implement them both eventually), because it allows a much greater degree of artistic control, and I think it will fit well with the atmosphere of the game.  Having the "bright green" portions of UFOs glow, for example, seems like a natural extension of the current artistic style.  It would probably even be possible to have simple animations in which the glow-texture was varied over time, allowing things like pulsing or other fun visual effects.

The caveat, however, is that this would require new art.  Any model that didn't have an associated "glow" texture simply wouldn't glow.  This would mean that glow textures could be added slowly; the game wouldn't break because they weren't there, but new textures would have to be created before the new effects actually appeared in game.

Thoughts?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Feature: "Glow" textures
« Reply #1 on: April 12, 2010, 04:51:54 pm »
i would vote for hdr - but i don't know the latter technique at all. if we decide to use the latter we can add support for the mesh models very easy, and for the brushes this should go via material system.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Feature: "Glow" textures
« Reply #2 on: April 12, 2010, 04:54:10 pm »
oh.. the reason why i would prefer the hdr stuff is that we don't require new artwork - we are already low on artists. so we should try to do things in a way that the existing people around this project can achieve to handle it. (again, i don't know what the latter render technique would need in terms of artwork to work and look good)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: New Feature: "Glow" textures
« Reply #3 on: April 12, 2010, 05:01:29 pm »
I vote for control over implementation rather than automated implementation (which is what I take the first method to be). I think such effects are great when used appropriately, but can be overused, like this, when every light starts to give off a ridiculous, un-natural glow. Such effects are, IMHO, best used for abstracted visuals, like the geoscape overlays. As I said, they can be used for cool effects in the battlescape, which is not supposed to have an abstracted sense of space (at least as much of one), but only in the right situations.

It's worth nothing that my opinion comes from someone who won't see the effects anyway, since I don't have a gfx card that supports that sort of stuff.

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #4 on: April 12, 2010, 05:11:26 pm »
The two techniques actually differ most in terms of what types of visual effects they allow for.  The HDR method allows for things like very brightly illuminated objects to "glow" when the lighting model calculates that the "correct" output value for a pixel is a higher value than can be displayed (ie. is greater than 1.0).  The Tron method allows for specific objects (or parts of objects) to glow regardless of lighting conditions, simply because an artist specified that they should (ie. the glow is an innate part of the object, not a result of illumination).

For the Tron-style glow, how much work would be required would depend entirely on how much stuff we wanted to have glow :)

Essentially, for any object that should have glowy-bits, you would need a new texture associated with the "standard" texture for that object.  Basically, this would work the same way that a normal-map works; just an optional extra image file with the proper suffix on its name.  That extra image would specify glow in the same way that the "standard" texture specifies diffuse reflections.

The work I did in the geoscape is actually a mish-mash of the two types; the earth itself glows using the HDR method (if you rotate the planet right, areas like ice caps or deserts will show a slight "bloom"), but the glowing borders for the nation overlay uses the Tron method, and the atmosphere uses some of each.

BTW, I'm not that familiar with the battlescape rendering system, but I don't think we should really need to add support for new meshes or brushes or anything; all we need to do is allow matterials to be associated with a glow-map the same way they currently get associated with a normal-map.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #5 on: April 12, 2010, 05:19:55 pm »
I do not agree on this, Mattn  :-[  ;)
Have you seen the pictures of how this tron 2.0 style looks like ?!
I think it looks great.
It is true that we do not have many graphic artists currently active, but we do not need everything glowing like in tron 2.0.
IMHO we should use this just for specialFX, Alientech & other futuristic stuff, but most of the stuff currently on the maps would not glow. Adjusting some textures to make glow-texture-overlays should not be such a hard task with those few high-tech textures we currently have. I am speaking out of experience here, just having created 3000 animation frames ;)
Also these maps should not be to complicated to make IMHO, because as I understand they wouldn't even need to be seamless as long as the glowing is happening somewhere 'inside' of the overlay...

I do not know how it looks with our models though  ::)

I think this would fit to the new animations & we should think about how to best combine all this stuff ;)

& regarding the lacking forces helping this project out I already wrote a feature request, but this is offtopic here ;)

arisian could you please take a look @ the animations I made & tell me how we could combine our workforce  ::)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #6 on: April 12, 2010, 05:26:49 pm »
btw, I think one very important feature regarding the battlescape is currently missing - the models do not have shadows, this bugs me a lot, because sometimes they just look like 'copied in'. If you could take a look @ this issue also, arisian, that would be a big hit IMHO...

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #7 on: April 12, 2010, 05:35:27 pm »
@Mattn: You told me something about 1024 texture slots for the whole game including geoscape. I do not know about those limits, maybe you could elaborate on this, because I think I am running into some kinds of limits with the animation frames already & with additional overlay-textures we would fill our available slots pretty fast...  ::)

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #8 on: April 12, 2010, 06:20:08 pm »
In terms of "number of textures loaded," it is possible to use an un-used channel of an existing texture to specify glow information (ie. the way I used the alpha channel of the globe textures for nighttime illumination).  Do the standard textures make use of the alpha channel?  Do the normal maps?  If not, we could use one of those channels to specify glow.  We would sacrifice the ability to specify glow color (we would just have to assume that the glow color was whatever color was present in the underlying "standard" texture), but it would mean we wouldn't have to store an extra texture in memory.  The other potential downside of this method is that it requires us to use image file formats that support an alpha channel, and it can make it a pain to work with the images, since you have to separate the color channels from the alpha channel every time you want to edit the image, and then re-combine them when you're done.  Just using extra image files for the "glow" textures is a lot more straightforward and will make like easier for everyone, but it does come at the cost of having to load the extra textures into memory.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #9 on: April 12, 2010, 06:33:36 pm »
AFAIK the normalmaps use the alpha channel to store the height information & my animation frames all use the alpha-channel, but just to 'hold the overlays in the correct position' (meaning the alpha channel is more or less empty)...

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #10 on: April 12, 2010, 06:34:25 pm »
The standard textures do not make use of the alpha channel @ all  ;D

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #11 on: April 12, 2010, 06:50:56 pm »
Maybe we could define the color of the glow via the material system, like Mattn already suggested, just like we currently define the color of a flare  ::)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #12 on: April 12, 2010, 07:48:13 pm »
btw, here is a link to the game arisian mentioned, showing the gfx fx quite nicely:
http://www.youtube.com/watch?v=P0tSo1xldRc&feature=related  8)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #13 on: April 12, 2010, 07:55:16 pm »
I wanna note here that these are quite impressive effects even without detailed textures (this is rather old stuff), you have to imagine this style combined with normalmaps & highly detailed textures & animations ::)
I think this could upgrade our graphics in a massive way, when used wisely (just for future-, alien- & spacetechnology), but I also can imagine tuning the coming modern 2084 cities with these glow effects to make them look more futuristic ;)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #14 on: April 12, 2010, 08:04:04 pm »
'I Am A User !'  ;D
Some more from Tron 2.0 & its lightFX:

http://www.youtube.com/watch?v=OiLA1q4ky-c&feature=related