Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Pages: [1] 2

Author Topic: Multi/Sub-Object Materials and Draw Calls  (Read 14208 times)

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Multi/Sub-Object Materials and Draw Calls
« on: March 11, 2015, 10:40:30 am »

I've just noticed that the draw calls are being affected by the material IDs in a strange way.
I did some quick tests using a single mesh with a Multi/Sub-Object Material assigned to it, which only uses one standard material.

First test:
- Material ID set to 1 and all polygons using ID 1.


Result:
Draw calls: 1
Package memory footprint in MB: 0.



Second test:
- Material ID set to 1000 and all polygons using ID 1000.


Result:
Draw calls: 1000
Package memory footprint in MB: 2.


I've also tested with more than one sub-material, but always the draw calls equals to the highest Material ID number. There can be five sub-materials, but if one of them have the ID set to 37 for example, then there will be 37 draw calls.

   Maybe the above isn't very practical, so here is a real situation:
I create a Multi/Sub-Object Material which has 17 standard materials.
I assign it to the main mesh which uses all 17 materials. This mesh will use 17 draw calls, so it's OK.
The problem comes now. I assign this Multi/Sub-Object Material to another mesh, but this mesh only uses the material IDs 5, 8, 9 and 11.
Once in Outerra, it uses 11 draw calls instead of only 4.

Is this behavior intentional, is it just a bug, or I am missing something?
Logged

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #1 on: March 11, 2015, 11:01:20 am »

Hi Levi can you send me the FBX of the model for test?
Logged

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #2 on: March 11, 2015, 11:05:46 am »

Alright, I'll send you via e-mail both FBX files, the one with ID set to 1 and the another one with ID set to 1000.
Logged

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #3 on: March 11, 2015, 11:06:06 am »

Thanks
Logged

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #4 on: March 11, 2015, 11:10:38 am »

No problem, thank you for looking at this issue.
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #5 on: March 11, 2015, 11:58:40 am »

Levi, youre building a heli ?
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #6 on: March 11, 2015, 12:52:03 pm »

Levi, youre building a heli ?
Good eye!
Yep, it's a heli, but I'm not exactly building it, just optimizing the meshes, adjusting smoothing groups, and stuff like that for the next conversion. :)
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #7 on: March 11, 2015, 03:03:57 pm »

Levi, youre building a heli ?
Good eye!
Yep, it's a heli, but I'm not exactly building it, just optimizing the meshes, adjusting smoothing groups, and stuff like that for the next conversion. :)

I see ... you really do not sleep at all !!  =D  =D
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #8 on: March 11, 2015, 03:52:57 pm »

Hi, Levi!

How can you know the number of draw calls  in OT?
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #9 on: March 11, 2015, 05:06:35 pm »

I see ... you really do not sleep at all !!  =D  =D
=D :))
Nah, I do actually sleep lately. Now I have less free time to work on the PC, than I used to have before...  :'(

Hi, Levi!

How can you know the number of draw calls  in OT?
If you have debug keys enabled in eng.cfg, just hit Alt+7 and the black window will show up, then look on the second row to see the draw calls.
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #10 on: March 11, 2015, 07:28:03 pm »

Thanks!!
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #11 on: June 25, 2015, 09:21:35 am »

Hi Ladislav,

This issue seems to be fixed now, well at least partly. I'm not sure if this is a bug or it's intentionally done this way.

Here's the issue: I have a Multi/Sub-Object material which contains multiple sub-materials. This Multi/Sub-Object material is being applied across different meshes.
Some meshes are using the sub-materials with ID:1 and ID:2. Until now it's all good and works as it should when imported into Outerra.
Now I apply the Multi/Sub-Object material to another mesh which is using let's say the sub-materials with ID:1 and ID:10. When imported into Outerra, the mesh is showing the sub-materials with ID:1 and ID:2 instead of ID:1 and ID:10.

Note: Intentionally and just for testing purposes, the ID:10 corresponds to a wrong sub-material, and it's supposed to show like that in Outerra.


Any thoughts on this?
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #12 on: June 25, 2015, 03:57:08 pm »

I have the same problem... Temporarily I had to separate the meshes by material and make a parent relation.
I have also noticed this do not happen with all the multi material objects...
« Last Edit: June 25, 2015, 03:59:44 pm by KW71 »
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

Levi

  • Hero Member
  • *****
  • Posts: 585
    • Outerra Mods Site!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #13 on: June 26, 2015, 06:10:48 am »

I have the same problem... Temporarily I had to separate the meshes by material and make a parent relation.
Yeah, that's a solution, but in my case I cannot separate the meshes (or I don't want to) because of various reasons.

I have also noticed this do not happen with all the multi material objects...
It works as it should if the mesh is using the IDs in the right order, for example the IDs 1, 2, 3, 4, 5. But if you want to use let's say the IDs 1, 3 and 5, then in Outerra will show IDs 1, 2 and 3.

The solution would be creating a Multi/Sub-Object material for each mesh, reusing the sub-materials of course. But this will create a mess within the material editor...
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: Multi/Sub-Object Materials and Draw Calls
« Reply #14 on: June 26, 2015, 10:00:35 am »

"Yeah, that's a solution, but in my case I cannot separate the meshes (or I don't want to) because of various reasons."

I agree with you; I'm doing it just provisionally.


It works as it should if the mesh is using the IDs in the right order, for example the IDs 1, 2, 3, 4, 5. But if you want to use let's say the IDs 1, 3 and 5, then in Outerra will show IDs 1, 2 and 3."

In Blender there are not IDs as in Max... You have to select the faces you as material X, then selet the material and apply to those faces... Or join (AKA Attach in Max) meshes with different materias... I'll check if the selection order befor joining affects the result.

Hopefully there is a solution.
Logged
"A man who is contented with what he has done, will never become famous for what he will do".
Pages: [1] 2