project-navigation
Personal tools

Author Topic: Normalmaps Updates [WIP]  (Read 12102 times)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Normalmaps Updates [WIP]
« on: April 22, 2010, 03:47:54 am »
Here come the normalmaps...
Although they are not tested yet  ;)
« Last Edit: April 29, 2010, 12:23:39 am by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #1 on: April 22, 2010, 12:48:31 pm »
FYI:
This topic was just opened for experimental purposes...
(You cannot see any of this here in-game (yet))  ;)

Offline Sepelio

  • Rookie
  • ***
  • Posts: 37
    • View Profile
Re: Normalmaps Updates
« Reply #2 on: April 24, 2010, 06:15:46 pm »
They look pretty good to me :)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #3 on: April 24, 2010, 06:40:50 pm »
Unfortunately I cannot test those in-game yet & had some strange experiences, like H-Hour also, regarding normalmaps in-game, but I am quite confident that arisian will eliminate all bugs, enhance our mesh-system so will be able to see those & others in-game soon...

Sepelio, I saw your youtube-channel & your tutorials... You seem to be a cool guy with lots of experience & you should help us out & build or enhance some maps, really...

We need modellers, mappers & gfx-artists to push this game forward here & you seem to be all of this together  ;)...

I am sure you also have some nice textures we could use...

Join our struggle to make 2.3 a top hit !!!  ;)
« Last Edit: April 24, 2010, 08:15:32 pm by MCR »

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: Normalmaps Updates
« Reply #4 on: April 24, 2010, 08:23:24 pm »
I'm working on it, but don't hold your breath while you wait ;)

It's going to require a more major overhaul of the current rendering system to get this incorporated than the previous changes I've made.  The major difficulty is that I don't want to change the way that existing content looks, or require any existing content to be re-created in some new format.  The glow-textures were strictly an "add-on," but there's already code that handles bumpmapping for brushes, and it doesn't work in a way that can be directly applied to meshes (as it requires several extra textures that, so far as I can tell, get built with the map at map-compile-time).  That means I need to be very careful in the way that I handle things so I don't break existing content.  If I didn't care about preserving backwards-compatibility, it would be easy, but that's really not an option here, for all the obvious reasons.  So be patient; I'm confident I'll eventually figure out a way to do this that won't break anything, but it will take time because I need to be sure I fully understand how everything is working now in order to be sure I don't alter the way it looks to the user even if I'm changing the way it works behind the scenes.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #5 on: April 24, 2010, 08:48:59 pm »
Okay, I'm starting to breathe again  :P ;)

I feared a little bit to ask the question how state of affairs regarding this matter is @ the moment, but I am very glad you answered this for me...
Take your time & just shout if I can help with testing, creating normalmaps or whatever...
It seems the engine is handling several things in very different ways, as for example glowmaps for the bodies of the soldiers & aliens did not work, but for their heads they worked (both md2)...
So I understand that this is not an easy task, but it will simplify stuff much, if you would succeed in bringing this all together under one roof & under control of the material system...

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #6 on: April 27, 2010, 10:16:19 am »

"YOU DID IT !!!"  ;D  8)


I have to share the new feature arisian & mattn bring us with the public here...

btw., the normalmaps for Bloodspider & Ortnok shown in these screenshots are all ready to be put into trunk ;)

See here: https://sourceforge.net/tracker/?func=detail&aid=2991758&group_id=157793&atid=805244

So here they come -

THE FIRST IN-GAME SCREENSHOTS OF OUR MODELS WITH THEIR NEW NORMALMAPS
(All Credit Goes To Arisian & Mattn, our coding geniouses ;))
« Last Edit: April 27, 2010, 10:18:01 am by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #7 on: April 27, 2010, 10:21:42 am »
More... (Bloodspider & Ortnok in Light Armor [from the same patch like above])

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #8 on: April 27, 2010, 10:37:36 am »
For the developers here I want to note that there is still some strange stuff going on regarding the normalmapping code, like H-Hour already pointed out some time ago...

I do not think that this is the fault of the normalmaps I made, although I cannot be 100% sure of that, but I noticed that the normalmap I made for the landmasses of the earth works perfectly & without any flaws whatsoever...

But on the battlescape normalmaps are showing some strange behaviour... It IS possible nevertheless that I did something wrong with the height encoding & the alpha channel as you cannot use the normalmap plug-in for GIMP with the option height-encoding in the alpha-channel, when you make normalmaps with many layers, so I engineered another method to encode the height after the overlays are merged together (more info here: http://ufoai.ninex.info/forum/index.php?topic=4666.msg36421#msg36421 )

So here some screenshots of this strange behaviour & also a screenshot of one of Sitters original normalmaps already included with his model (does not look correct either):

I can try to make the height of the maps smaller, maybe that is the fault, as I am usually making 30+ Overlays with a height of -0.1 each & then merge them...
I will try some experiments here with less layers & height -0.01. Maybe this works (I do not want to change the method of creation as the overlay method brings the best & most detailed results) !?

Any tips from normalmap & heightmap experts would be appreciated...
« Last Edit: April 27, 2010, 10:40:42 am by MCR »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates
« Reply #9 on: April 27, 2010, 10:46:27 am »
Here a normal texture with applied normalmap  :'(

What bugs me is that the normalmapping of the earth works PERFECT ?!
Is this a different code ?

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates [THEY FINALLY DID IT !!!]
« Reply #10 on: April 27, 2010, 10:57:08 am »
I cannot start building the normalmaps until I am 100% sure to know what I am doing & how to do them perfectly, but I also do want to use the overlay method described here:

http://cgtextures.com/content.php?action=tutorial&name=normalmap

I want to adapt this method to work perfectly with our normalmapping code...
Otherwise we will not be able to create normalmaps with such a ultra-high level of details...

Normalmapping Experts - Your Help Is Needed Here !
« Last Edit: April 27, 2010, 12:56:05 pm by MCR »

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: Normalmaps Updates [THEY FINALLY DID IT !!!]
« Reply #11 on: April 27, 2010, 02:42:53 pm »
First off, I just want to point out that the code is still a work in progress, and shouldn't be considered representative of what to expect yet.  That said, the normalmaps for the geoscape and the normalmaps for the battlescape are not actually handled the same way.  The reason for this is that the geoscape uses orthographic projection, and the battlescape uses perspective projection.  The alpha channel of the geoscape normal maps is actually used to specify specular reflectiveness; the alpha channel of the battlescape normal maps is used to specify height (for parallax, which is meaningless for orthographic projections).

There are also some issues with the models; all the normal vectors for the verticies of the earth on the geoscape are correct, and nicely smoothed.  It's easy to get them right, because it's a sphere.  For the arbitrary meshes in the battlescape, there are places where two triangles share a vertex (in the actual .md2 file) but where smoothed normals look very strange.  This results in surfaces where the mesh looks flat but the normals look curved; while this is nice for smoothing things that *should* be curved, it looks strange when applied to sharp corners.  I'm planning on writing some code to attempt to de-construct and re-construct models to fix this, but haven't done so yet.

Another issue is that the light sources are generally not in locations that make any sense.  This is because up until now they never had any effect on the actual appearance of things.  The lighting system is going to need some work before things will really start to look good.

Finally, load-times in the latest build are long; this should be fixed soon.  Right now all the normal and tangent vectors are being calculated at runtime, but Mattn is working on a tool to compute them off-line and store them in data files.  Once he's done, load times should go back to the way they were before.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Normalmaps Updates [THEY FINALLY DID IT !!!]
« Reply #12 on: April 27, 2010, 02:50:24 pm »
it would be nice if you could also add the normalmap information you posted here to the wiki article at http://ufoai.ninex.info/wiki/index.php/Artwork#Normalmaps

the tool is almost done - just one minor issue to solve and c::b project files. maybe i find the time in the evening. it would be nice if you could have a look at ufomodel.c (especially into the WriteToFile function) whether the file layout makes sense for you.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Normalmaps Updates [THEY FINALLY DID IT !!!]
« Reply #13 on: April 27, 2010, 02:58:58 pm »
YOU ARE THE MAN !

Thanks for explaining things. Now I understand better, because I checked just from observation that it is a different code...

There is enough other stuff to do, so there is no need for me to know everything now & I suggest you give me a wink when code ready for testing is finished & we can find out then which normalmap making method will be able to deliver the most beautiful, most stunning & correctly looking gfx...

/offtopic on
arisian could you maybe tell me which tool is able to produce 12 or 16 bit pngs ?, as I am able to make 1, 2, 4, 8, 24 & 48 bit pngs only & 256 colors are not enough to deliver what I want to have, ideal would be to have 4096 & 65536 colors also...
/offtopic off

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Normalmaps Updates [THEY FINALLY DID IT !!!]
« Reply #14 on: April 27, 2010, 03:22:35 pm »
Thanks for the work on all this arisian and mattn. It's hard on the "artists" side to comprehend all the work that goes into making an object look like an object, and we often forget how incredibly complex it can be to take an image, wrap it around an organic-looking model, then move all the vertices around.

I am reminded of Clark's third law: "Any sufficiently advanced technology is indistinguishable from magic."