Glass for models

Modelling, Textures, Animating and other general engine asset topics.

Glass for models

Postby andy4729 on Fri Jul 08, 2011 1:20 pm

So I've made a gas lantern model which obviously has a glass part to it. As I'm new to Source modeling; I am unsure how to get a transparent glass texture for the lantern into source. I tried just filling the glass part of my UV map with white and low opacity however when applied to the model in Maya, it's opaque.

Sorry for noob q.

EDIT: Also, I tried setting the transparency attribute to the file aswell but that just made everything a bit transparent. How do I make it just pick up the alpha channel of my texture file?
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Glass for models

Postby MayheM on Fri Jul 08, 2011 3:41 pm

It would all be done in the texture creation. the areas you want to be transparent you would adjust the alpha channel in the texture to allow it to be translucent. You can find tutorials on making transparent textures all over but if you have questions let me know...
Image
User avatar
MayheM
Veteran
Veteran
 
Joined: Tue Oct 16, 2007 7:46 pm
Location: Lancaster SC

Re: Glass for models

Postby andy4729 on Sat Jul 09, 2011 11:30 am

Thanks, got it all sorted now :)

A new problem developed which was that I was trying to have the translucent glass and the opaque metal on one texture. I then remembered that all of valve's models that have glass are split into 2 separate models, one with translucent on and one with it off.
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Glass for models

Postby TheDanishMaster on Sat Jul 09, 2011 2:26 pm

You can have them in one texture but it's better to split them up because Source only allows one material type per model.
But of course, if it's a small model, then I doubt people will ever notice. But if it's a car (like in l4d) you would have to split it up in 2 model so glass would act and sound like glass on impact and metal like blabla..

I hope that made any sense to you :-D

EDIT: And 2 models can use the same texture, if that's what you wanted :P
Specs:
MSI P67A-GD55, Intel Core i7 Sandy Bridge 2600k @ 3,4GHz, Corsair 8GB DDR3 1333MHz, 1TB HDD, NVidia GTX580 1,5GB GDDR5, Blu-Ray drive
Image
User avatar
TheDanishMaster
Been Here A While
Been Here A While
 
Joined: Sun Jul 26, 2009 7:02 pm

Re: Glass for models

Postby visselke on Sat Jul 09, 2011 4:05 pm

Try 1 model and 2 materials. Your general material and your material that is transparent. If I remember correctly there used to be a problem in the past where the use of a material with both transparent and non transparent areas caused the model to become fully transparent when under the effect of a flashlight for example.
visselke
Been Here A While
Been Here A While
 
Joined: Mon Nov 22, 2004 7:51 pm
Location: Belgium

Re: Glass for models

Postby andy4729 on Sat Jul 09, 2011 8:20 pm

Ahh, thanks guys. Yea, I figured most people wouldn't notice if the glass bit wasn't transparent but I'm new to Source modeling and this is only my 2nd model I've imported so I'm trying to learn as quickly as possible! :D

EDIT: Although now I have a physics model which is 2 models that are meant to move together... hmm :\

EDIT EDIT: Nevermind! Figured it out.

I made the metal part a prop_physics_override and the glass a prop_dynamic_override and had an output on a logic entity to set the parent of the glass to be the metal. WIN.
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Glass for models

Postby andy4729 on Sat Jul 09, 2011 9:25 pm

One last problem. Wasn't sure where to post this so here goes. The glass model is visible through grass detail sprites... bit strange but I guess it has something to do with the transparency... o.O

Any ideas?
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Glass for models

Postby Armageddon on Sat Jul 09, 2011 9:35 pm

It's a bug in source, it should be fixed if you made one model with 2 materials.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Glass for models

Postby andy4729 on Sat Jul 09, 2011 9:40 pm

How do I use two materials for one model?
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Glass for models

Postby Armageddon on Sat Jul 09, 2011 9:45 pm

I don't know, I'm not a modeler. Anotehr way to fix it I believe is to use $alphatest 1 in the .vmt instead of $translucent 1 I think it only does perfect 100% opaque 50% transparency and 0% transparency.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Glass for models

Postby andy4729 on Sat Jul 09, 2011 9:58 pm

Righto. Just tried alphatest which made the glass 0% :\
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Glass for models

Postby Armageddon on Sat Jul 09, 2011 10:53 pm

yeah I forgot if it did 50% or not, sorry.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Glass for models

Postby visselke on Sun Jul 10, 2011 7:20 pm

andy4729 wrote:How do I use two materials for one model?

In your modelling program split up the model and assign a different material to the different parts. When you save it out to be converted it will still be handled as a single model. Just make sure that the name of the materials is the same as the name of the .vmt materials and make sure that you have the correct material location specified in your .qc file ;).
visselke
Been Here A While
Been Here A While
 
Joined: Mon Nov 22, 2004 7:51 pm
Location: Belgium

Return to Art Creation

Who is online

Users browsing this forum: No registered users