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.

Author Topic: Applying two textures to the same geometry?  (Read 12234 times)

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Applying two textures to the same geometry?
« on: January 27, 2015, 07:36:50 pm »

Is there a way to add two different materials to the same geometry? I tried importing a model with composite materials but Outerra only imported the first one. I tried adding a duplicate entry to the MTL file but with different texture settings but again it only took notice of the first one.

Having this work would also solve anyone's opacity maps problems.
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 763
  • Love OT!
Re: Applying two textures to the same geometry?
« Reply #1 on: January 27, 2015, 10:48:48 pm »

Yes, it is possible, confirmed in Blender and Max. If you are working in max, use multimaterial, not composite. Asign a different setID to to the faces.

EDIT:

Guess I misunderstood. If you mean blending textures (adding, multiplying... etc.), I guess not.
« Last Edit: January 27, 2015, 11:46:49 pm by KW71 »
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Applying two textures to the same geometry?
« Reply #2 on: January 28, 2015, 02:31:17 am »

There is another problem, if ya want to hide some stuff then, it takes just the first material of the mesh - simply said, OT is on single mesh - single material. (i think it actually separates them then during import, but ya cant then do much whyte the other material part of the mesh, as it assigns it to something unknown) But still, it isnt much of a problem to split things up a bit further and add a few more materials. (you just have to think such things trough during modelling)
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.

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Applying two textures to the same geometry?
« Reply #3 on: January 28, 2015, 07:06:15 am »

But still, it isnt much of a problem to split things up a bit further and add a few more materials. (you just have to think such things trough during modelling)

Unfortunately the texture that needs a different MTL setting to the base one is comprised of intermittent pixels and so the mesh can't be separated for it.
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Applying two textures to the same geometry?
« Reply #4 on: January 28, 2015, 08:48:58 am »

But still, it isnt much of a problem to split things up a bit further and add a few more materials. (you just have to think such things trough during modelling)

Unfortunately the texture that needs a different MTL setting to the base one is comprised of intermittent pixels and so the mesh can't be separated for it.

 ... and making the thing several times whyte different materials, witch you swap out whan ya need it ? (hiding one mesh, showing other)
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.

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Applying two textures to the same geometry?
« Reply #5 on: January 28, 2015, 09:11:49 am »

... and making the thing several times with different materials, witch you swap out whan ya need it ? (hiding one mesh, showing other)

I'm not sure I follow. I should probably explain the purpose.

For some reason high transparency and no_light  = true results in the material not being affected by environmental lighting. This allows for non-emissive lightmaps to be made.

So here I have my base texture with normal settings


My lightmap texture with modded settings during the day


And my lightmap texture with modded settings at night


If my base texture uses modded settings the whole model is unaffected by light and looks bugged. What I'd like to do is have two entries in my MTL file that apply to the same geometry. One would be for the normal base texture and the other for the transparent lights. That way it looks normal during day and night. Because individual lights are mere pixels wide I can't split the mesh along the boundaries of the lightmap.
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: Applying two textures to the same geometry?
« Reply #6 on: January 28, 2015, 01:32:34 pm »

Looks like Uriah got the solution as he explained in the screenshot thread. If i get it right, you would need to duplicate the mesh and give one the no light=true  attribute in the .mtl and the other no light= false . But then i think you also need to add some distance between the two with the transparent one on top.
Logged

Uriah

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 569
  • We do these things not because they are easy. -JFK
Re: Applying two textures to the same geometry?
« Reply #7 on: January 28, 2015, 01:47:17 pm »

That is correct, you will need a second mesh, just a few centimeters above the first with the illumination map applied to the second mesh. This mesh could be low poly too FYI. Or you could just make a mesh and cut out all the illuminated areas so the rest of the mesh isn't included, that might work best. If you choose to just duplicate the first mesh, here is what I suggest. Copy the original mesh, select all faces and extrude group a define distance. You'll have to experiment, but I've found this distance can be quite small, a cm or even less.

Use opacity map channel as illumination, (white=illum, black=non-illum), and also "alpha_masked" to true so only the illuminated areas are visible. In the day time the illumination mesh will be completely transparent, so you won't notice it is there. Angrypig said the real illumination map is nearly done, so hopefully this won't be necessary in the near future. Send me a PM if you need help, and if you send me your OTX I can edit the material to work correctly if you require.

Best regards,
Uriah
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Applying two textures to the same geometry?
« Reply #8 on: January 28, 2015, 02:40:17 pm »

It is quite possible, that Cameny has something in mind to enable illumination textures aside normal ones, but it will be probably after the lighting update ... till then, i guess, having a second mesh for the illuminated parts is the only thing.
« Last Edit: January 28, 2015, 03:23:39 pm by PytonPago »
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.

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Applying two textures to the same geometry?
« Reply #9 on: January 28, 2015, 02:58:57 pm »

That is correct, you will need a second mesh, just a few centimeters above the first with the illumination map applied to the second mesh.

That'll work for regular objects but for any object that double-backs on itself or has opposing extrusions some will be shifted out of position. However I found that an exact duplicate of the mesh works just fine. Because my glow maps are nothing but the lights and a black background it's very easy to make the black transparent so it doesn't obscure the original mesh underneath. No z-fighting either.
Logged

Uriah

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 569
  • We do these things not because they are easy. -JFK
Re: Applying two textures to the same geometry?
« Reply #10 on: January 28, 2015, 03:08:25 pm »

Interesting, I had problems where the meshes coincide, I will have to experiment more with that.

Regards,
Uriah
Logged