Page 1 of 1
Plastic surface?
Posted: Sat Jan 16, 2010 2:55 pm
by Chretien
Hello!
I'm designing a jump pad at the moment and I want to create a surface that got a plastic feel to it, something like the macbook. Could anyone give me a hint on as where to look in the shader manual? Or even better, post a script? Would be appreciated.
I will upload the jump pad source file as soon as it's finished so anyone can use it.
By the way, a tip: google "Dropbox".

Re: Plastic surface?
Posted: Sat Jan 16, 2010 6:07 pm
by seremtan
Chretien wrote:like the macbook
so a jump pad that looks ultra-cool but only a few players can bounce on it?
you could try using the shiny metal shader from the vanilla game, with a paler base texture..?
Re: Plastic surface?
Posted: Sat Jan 16, 2010 6:10 pm
by sumatra
Take this shader, edit it and use a different environment texture. Something more simple.
The base texture should be a basic light grey surface with little structure.
This should do the job quite well..
Code: Select all
textures/base_trim/pewter_shiney
{
{
map textures/effects/tinfx.tga
tcGen environment
rgbGen identity
}
{
map textures/base_trim/pewter_shiney.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
rgbGen identity
}
}
EDIT: Too slow.

Re: Plastic surface?
Posted: Tue Jan 26, 2010 12:15 am
by Pat Howard
seremtan wrote:Chretien wrote:like the macbook
so a jump pad that looks ultra-cool but only a few players can bounce on it?

zing!
--
Sumatra, you didn't mention that the base texture needs an alpha to work with this shader. That tricked me for a while

. Is it like this with all env. maps?
Re: Plastic surface?
Posted: Tue Jan 26, 2010 2:05 am
by fKd
if you manage to make this texture look cool, can you post it? i need a nice white plastic texture. cheers

Re: Plastic surface?
Posted: Wed Jan 27, 2010 9:56 am
by jal_
Those materials (like the plastics used in Portal, right?) are very hard to do semi-right in the Q3 engine. :/
Re: Plastic surface?
Posted: Wed Jan 27, 2010 6:35 pm
by sumatra
Ye, it doesn't work really well. But I tried to come near such an effect.
Maybe you try this, needs some finetuning though:
http://rapidshare.com/files/341996389/plastic.pk3.html
Problem is the lighting of such surfaces. This must be done well thought.
Otherwise you get grey surfaces which are too shiny, or you get white surface while losing the shiny effect.
Here the script:
Code: Select all
textures/plastic/plastic
{
{
map textures/plastic/fx.tga
tcGen environment
rgbGen identity
}
{
map textures/plastic/plastic.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
rgbGen identity
}
{
map textures/plastic/plastic.tga
rgbGen wave noise .2 0 0 0
blendfunc GL_ONE GL_ONE
}
}
I tried to balance the grey to a brighter tone (almost white) with the blendfunc GL_ONE GL_ONE at the end.
Maybe that helps someone.
Cheers sum
P.S. Yes Pat, sorry, missed that :-P
Re: Plastic surface?
Posted: Wed Jan 27, 2010 8:52 pm
by obsidian
If it's glossy throughout, wouldn't you want the environment map rendered after the base layer?
Nice and simple:
Code: Select all
textures/obs_test/ifrag
{
{
map $whiteimage
rgbGen const ( 0.875 0.875 0.875 )
}
{
map textures/effects/envmapdim.tga
blendfunc add
tcGen environment
}
{
map $lightmap
blendfunc filter
tcGen lightmap
}
}
Re: Plastic surface?
Posted: Wed Jan 27, 2010 9:12 pm
by Pat Howard
Sumatra,
Looks cool, but Rapidshare won't let me download it. (Servers are too backed up for free users or some shite

.) Could you host it somewhere else for download?
Coincidentally I've also been trying to create a good plastic env. map. I've been getting the best results by simply putting some very small intense white hot spots on a black background and then adding a faint plastic wrap filter for a tiny bit of gloss. I'm just using the shiny pewter shader for now. Looks best on curvy surfaces. Here's a shot of mine on a weird pillar thing:

Re: Plastic surface?
Posted: Wed Jan 27, 2010 9:27 pm
by cityy
I would love to see a map with this sheme. Looks pretty nice Pat.
Re: Plastic surface?
Posted: Wed Jan 27, 2010 9:37 pm
by fKd
hahahahahaha very good pat, very good indeed!
and cityy, heh you are in for a surprise!
Re: Plastic surface?
Posted: Thu Jan 28, 2010 12:35 am
by Pat Howard
The only problem is it's so hard to light well. Either looks way too light or way too dark. Flat colors do that I guess. Perhaps someone could take a look at my blendfuncs? (I know, I know, I need to read the shader manual again.)
@Obs, your shader was good, but even brighter than mine. Also, you don't need all that gloss on a plastic.
Re: Plastic surface?
Posted: Thu Jan 28, 2010 12:39 am
by obsidian
Adjust the first 2 stages with rgbGen const as needed. I just wrote that off the top of my head so I don't know how it actually looks in game. It's also using a default Q3 texture, no doubt you can make your own texture better.
Re: Plastic surface?
Posted: Thu Jan 28, 2010 3:40 am
by Pat Howard
Hey, that helped a lot! Thanks obsidian. Here's the link to my shader if anyone's interested:
http://www.divshare.com/direct/10303483-4de.zip
Re: Plastic surface?
Posted: Sat Jan 30, 2010 11:39 am
by Chretien
Thanks everyone for sharing!
