tcGen ivector not working for me


(Gringo Starr) #1

I seem to be having a problem getting the texture on my terrain to scale differently with the ivector command. No matter what I seem to do, it won’t change the way it fits. I tried commenting out the globaltexture and texturesize commands too. Here is the shader:


textures/ww_bc/terrain_1
{
	q3map_texturesize 256 256 
        q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 ) 
	//q3map_forcesunlight
	q3map_novertexshadows
	q3map_globaltexture
	q3map_nonplanar
	surfaceparm nolightmap
	{
		map textures/ww_battlecreek2/ma_newrock2.jpg
		rgbGen vertex
	}
}

Thanks in advance :slight_smile:


(chavo_one) #2

Did you forget to add your shader file to shaderlist.txt?


(ratty redemption) #3

iirc, globaltexture is only needed if we use a tcmod, so I don`t think you need that, nor should you need q3map_texturesize, other then those, your shader looks fine to me, but check your paths are right and what chavo suggested.


(MadJack) #4

Gringo, if you used EasyGen make sure you edit your shader file and move the terrain_base before all the other terrain stages/texture. It’s a known issue with the way EasyGen makes the shader file.

Since it’s the first stage and all the other textures reference this one, you only need to have the ivector in this one (_base). Here’s a snippet of mine.


textures/Ebe/terrain_base
{
	nopicmips
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_lightmapsamplesize 32
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

textures/Ebe/terrain_0 
{ 
	q3map_baseshader textures/Ebe/terrain_base 
	surfaceparm grasssteps
	surfaceparm landmine
   { 
      map textures/temperate_sd/grass_dense1.tga 
   } 
   { 
      map $lightmap 
      blendFunc GL_DST_COLOR GL_ZERO 
   } 
}
 

OTOH if you didn’t use EasyGen, sorry for the spam :smiley:


(ratty redemption) #5

although I don`t personally use easygen, I agree with MadJack, but will also add that we can have additional tcgen ivectors on the first stage of non base shaders, if we want to change their tex size, but if all of them are to be the same size, keep tcgen ivector in the base shader, as MadJack suggested.


(Hewster) #6

and to round off this discussion:

q3map_tcGen ivector is a compile option, and so any changes you make will only be seen once you
re-compile the map :slight_smile:

Hewster


(obsidian) #7

q3map_tcGen ivector sets the scale of the textures. In your shader, ‘q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )’ sets the texture to tile once every 512 game units in s and 512 game units in t. If you change this to ‘q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )’ then the texture tiles every 256x256 game units.

It’s pretty silly to set q3map_textureSize since the ivector parameters are overriding it. That’s why any kind of texture resizing operations that you’re doing have no effect.


(Gringo Starr) #8

@ Hewster…Yes, I wasn’t recompiling in between modifications, but then I remembered you telling me that :). So, that wasn’t the issue.

@ Chavo, yes, I’ll have to make sure it’s in shaderlist.txt. I’m not on that machine atm.

@Obsidian… In the first post, I mentioned that I commented those out to try to get it working. :slight_smile:

@ MadJack…Unfortunately I want different texture sizes for different layers :(. But it’s good to know that can be done.


(ratty redemption) #9

you could have…

q3map_tcgen ivector ( 1024 0 0 ) ( 0 1024 0 )

in the base shader, or first stage of one of the non base shaders, then have…

tcgen vector ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) // 256

in any of the following image stages, so you can blend two different sized images together in one shader.


(Hewster) #10

but if the does that, wouldn’t it make the use of q3map_tcGen ivector pointless, since I thought the whole
idea of having it a compile time option was to increase performance in the map ?

Hewster


(Gringo Starr) #11

There were actually 2 things. Chavo, you were right about not having it in shaderlist.txt :). Thanks. And I had a shader with the same name in a pk3. Sorry for wasting everyone’s time, and thanks for the help!


(ratty redemption) #12

@Gringo Starr, np and at least you got it working now and told us how you fixed it.

@Hewster, not if were blending two or more different sized tex in the same shader, but if their all one size, then yes we should use the q3map_tcGen ivector as its kinder on the engine… I can post an eg if anyone needs it.


(Gringo Starr) #13

Well, after posting that, I did find that I couldn’t use different sizes on the layers. It couldn’t blend between layers properly. So, I had to compromise on 384x384. :slight_smile: Maybe I’ll put it only in the base shader. I simply don’t have time to play around with it, so don’t waste any time trying to help Ratty :slight_smile:


(ratty redemption) #14

@Gringo Starr, understood, but if you posted the paths your using, I could probably write a shader for you, it`s no trouble as I like practising this stuff, terrain being my fav area of mapping.

plus there are several ways we can blend now, so if one method doesn`t work, the chances are another will… anyway, no rush, just still offering help if you need it now or in the future :slight_smile: