Author Topic: Multiple mapping channels (for materials)  (Read 3674 times)

0 Members and 1 Guest are viewing this topic.

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Multiple mapping channels (for materials)
I think it's awesome The E is working on materials now. This will be a huge step forward in terms of what we can show the players.
There will also be a lot of room to optimize content or create very efficent new content.


One thing I'd like to bring up again, which should go hand in hand with the material system is the mapping channel feature.
Mapping channels can be used for a lot of very interesting things.
Just to name two very basic ueses: Detail textures, baked lightmaps.

There is way more beyond that. Multiple mapping channels can be incredibly useful for effects as well.


To make full use of the materials/custom shaders, we need to think about how additional mapping channels should be added to the POF format and how the engine will handle them. Of course without support from PCS2 or the new ModelView all efforts would be wasted.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Multiple mapping channels (for materials)
seconded.

it would make it trivial to add normal mapping to ships that were textured without normal mapping in mind. you could retain overlapping uv space in your textures, but then remap the ship with exclusive uv space for normal mapping. you could do decal mapping, so you could bake decals into the texture in real time instead of spawning a bunch of polies. there are many things this could be used for.

but it will require a pof revision. which puts this on the slow path. for now at least make the materials system ready for the upgrade.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Multiple mapping channels (for materials)
I feel bad for constantly requesting features concerning the visuals...


However I'm pretty sure the lack of support for multiple mapping channels will be the first harsh limitation the modders will run into when they create their own shaders.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Multiple mapping channels (for materials)
this would pretty much go hand in hand with the proposed material system thingy, just add an option to pass arbitrary graphic files (dds/tga/whatever the engine supports in this area) to the shaders.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Multiple mapping channels (for materials)
Actually, the only thing necessary for this to work is for the pof format to support more than one set of UV coordinates per texture. The material system is already designed to handle arbitrary textures being passed to it; the only thing it doesn't handle is alternate UV coordinates, which are needed for this.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Multiple mapping channels (for materials)
Right.


I talked to a few coders about this quite a while ago.
It actually sounded very possible to implement. I think Kazan said the POF format already allows storing this extra data. Builds without support for multiple channels should even be able to read the POFs as well.

The ony question was what exactly should be stored.

If PCS2 is to support it, we should talk about the best way to store the uv data for the engine.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Multiple mapping channels (for materials)
problem with this feature is that it would require a simultaneous upgrade to pcs2 to even test it. reverse compatibility with the older pof specs would be the biggest issue. i like the idea because it would allow us to better normal map older ships which were not designed with normal mapping in mind without having to completely redo them.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Multiple mapping channels (for materials)
So you just want to import additional uv data without re-converting the mesh?

I guess that's a bit more complicated, but for the PCS guys to decide.




You're right about the problem. I'd say the POF side of things should be done first, so The E has something to work with.
We could even already prepare meshes now that way.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Multiple mapping channels (for materials)
So you just want to import additional uv data without re-converting the mesh?

I guess that's a bit more complicated, but for the PCS guys to decide.

i was kinda thinking about old pre-converted meshes, i keep all mine on file for future proofing's sake, and i bet every other modder keeps their pre-converted work lying on some backup somewhere for the same reason. problem with the older meshes is that they recycle uv space for identical objects. this was common practice back in the old days. applying normal maps to those is a nightmare, because so much stuff is overlapped. i was just saying that instead of re mapping and re texturing the whole model, you just create a new uv map in another channel and assign each polygon unique uv space (some modeling programs can actually do this automatically). so you can keep all your uv space and textures of the original model. it would also promote diffuse texture area reuse in newer models, so you can take better advantage of pixel space in diffuse maps. you also would not need as much spacing between polygons, that normal maps require.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Multiple mapping channels (for materials)
Yeah, what's needed here is just a way to store an arbitrary number of UV coordinates (although I think that 2 or 3 sets are enough), and a tag for the texture that tells the engine which set to use.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Multiple mapping channels (for materials)
@Nuke

Sure that would work. It just goes against my policy of creating more efficient content.
In the end it means you add another set of UVs and a second normal map, just to avoid work.


It's ok for objects that have to use tile maps anyway, like capital ships or huge asteroid, but not for fighters.

--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Multiple mapping channels (for materials)
@Nuke

Sure that would work. It just goes against my policy of creating more efficient content.
In the end it means you add another set of UVs and a second normal map, just to avoid work.

with materials and mapping channels that would not be the case. you would essentially be using a single normal map which would be using the second channel, while your diffuse/glow/shine/env maps all use the first channel. the idea is you take an older model, and can apply a perfect normal map to it with a minimum of work. you still have to create a very high poly model to generate normal maps with, and that can be a monumental task all by itself. the alternative is to completely redo the model. and i have a few of those in the pipeline.

im facing a huge challenge, normal mapping many many models that were not designed with normal mapping in mind. they were uv mapped in order to get the most out of the pixels space. anything that could be doubled or tripled up is. sections are not spaced sufficiently to allow normal mapping programs to do their job. overlapping areas leave horrific artifacts. i could redo the uv mapping and the textureing, but at that point you might as well redo the model. anything to speed up modernization of old content will bring me that closer to being able to make new content.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Multiple mapping channels (for materials)
it would be as fine and efficient for fighters as it would be for anything else.

there needs to be multiple UV coordinates and there needs to be an ability to assign multiple textures to a material. the POF's BSP structure is going to need to be upgraded, and there will need to be a new chunk that assigns multiple textures to a material.

I believe I gave Swifty a copy of my experimental material system build from a long time ago that had a lot of the under the hood changes made, not that it would be directly usable but it might be useful in figuring some things out.
« Last Edit: November 14, 2010, 04:26:02 pm by Bobboau »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Multiple mapping channels (for materials)
Wouldn't The E's material system allow me to use as many textures as I want, even with just one set of UVs?

Maybe I just want to create a weapon effect with two maps, using different UVs translations, being additively rendered on top of each other.
From what I read, I thought that should be possible even with the current POF specs.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Multiple mapping channels (for materials)
The material system will allow you to use an arbitrary* number of textures, but it's currently limited to one set of uv coordinates only (Because the rest of the system is limited that way).

But: Adding new UV coordinates will require a pof format version bump. Let's take a look at the definition here:
Code: [Select]
3 - TMAPPOLY - Textured polygons
+ 0 int id = 3
+ 4 int size
+ 8 vector normal
+20 vector center
+32 float radius
+36 int nverts
+40 int tmap_num
for each vertex, i {
 ushort vertnum[i]
 ushort normnum[i]
 float u[i]
 float v[i]
}

The last part is what needs to be changed to:

Code: [Select]
for each vertex, i {
 ushort vertnum[i]
 ushort normnum[i]
 int num_uv_channels
 for each uv channel, j {
   float u[i][j]
   float v[i][j]
  }
}
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Multiple mapping channels (for materials)
Wouldn't The E's material system allow me to use as many textures as I want, even with just one set of UVs?

Maybe I just want to create a weapon effect with two maps, using different UVs translations, being additively rendered on top of each other.
From what I read, I thought that should be possible even with the current POF specs.

short answer would be yes, this particular effect you are refering to would be possible, but if you wanted multiple textures overlayed on top of each other, for instance a UV mapped texture like what has been popular the last few years, AND a tile map that is blended with the first texture to hide low resolution artifacts you would need at least two uv maps. it would also be nice to be able to reference the vertex position as a UV coordinate, but that should be doable in shaders currently.

that brings up an issue, it would be nice to define some universally available textures, like some noise texture, and be able to reference that in any materials.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

  

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Multiple mapping channels (for materials)
I was just looking for that, thanks.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together