Multiple UV maps for objects / AO texture channel

bszlrd
Posts: 1096
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Multiple UV maps for objects / AO texture channel

Post by bszlrd »

I'm working on my station remake when I have a bit of time (and need for restful distraction from my diploma project), and I was thinking.
The current UV for the interior is almost done, but I already have problems with the island scales, and I'm afraid it won't be as detailed as I was imagining it (at 4096*4096). My main issue is that for a nice ambient occlusion/lighting bake, I need to do a proper UV, but that way I can't really use any tiling texture. With tiling texture only it will look kinda flat and massless (like the current stations).

So my question is, would it be possible to have different UV maps for different texture channels (diff, spec, glow, pattern) in the same material? So we can have a nice lower res AO with a properly UV-ed model, and a nice tiling texture atlas for the diff with reusable portions and more detail for the same resolution.
A texture atlas example from KSP, but with lighting information too (article). We could have more fidelity with separate lighting in my opinion:

I'm not sure if the glow map could be used with the AO bake, or it would be better to have a separate AO (with multiply) and glow channel but I'm guessing separate would be more flexible.

I want to make the big crappy remake to be modular, so we can build several different station form the same basis. Like smaller or larger docking area, multiple rings and stacked rings, etc. This multiple UV/AO channel thing would make it easier, and hopefully lower the resource consumption too, while allowing for better looks.

This would be useful for cockpit prefabs and with buildings in general too.

What do you think?
FluffyFreak
Posts: 1344
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Multiple UV maps for objects / AO texture channel

Post by FluffyFreak »

I think it can be done, well, I *know* it can be done :)
It'll take some shader work and probably a bit of poking with other logic etc.

Can you provide a test model with the dual-UVs defined? It doesn't have to be final quality, or even usable ingame, just something that has the properties you need that I can load up in the modelviewer.
bszlrd
Posts: 1096
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Re: Multiple UV maps for objects / AO texture channel

Post by bszlrd »

Here's a crappy little ship with two UV layers: :D
The dae exporter names the UV layers this way:
Cube_001-mesh-map-0 (for the AO)
Cube_001-mesh-map-1 (for the tiles - the colorful generated one from blender)

Already set up as a mod with the data from amphiesma. Sans tags.
Image
FluffyFreak
Posts: 1344
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Multiple UV maps for objects / AO texture channel

Post by FluffyFreak »

Doing this in OpenGL 2.x is a ballache, it'd be so much easier with access to glVertexAttribPointer :(

Whining and bitching aside... the AO multiplies the final colour doesn't it? At least that's how I got it to look that your example image :)
That was using the same UV coordinates though, I might need Luomu's help getting this working properly as I'm not getting 2nd set of UVs passed through into the shader. I'll try doing some more hacking at lunchtime.

EDIT: It's worth noting that this is the same bug that's stopping the terrain texturing work from progressing!

Then I'm going to start thinking about switching us to OpenGL 3.x! ;)
bszlrd
Posts: 1096
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Re: Multiple UV maps for objects / AO texture channel

Post by bszlrd »

Yes, it's multiplying. :)
FluffyFreak
Posts: 1344
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Multiple UV maps for objects / AO texture channel

Post by FluffyFreak »

I've gotten it working however the model needs to be modified to work.

The diffuse/specular/glow textures will always have to be the first UV channel, AO will be the 2nd.
That's because all meshes will have diffuse textures, but not all will have AO.
Supporting it the other way around will take quite some hacking.
bszlrd
Posts: 1096
Joined: Mon Jul 01, 2013 3:25 pm
Location: Budapest HU

Re: Multiple UV maps for objects / AO texture channel

Post by bszlrd »

Wow, that was quick. :) Thank you.
I can't keep up with this tempo, building the station. :D (And to give some teasing as a thanks: I've already modularized most of the interior of the station, and added several more pads, we're going to have 64 bays in this one.)
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Multiple UV maps for objects / AO texture channel

Post by robn »

nozmajner wrote:we're going to have 64 bays in this one.
We're gonna need more ships...
FluffyFreak
Posts: 1344
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Multiple UV maps for objects / AO texture channel

Post by FluffyFreak »

Yeah I tend to just drop whatever I'm working on if someone has an actual request that they can define.
Stuff like the "make combat better" is interesting but doesn't give you anything specific to work with. Add support for a 2nd set of UV coords to support ambient occlusion and allow for more modular modelling... that is concise, defined and can be implemented ;)

With 64 bays how are you finding creating all of the docking approaches and suchlike?
I wrote it and I still find it to be a real pain in the neck grouping things and laying it all out.
Is there something that would make it easier for modellers?
Would it be better to have just a single landing point? Maybe have the ship to just navigate itself to a fixed distance above that point rather than define the whole route in?

Suggestions welcome on that since a lot of people have started stations and no-one's really finishing them off :(
FluffyFreak
Posts: 1344
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Multiple UV maps for objects / AO texture channel

Post by FluffyFreak »

robn wrote:
nozmajner wrote:we're going to have 64 bays in this one.
We're gonna need more ships...
I think we're gonna need to rewrite Tradeships.lua then ;)
Post Reply