Need info on creating windows
by Foestar · in Torque Game Engine Advanced · 03/31/2010 (7:24 pm) · 11 replies
I'm trying to add windows to my buildings but so far everything I've tried has turned out unsuccessful. I've made a texture (grey color) and given it transparency. That didn't work. I've tried doing things in the material editor in 3ds max but none of the stuff I followed worked. So far the best I've gotten was for the object to at least show up in TGEA but it was appearing and disappearing like crazy not to mention it seemed to blend oddly with the light. It kept turning a orange color.
So I was hoping someone could point me out to a tutorial on how to make windows in either constructor or max or give me a few pointers.
So I was hoping someone could point me out to a tutorial on how to make windows in either constructor or max or give me a few pointers.
About the author
Foestar Entertainment Biohazard Entertainment
#2
If you are applying your window texture to a dif object, it won't work.
04/02/2010 (2:33 am)
Windows are as simple as making a semi transperant image and saving as a png or tga and applying it to a dts object. Your first material def. is the correct one. If you are applying your window texture to a dif object, it won't work.
#3
04/02/2010 (12:38 pm)
Yeah, I tried to both a dif and dts. But I wanted it on a dts so I can make it break later. Not sure if I can make a semi transparent image in PSP. It seems to set the palette transparency to make the designated color fully transparent. Maybe that's why it's not working. Will have to look into the img itself rather then the material later tonight.
#4
I'm using Paint Shop Pro 7 and 3DS Max for my window design.
04/13/2010 (6:23 pm)
Yeah so I need some help on making the windows because apparently I suck at making textures have an alpha channel. I'm using Paint Shop Pro for my texture and I created a small png picture of a simply light gray block. I've tried setting pallet transparency which removes the color completely. Obviously this is not what I want. I also followed a tutorial on making it semi transparent which didn't work (guessing it was outdated). So, if someone could help explain to me how I can make the texture have an alpha channel I would be greatly appreciative since this seems to be holding me up on my interior design.I'm using Paint Shop Pro 7 and 3DS Max for my window design.
#5
As for PSP, png images need to have a transparency layer, if you create a new image and select transparent instead of a background colour, and then create new layers to work on that should do the trick, in the past tho not for torque ive just flood filled a new layer with a teal colouyr and dropped the opacity to 10% save out as a png with transparency and you should be good to go
04/13/2010 (7:10 pm)
I dont use Max often, most of my basic modelling is done in milkshape whete the transparent texture also has to be flagged as transparent when you export it.As for PSP, png images need to have a transparency layer, if you create a new image and select transparent instead of a background colour, and then create new layers to work on that should do the trick, in the past tho not for torque ive just flood filled a new layer with a teal colouyr and dropped the opacity to 10% save out as a png with transparency and you should be good to go
#6
File contains a window (shocker) + the source format files, a dual layer pspimage file i'm using 8.01 but there shouldnt be any issues.
A milkshape file, and i exported a 3ds file not sure how max and materials work but thats about the only format i could think of for max.
2 things to note about PSP, 1) it may not by default load and save alpha layers for png, there is a setting from the menus
File --> Preferences --> file format preferences and PNG tab, simple tickbox needs to be ticked
as for saving your new file, you need to use the PNG optimiser in the file --> export menu, select the transparency tab and then select the alpha channel transparency, then save out your image
04/13/2010 (8:25 pm)
www.bloodknightstudios.co.uk/downloads/window.rarFile contains a window (shocker) + the source format files, a dual layer pspimage file i'm using 8.01 but there shouldnt be any issues.
A milkshape file, and i exported a 3ds file not sure how max and materials work but thats about the only format i could think of for max.
2 things to note about PSP, 1) it may not by default load and save alpha layers for png, there is a setting from the menus
File --> Preferences --> file format preferences and PNG tab, simple tickbox needs to be ticked
as for saving your new file, you need to use the PNG optimiser in the file --> export menu, select the transparency tab and then select the alpha channel transparency, then save out your image
#7
Edit: Didn't see the second post. Read it over and I think I get it. Gonna see if it works.
04/13/2010 (8:39 pm)
Yeah, I tried doing what you said and it worked on making the texture have a low transparency. Now I just need it to show up like it's supposed too in TGEA. So far it just comes up orange. Maybe I'm doing something wrong when placing it on the model. I've tried placing it on diffuse and opacity mapping and neither worked after the export. When I did the opacity mapping it looked like it worked in Max. Maybe my material file is wrong? I usednew Material(WINDOWGLASS)
{
baseTex[0] = "WINDOWGLASS";
translucent = true;
translucentBlendOp = LerpAlpha;
};Edit: Didn't see the second post. Read it over and I think I get it. Gonna see if it works.
#8
04/13/2010 (8:53 pm)
Okay, I think my problem is somewhere in Max. It seems that the texture is transparent but isn't coming out that way on the model. :| Max can be such a pain sometimes. Gonna play with it some more sometime tomorrow.
#9
when you first import your diffuse image you should get the following display

If the alpha settings are greyed out it means your image doesnt have an alpha channel, and you need to resave.
go back to the default view of your material in the drop down and change the opacity level like so

20% came out a nice shade of blue using that image i already made, but you probably want it lower for real glass
04/14/2010 (3:29 am)
ok, i got visitation rights on my max todaywhen you first import your diffuse image you should get the following display

If the alpha settings are greyed out it means your image doesnt have an alpha channel, and you need to resave.
go back to the default view of your material in the drop down and change the opacity level like so

20% came out a nice shade of blue using that image i already made, but you probably want it lower for real glass
#10
04/15/2010 (7:01 pm)
Ok, so I got it working. I guess my problem was my alpha channel in my texture. Will have to work on that. Thanks for the help Bloodknight.
#11
Thanks again.
04/15/2010 (9:18 pm)
Found out why it wasn't working and why I was having such trouble with this. Turns out I was simply saving it as a png and it kept losing its alpha channel. I started exporting it as a png which made it work fine.Thanks again.
Torque 3D Owner Foestar
//this is the first one I tried new Material(WINDOWGLASS) { baseTex[0] = "WINDOWGLASS"; translucent = true; translucentBlendOp = LerpAlpha; }; //this is the second one I tried new Material(WINDOWGLASS) { baseTex[0] = "WINDOWGLASS"; emissive[0] = true; translucent = true; translucentBlendOp = AddAlpha; };Neither worked fully beyong the blending background objects to white or black colors.