My animmap do not work

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
xiripiti
Posts: 100
Joined: Tue Jul 09, 2013 3:16 pm

My animmap do not work

Post by xiripiti »

Hi guys
Started a new map some weeks ago and it is ready to show you the first rough. I would like to include some shaders in this rough, but one I made for the teleporter I cant make it work.
Is a animmap with 8 tga images with alpha channel and the script is:

textures/newmap/mj_tporter
{
qer_editorimage textures/newmap/mj_tp01.tga
q3map_lightimage textures/newmap/mj_tp01.tga
surfaceparm trans
surfaceparm nomarks
surfaceparm nolightmap
{
animMap 1 textures/newmap/mj_tp01.tga
textures/newmap/mj_tp02.tga textures/newmap/mj_tp03.tga
textures/newmap/mj_tp04.tga textures/newmap/mj_tp05.tga
textures/newmap/mj_tp06.tga textures/newmap/mj_tp07.tga
textures/newmap/mj_tp08.tga
blendfunc add
}
}


The images show in the texture editor as a shader but do not appear after compilation.
Someone can tell me what is wrong/missing in this script?
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: My animmap do not work

Post by CZghost »

The list of frames has to be on one line. New line means new shader command. Remove line breaks and separate frames by spaces instead, therefore it should work.

Also, you are using lightimage but no light, you just forgot to include it? If you want to give texture light color be sure to include also strenght of the light...

Technically your script needs only to remove line breaks between frames and use only spaces like described above. But, code will look better, if you will use tabulators, structure the code like this model:

Code: Select all

textures/awesomemap/texturename
{
    (shader general directives)
    {
        (shader stage directives)
    }
}
Your shader coding skills would look better if you choose GL_ONE GL_ONE blendfunc for additive texture instead, I know that both work, but the GL keywords give you more options to blend your texture and it's original way of shader stages blending introduced with first Q3 release (note that original id's shaders are using this way, not the simplified ones). I'd recommend to use original blending keywords, but that's my opinion. If you read the replacements better, use them...
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: My animmap do not work

Post by obsidian »

Tabulation is just because he's posting this on the forum without the "code" markup.

GL_ONE GL_ONE vs. blendFunc add is nonsense. Both are fine, one is just the shorthand for the other, so why not use the shorthand if that's all you need. Both are valid for the game. It's fine if you prefer one over the other, but neither one is better than the other.

What is redundant is q3map_lightimage since the shader is not emitting light, as well as the alpha channel if he is using an additive blend function.
[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]
camel
Posts: 69
Joined: Sun Dec 06, 2009 9:58 pm

Re: My animmap do not work

Post by camel »

Code: Select all

textures/newmap/mj_tporter
{
	qer_editorimage textures/newmap/mj_tp01.tga
	q3map_lightimage textures/newmap/mj_tp01.tga
	surfaceparm trans
	surfaceparm nomarks
	surfaceparm nolightmap
	{
		animMap 8 textures/newmap/mj_tp01.tga textures/newmap/mj_tp02.tga textures/newmap/mj_tp03.tga textures/newmap/mj_tp04.tga textures/newmap/mj_tp05.tga textures/newmap/mj_tp06.tga textures/newmap/mj_tp07.tga textures/newmap/mj_tp08.tga
		blendfunc add
	}
}
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: My animmap do not work

Post by CZghost »

obsidian wrote:Tabulation is just because he's posting this on the forum without the "code" markup.
It's one of the reason why to post these codes under the markup.
obsidian wrote:GL_ONE GL_ONE vs. blendFunc add is nonsense. Both are fine, one is just the shorthand for the other, so why not use the shorthand if that's all you need. Both are valid for the game. It's fine if you prefer one over the other, but neither one is better than the other.
Yea, they are the same, but I think that shortcuts have not been in the game from very early just right after release of first version in 1999. If someone likes to use shortcuts, then no problem, but it does nothing special, just shortcuts the code a bit.
obsidian wrote:What is redundant is q3map_lightimage since the shader is not emitting light, as well as the alpha channel if he is using an additive blend function.
I always use .tga in shader eighter if I have jpg or tga, it doesn't matter. I think tga is better for the quality, just a bigger file. Also, he probably wants to add light emission to the texture (like fire does), just forgot to include the light emission command.
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
xiripiti
Posts: 100
Joined: Tue Jul 09, 2013 3:16 pm

Re: My animmap do not work

Post by xiripiti »

thanks CZghost and Obsidian :p
Animmap is working now!! (light emission added). I will post my "Roughmap" soon.
Post Reply