Chromakey - Shaders


(Clown'r) #1

Hi,

i’m currently working on a movie and i need to capture some scenes with models only, so i thought i could use the bluewall trick and i started looking for the correct way to do this.

I got tipped about this thread on this forum.

I used the z_greentextures.pk3 darkangel provided, in combination with the shaderfile shaderman provided. I changed the green.tga to something red (leaving its name intact) so i could easily check which textures were changed, the red worked perfectly, and the green was complete on every map.

My conclusion was that with the shader method i “just” needed to give all the other textures the same attributes as the one that were in the shaderman’s shader.

well 2 hours later i had this zzzz.pk3 , including a green.tga (that is actually red) and a shader file with every material that darkangel including in his z_greentextures.pk3 .

But it doesn’t work !

edit: The current situation is that i get complete normal textures, and only the textures attributes that were in the original file of shaderman seem to work correctly (turning to red)

And i have no clue what goes wrong :frowning:

Anyone any suggestions?

Thanks in advance

C.


(Loffy) #2

Hi!
How about making a custom map, with green walls? Like Green Dream:
http://www.acc.umu.se/~loffy/mapping/maps/greenroom/
Or do you need more space (bigger maps)?
Hope it works out. Post link to film when ready.
//Loffy


(Clown'r) #3

if it was for an intro of some kind that would be an option, unfortunately i’d like to use demo’s and more complicated surroundings


(Shaderman) #4

You’ve seen the basic approach I suggested in the thread you mentioned above. IIRC the only thing that has to be done is to complete my example shader so it contains all textures that came with ET :slight_smile:


(Clown'r) #5

yea thought i did that, its inside the zzzz.pk3 and here i got the shader alone.

I added all the materials that darkangel used in his pk3 to the example shader you made, tho his pk3 made every not-so-perfect green, my complete shader only does the trick partly and leaves more than half untouched.


(Shaderman) #6

Sorry, didn’t get that you made a shader file modyfying the textures :banghead:

…reading the other thread…

Ok, now I remember :smiley:

You didn’t include the terrain and sky shaders yet. You need to do the same for all terrain and sky shaders of those maps you want to modify (have a look at the last three entries of my sample shader). There will be some more textures/model shaders missing then (see the flagpole picture I posted). So you’ll have to find out the relevant terrain and sky .shader files and add them to the modified shader file.


(Clown'r) #7

allright i see where the problem is, it seems i got a different install or something like that :-S textures that you reference to (textures/skies/sd_wurzburgsky) just dont seem to exist in my et-install, since radar is an original map it should be in one of the pak* files, and there aint anything like that.

my pak0.pk3/textures index looks like this clearly missing are the maps: radar, and probably the specific map of each level :* they got to be somewhere, just not in my pak0 or any other pak file


(Shaderman) #8

These are shaders and not textures.

Taken from the Shader Manual:

Shaders are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually has the same name as the texture set which contains the textures being modified (e.g; base, hell, castle, etc,). Several specific script documents have also been created to handle special cases, like liquids, sky and special effects.

What you now need to do is find the appropriate shaders for at least the sky and terrain in etmain/scripts and write your own shader (like you did for the textures) which will then override the original shader.
Let’s take radar for example. Open the file etmain/scripts/skies.shader with a text editor. You’ll find textures/skies/sd_wurzburgsky in there with all attributes that are used in game (like sun light, clouds and so on). You have to “replace” this shader

textures/skies/sd_wurzburgsky
{
	nocompress
	qer_editorimage textures/skies/sky_8.tga
	q3map_lightimage textures/skies/n_blue2.tga
	q3map_nofog
	q3map_globaltexture
	q3map_lightsubdivide 256 
	q3map_sun 0.130 0.080 0.020 20 165 5
	q3map_sun 0.281 0.288 0.370 80 35 40
	q3map_sun 0.281 0.288 0.370 15 215 60
	q3map_sun 0.281 0.288 0.370 10 35 50
	q3map_sun 0.281 0.288 0.370 10 35 45
	q3map_sun 0.281 0.288 0.370 10 35 35
	q3map_sun 0.281 0.288 0.370 10 35 30
	q3map_sun 0.281 0.288 0.370 10 40 40
	q3map_sun 0.281 0.288 0.370 10 45 40
	q3map_sun 0.281 0.288 0.370 10 30 40
	q3map_sun 0.281 0.288 0.370 10 25 40
	q3map_surfacelight 30

	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky

	skyparms - 512 -
	sunshader textures/skies_sd/small_moon

	{
		map textures/skies_sd/wurzburg_clouds.tga
		tcMod scale 2.5 2.5
		tcMod scroll 0.003 -0.0015
		rgbGen identityLighting
	}
	{
		map textures/skies_sd/ydnar_lightning.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		rgbGen wave triangle -8 9 0 0.137
		alphaGen wave noise -3 4 0 2.37
		tcMod scale 3 3
		tcMod scroll 0.003 -0.0015
	}
	{
		clampmap textures/skies_sd/wurzburg_fogmask.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		tcMod scale 0.956 0.956
		tcMod transform 1 0 0 1 -1 -1
		rgbGen identitylighting
	}
}

by your own:

textures/skies/sd_wurzburgsky <-- don't modify this line!
{
	surfaceparm nolightmap
	surfaceparm nomarks
	sort 16

	{
		map textures/shaderman/green.tga
	}
}

The same needs to be done for several terrain shaders which are located (for the map radar) in the file etmain/scripts/radar.shader and are named textures/radar/lmterrain2… I think if the sky and terrain is done, there will be some shaders used by models which have to be located. I bet you’ll get help here if you’re stuck and don’t find one of those shaders :wink:


(Clown'r) #9

man i feel like a dumb f*ck


textures/skies/sd_wurzburgsky
{ 
   surfaceparm nolightmap 
   surfaceparm nomarks 
   sort 16 

   { 
      map textures/shaderman/green.tga 
   } 
}

this exact line doesn’t work for me, i put in it a ‘z.shader’ file, in a ‘scripts’ map, zipped it with the appropriate ‘textures’ map, as ‘zzzz.pk3’ made a copy and threw it in etmain ánd etpro.

i tried editing the original skies.shader file.

nothing :banghead:
i tried removing the zzzz.pk3 so i could see if there were perhaps more factors, but that .pk3 seems the only thing effecting my et (everything turns into orignal)

could there be any problem with combining it with etpro/demos ?


(Shaderman) #10

You only need the pk3 in etmain.

You see it worked for me. It must be some game setting which I don’t know atm.

i tried editing the original skies.shader file.

Wrong way. Don’t modify the original files.

could there be any problem with combining it with etpro/demos ?

No. It works with demos (etpro).

I can try to check my game settings tonight or this weekend.


(Clown'r) #11

well it be great if you could check out your settings, i’ve used a fresh et install, with etpro downloaded from the official site, no weird maps or pk3.
my etconfig, mostly standard
pk3 file, most basic shader + texture for radar terrain/sky (might need to rename it after downloading)

weirdup with those settings i can get the road on radar red, and very small parts of the terrain, but nothing else…

if you need anything else, shout yell cry jump, i’m quite desperate ;[

ty ty ty


(Shaderman) #12

I used my shader and my green image and started my mapping installation of ET to find out those cvars you’d have to set. Now guess what happens? I don’t get the sky and terrain parts modified again like in the picture above :banghead: I think I didn’t change anything in my mapping config but installed a newer GForce driver some days ago. Now I’m totally confused and don’t know where to search for a solution :eek2:


(Clown'r) #13

raah damnation ;-x

well i guess i have to try to capture with the “normal” green textures, i just hope the tolerance cant be modified good enough to make it work out

thanks for all the trouble anyway, if i come across any solution, the thread will be updated ;-]

edit: ill try emailing the splashdamage guys, and perhaps bani, for some advice


(Shaderman) #14

You’re welcome! If you need more trouble let me know :moo:


(Clown'r) #15

You’re welcome! If you need more trouble let me know

err, like saying thanks for the aids ! (southpark©)

you get the point :slight_smile:


(Sauron|EFG) #16

It’s a bit more work, but my littly tool produces decent results, especially when combined with a pk3 like DA’s.


(Clown'r) #17

hi sauron, well i used your prog a year (perhaps 2) back, and as it sometimes pissed me off, that et just doesnt take the exact same screenshots, and next to that, i’m trying to get tga_hook working, so there will be jpg’s involved instead of tga’s… ;-x