Jump to content


Photo

Skins and nodraw materials


6 replies to this topic

#1 R Soul

R Soul

    Member

  • Member
  • PipPip
  • 122 posts

Posted 26 May 2018 - 06:34 PM

I'm currently making a custom button, in the style of the one we see in "the other game", but I've hit a snag. I want to provide the option of using a skin to give the button a label (e.g. floor number for a lift).

 

The metal housing and the button are in one texture, with one material, so it seemed logical to create a plane over the button with the material textures/common/nodraw.

 

I've already made a few skin files so I know how they work. My intention was to allow the nodraw material to be replaced, but when I try that I can't see the replacement. In DR the plane is solid white, and in game it's invisible. I could only get the skin to work when the default material was a conventional one (e.g. a brick wall), which defeats the purpose - I'd like the button to be blank by default, and I don't want the user replacing the entire button texture because it's 1024 x 512.

 

Can a plane be genuinely unrendered unless a skin changes its material?



#2 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37254 posts

Posted 26 May 2018 - 08:12 PM

A button texture of 1024 x 512 really sounds like overkill.

But why not just texture the model with the first label, and then use skins to switch to the other labels?
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#3 Epifire

Epifire

    Advanced Member

  • Active Developer
  • PipPipPip
  • 526 posts

Posted 26 May 2018 - 11:02 PM

Yes, a plane can remain invisible for effects such as you propose. I've done it when I had on/off effects for transformers and engines. Can you post your skin file so I can compare it with my working version? It just sounds like a typo or something but yeah it definitely works so as long as the skin file isn't doing anything strange.


You need a model? Epi does you a model.

 

Toss me a PM I promise I don't bite.

 

 


#4 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5609 posts

Posted 27 May 2018 - 01:16 AM

Maybe the texture scale is wrong. Did you fit the nodraw texture to the plane?


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#5 Dragofer

Dragofer

    Modeler

  • Member
  • PipPipPip
  • 541 posts

Posted 27 May 2018 - 01:49 AM

I can confirm this bug, I was looking to provide 2 different seat textures with different uv-maps on my stagecoach by making 1 start visible and the other 1 start as nodraw, then swap them around by skin. It worked ok in the editor but the faces which started nodraw never showed up ingame.

I've simplified the setup by making a nodraw box model and skinning it with a regular wall texture. Same result: works in editor, invisible ingame. Making a small test package of this for the bugtracker was on my todo list.

#6 R Soul

R Soul

    Member

  • Member
  • PipPip
  • 122 posts

Posted 27 May 2018 - 08:09 AM

A button texture of 1024 x 512 really sounds like overkill.

But why not just texture the model with the first label, and then use skins to switch to the other labels?

The metal housing is 512x512, with another 512x512 for the button itself. I've reduced the total size to 512x256 and scaled down the two models to 0.75. It's still big enough to look chunky, but shrinking the model more or less cancels out the loss of texture resolution.

It's not my intention to release a reskinable labelled button. It's a plain button with support for an optional label.
 
 

Maybe the texture scale is wrong. Did you fit the nodraw texture to the plane?

The texture scale is correct (fits the nodraw plane perfectly)
 
 

I can confirm this bug.

Thanks, although I would have preferred the opposite :D

 

Skin example:

skin tdm_button1_test
{
	model models/darkmod/mechanical/switches/button1_press.lwo
	textures/common/nodraw textures/darkmod/stone/brick/old_worn_blocks_003
}


#7 Epifire

Epifire

    Advanced Member

  • Active Developer
  • PipPipPip
  • 526 posts

Posted 27 May 2018 - 01:04 PM

I can confirm this bug, I was looking to provide 2 different seat textures with different uv-maps on my stagecoach by making 1 start visible and the other 1 start as nodraw, then swap them around by skin. It worked ok in the editor but the faces which started nodraw never showed up ingame.

I've simplified the setup by making a nodraw box model and skinning it with a regular wall texture. Same result: works in editor, invisible ingame. Making a small test package of this for the bugtracker was on my todo list.

 

Yes, afaik id4 wont process more than a single UV map to a model. However in the instance of a sign like this (on a separate material) it should all be able to be on the same UV map since it sounds like he's just matching to boundaries with the sign.

//-----------------------
// Steam Engine Mk.III - Epi
//-----------------------

steam_engine_003_off

{
model models/darkmod/super_secret/steam_engine_003.lwo

steam_engine_003 steam_engine_003
steam_engine_grate textures/common/nodraw
steam_engine_heatwarp textures/common/nodraw
transformer_needle_a transformer_needle_a2
transformer_needle_b transformer_needle_b2
steam_engine_glassReadout steam_engine_glassReadout
} 

steam_engine_003_on

{
model models/darkmod/super_secret/steam_engine_003.lwo

steam_engine_003 steam_engine_003
steam_engine_grate steam_engine_grate
steam_engine_heatwarp steam_engine_heatwarp
steam_engine_glassReadout steam_engine_glassReadoutOn
}

You don't have to double list the non-interchanging materials like I did. Steam_engine_003 is listed there for my own use of keeping track of the materials. You can see various material definitions either be replaced outright or just remain unlisted if the primary material applied was an ON effect to start with. However, I've been able to slot in the nodraw material for OFF mode usage when heatwarp or grating glow isn't applied. Hope this helps but I can guarantee you it does work as long as it's all on the same UV.


You need a model? Epi does you a model.

 

Toss me a PM I promise I don't bite.

 

 




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users