project-navigation
Personal tools

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

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #30 on: April 18, 2010, 06:50:43 pm »
Okay, I've got a basic proof-of-concept for glowing textures associated with meshes.  SVN r29460 contains the new code, along with a new image, base/models/weapons/plasrifle/plasrifle_gm.png.  The texture I've included was made very simply; I just copied the standard texture, did a color-select on the blue parts, and painted everything else black.  I also reduced the intensity somewhat.  I'm sure that our artists can do better than this, but my goal was just to demonstrate what was possible, and how easy it should be for the artists.  All you need to do is have a glowmap texture associated with any standard mesh texture.  If the mesh is called <modelname>.jpg, you just need an image called <modelname>_gm.jpg (or .png or whatever) in the same directory.  It will automatically be loaded and interpreted as a glowmap, in much the same way that a normalmap would work.  Currently, glow-maps will only get renderd when they're associated with meshes, but it should be fairly straightforward to extend the system to other types of surfaces as well.

Again, adding a glow texture doesn't require any changes to code, or the model, or anything; just drop an image with  "_gm" at the end of the object's name ("gm" for "glowmap"; we can change the abberiation if people don't like "gm"), and everything else should be handled automatically.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #31 on: April 18, 2010, 07:00:15 pm »

Great News !!!

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New Feature: "Glow" textures
« Reply #32 on: April 18, 2010, 07:01:13 pm »
Pretty slick. There are a bunch of meshes that could benefit from this.

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: New Feature: "Glow" textures
« Reply #33 on: April 18, 2010, 07:09:16 pm »
Looks good Arisian. I've got a non-mesh texture that I'd like to use this on in the future when (if?) it gets extended to the material system for map textures. Would it help you if I supplied a test map/textures to work with for this?

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #34 on: April 18, 2010, 07:32:46 pm »
Maybe it is my fault, but I compiled the latest rev & now all models seem to glow ?!

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #35 on: April 18, 2010, 08:16:13 pm »
MCR, are you getting any abnormal output in the log?  It works fine for me, but I only have one system to test on.  Have you tried doing `make clean` and then re-building everything?

Oh, also, I've just noticed that using the IR goggles seems to de-activate the mesh-glow, though the mesh-glow resumes as soon as the IR-goggle effect stops.  I'll look into why, but it shouldn't be a show-stopper in any case. Should be fixed now.
« Last Edit: April 18, 2010, 08:28:05 pm by arisian »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #36 on: April 18, 2010, 08:27:45 pm »
I recompiled (now 29465, before 29460), but only tested this on one computer also. I did not compile the maps.

& yes, I have a strange output in the ufoconsole.log:
R_ProgramVariable: Could not find GLOWMAP in program mesh (some hundreds of lines of this error)

I hope this helps...
« Last Edit: April 18, 2010, 08:30:01 pm by MCR »

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #37 on: April 18, 2010, 08:29:26 pm »
MCR, could you attach the file "base/shaders/mesh_fs.glsl" that you have right now?

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #38 on: April 18, 2010, 08:32:35 pm »
Here:

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #39 on: April 18, 2010, 08:34:59 pm »
It doesn't look like your copy of mesh_fs.glsl is the latest version.  Have you made any modifications of your own to that file?  If not, try deleting it and then doing an "svn update" to make sure you've got the latest version.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: New Feature: "Glow" textures
« Reply #40 on: April 18, 2010, 08:36:52 pm »
Okay, but I did not modify anything there  ???, somehow the svn update did not update that file... Thanks for helping.
« Last Edit: April 18, 2010, 08:41:17 pm by MCR »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: New Feature: "Glow" textures
« Reply #41 on: April 18, 2010, 09:15:52 pm »
i suppose it shouldn't look like this :)

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: New Feature: "Glow" textures
« Reply #42 on: April 18, 2010, 09:18:41 pm »
Um...wow.  How on earth did you get that?  It's actually kind of pretty...I've got no idea how that "rainbow" effect is happening.  Is it constant, or do the colors change?  Are you getting anything in the log?  And are all the shaders up to date?

Offline DiDiT

  • Squad Leader
  • ****
  • Posts: 149
  • Your local Flame-thrower wielding Furry.
    • View Profile
Re: New Feature: "Glow" textures
« Reply #43 on: April 18, 2010, 09:21:03 pm »
LOL! looks like the commander is TRIPPING! ;D

EDIT: Also, RAINBOW COW!  :D
« Last Edit: April 18, 2010, 09:39:52 pm by DiDiT »

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New Feature: "Glow" textures
« Reply #44 on: April 18, 2010, 10:03:42 pm »
I would just like to say it's looking fine here.