More that one shader at a time on a bot?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

More that one shader at a time on a bot?

Post by Magnus »

Can more than one shader be applied to a bot?

For example could the hologirl2 shader like on "angel" found in

models/mapobjects/bitch/hologirl2

be applied on a bot along with the tinfx2 shader like on "Razor/ID" found in

textures/effects/tinfx2

and both effects show at the same time?

That way the bot looks shiny and like they have waves of energy flowing down them.

If so then I would like to post or send someone my coding so they can look at it and tell me where I am going wrong.

Thanks!
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
glossy
Posts: 2282
Joined: Tue Apr 30, 2002 7:00 am

Post by glossy »

yes, it can. it'll just stack up like normal.

post what coding you have got here and we'll be able to tell you how it's done promptly :) but basically they just add on top of eachother like normal shaders
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

Post by Magnus »

Ok, here ya' go! It's a heck of a long list.

First I created my own shader immages: hologirl2(original)
hologirl20
hologirl21
hologirl22
hologirl23
tinfx2d(original)
tinfx20d
tinfx21d
tinfx22d
tinfx23d
tinfx24d
kc_fogcloud3(original)
kc_fogcloudyel3
kc_fogcloudyel3b
kc_fogcloudyel3r
and placed them into their proper folders.


These are my scripts for the shaders I want on deity:

models/players/deity/default
{
{
map textures/sfx/kc_fogcloudyel3.tga
blendFunc GL_ONE GL_ZERO
tcmod scroll 0 1
tcMod turb 0 .25 0 1.6
tcmod scale 4 4
rgbGen identity
}
{
map models/players/deity/default.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingDiffuse
}


}
models/players/deity/blue
{
{
map textures/sfx/kc_fogcloudyel3b.tga
blendFunc GL_ONE GL_ZERO
tcmod scroll 0 1
tcMod turb 0 .25 0 1.6
tcmod scale 4 4
rgbGen identity
}
{
map models/players/deity/blue.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingDiffuse
}


}
models/players/deity/red
{
{
map textures/sfx/kc_fogcloudyel3r.tga
blendFunc GL_ONE GL_ZERO
tcmod scroll 0 1
tcMod turb 0 .25 0 1.6
tcmod scale 4 4
rgbGen identity
}
{
map models/players/deity/red.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingDiffuse
}


}
models/players/deity/default
{
{
map textures/effects/tinfx21d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/deity/default.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/deity/blue
{
{
map textures/effects/tinfx22d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/deity/blue.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/deity/red
{
{
map textures/effects/tinfx23d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/deity/red.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/deity/default
{
cull none

{
map models/players/deity/default.tga
alphaFunc GE128
depthWrite
//rgbGen identity
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl210.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
//rgbGen identity
//rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/deity/blue
{
cull none

{
map models/players/deity/blue.tga
alphaFunc GE128
depthWrite
//rgbGen identity
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl211.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
//rgbGen identity
//rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/deity/red
{
cull none

{
map models/players/deity/red.tga
alphaFunc GE128
depthWrite
//rgbGen identity
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl212.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
//rgbGen identity
//rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/deity/null
{
{
map models/players/deity/null.tga
blendFunc GL_ONE GL_ONE
}

}

Now these are my scripts for the shaders I want on savagephantom:

models/players/savagephantom/default
{
{
map textures/effects/tinfx20d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/savagephantom/default.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/savagephantom/h_default
{
{
map textures/effects/tinfx20d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/savagephantom/h_default.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/savagephantom/blue
{
{
map textures/effects/tinfx22d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/savagephantom/blue.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/savagephantom/h_blue
{
{
map textures/effects/tinfx22d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/savagephantom/h_blue.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/savagephantom/red
{
{
map textures/effects/tinfx23d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/savagephantom/red.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/savagephantom/h_red
{
{
map textures/effects/tinfx23d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/savagephantom/h_red.tga
blendFunc blend
rgbGen lightingdiffuse
}
}

And these are my scripts for the shaders I want on spirit:

models/players/spirit/default
{
{
map textures/effects/tinfx24d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/spirit/default.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/spirit/default_h
{
{
map textures/effects/tinfx24d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/spirit/default_h.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/spirit/blue
{
{
map textures/effects/tinfx22d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/spirit/blue.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/spirit/blue_h
{
{
map textures/effects/tinfx22d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/spirit/blue_h.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/spirit/red
{
{
map textures/effects/tinfx23d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/spirit/red.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/spirit/red_h
{
{
map textures/effects/tinfx23d.tga
tcGen environment
rgbGen lightingdiffuse
}
{
map models/players/spirit/red_h.tga
blendFunc blend
rgbGen lightingdiffuse
}
}
models/players/spirit/default_h
{
cull none

{
map models/players/spirit/default_h.tga
depthWrite
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl21.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
rgbGen identity
// rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/spirit/default
{
cull none

{
map models/players/spirit/default.tga
alphaFunc GE128
depthWrite
//rgbGen identity
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl21.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
//rgbGen identity
//rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/spirit/blue_h
{
cull none

{
map models/players/spirit/blue_h.tga
depthWrite
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl211.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
rgbGen identity
// rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/spirit/blue
{
cull none

{
map models/players/spirit/blue.tga
alphaFunc GE128
depthWrite
//rgbGen identity
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl211.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
//rgbGen identity
//rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/spirit/red_h
{
cull none

{
map models/players/spirit/red_h.tga
depthWrite
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl212.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
rgbGen identity
// rgbGen vertex
rgbGen lightingDiffuse
}

}
models/players/spirit/red
{
cull none

{
map models/players/spirit/red.tga
alphaFunc GE128
depthWrite
//rgbGen identity
rgbGen lightingDiffuse

}
{

//map textures/effects/envmapcirc3.tga

map models/mapobjects/bitch/hologirl212.tga
tcgen environment
tcMod scroll -6 -.2
tcMod scale 1 1
blendFunc GL_ONE GL_ONE
//rgbGen identity
//rgbGen vertex
rgbGen lightingDiffuse
}

}

Ok, there it is. So far I have been told that:

1. No you can't apply more than one shader at a time. That I will have to create a new shader that combines the shaders I want into one so the game will display each of the shader effects but think it is only applying one shader to the bot.

2. Yes you can apply more than one shader at a time. The shaders will stack one over the other, but I tried that and it wouldn't display any of the shaders I applied. Only after I removed all but one shader would the game display whatever one shader I left applied.

So like I said there are my scripts and I hope someone can either show me where I have a text error or something so that these shaders will be applied to my bots or point me to a good tut that will teach me how to create a new shader that combines the effects of the other shaders I want applied to my bots.

Thanks!
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

Magnus, what are you trying to do exactly?

- Create a shader with multiple stages (several textures layered on top of each other) for some special effect. For example, hologirl scrolling electric effect layered on top of shiny tinfx metal.

- Apply 2 separate shaders to different parts of a playermodel's body.

In the first scenario, you have to create a shader with different texture stages.

In the second scenario, you have to import the model into a 3D Modeling application, then reassign and UVW-wrap the shaders to the surface of the model.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

Post by Magnus »

For example, hologirl scrolling electric effect layered on top of shiny tinfx metal.
Exactly.

You know how the "angel" bot seems to have parts of her body that are transparent and she has that hologirl scrolling electric effect but the rest of her is regular dull brownish gray metal?

Well that is what I want to do with mt "spirit" bot. I basicly want a "angel" bot with shiny tinfx metal parts instead of the dull brownish gray metal parts and I want her in the shape of the "major" or maybe "hunter" bots.

In my other two bots "diety" and "savagephantom" I figured out what the problem was. It seems that some shaders are applied just below the skin and others are applied just on top of the skin.
I was trying to apply two shaders on top of the skin at the same time. The game was sort of z fighting over which shader to display. This caused neither of the shaders to display. As soon as I would remove one of the shaders the one that I left was applied and was displaying on the bot. I have their shader effects working the way I want them to now.
Well....there is one problem left with the "savagephantom" bot.
I put some icons on his skin when I created it in photoshop, but when I applied the shiny tinfx metal effect it covered up the icons I put on him. How do I get those icons to show through the shiny tinfx metal effect?

As far as the "spirit" bot goes for now I can either have the shiny tinfx metal or the hologirl scrolling electric effect and I have no idea how to get that transparent look like on the "angel" bot.

Thanks again.
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

Something in the lines of this (just an example, may/may not be what you want, but should give you an idea of how multipass shaders work):

Code: Select all

models/players/spirit/sfxmultistage
{
	//first stage (layer) displays tinfx
	{
		map models/players/spirit/tinfx21d.tga
		tcGen environment
		rgbGen lightingDiffuse
	}

	//second stage displays hologirl on top of tinfx
	{
		map models/players/spirit/hologirl20.tga
		tcMod scroll -6.0 -0.2
		blendFunc add
		rgbGen lightingDiffuse
	}
}
See the shader manual for more details (see my signature).
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
bork[e]
Posts: 4357
Joined: Tue Mar 23, 2004 8:00 am

Post by bork[e] »

Magnus - Get 'er working yet, any screens anything?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

He told me a few days ago he'd uploaded them to polycount but I haven't seen them yet.
Post Reply