Need shaders help!


(ag0n) #1

Hi. I edited my shader about grass. I wanted to see grass at long distance at radar map.

models/foliage/grassfoliage1
{
nopicmip
qer_alphafunc greater 0.5
qer_editorimage models/foliage/grassfoliage1.tga
cull disable
// distanceCull <inner> <outer> <alpha threshold>
distanceCull 128 9999 0.49
sort seethrough
surfaceparm pointlight
surfaceparm trans
surfaceparm nomarks
nopicmip
deformVertexes wave 20 triangle 0 1 0 1
{
map models/foliage/grassfoliage1.tga
alphaFunc GE128
rgbGen exactVertex
alphaGen vertex
alphaGen wave inversesawtooth 0 1 0.75 1.5
}

My question is: Can i “resize” a texture using a shader? I think that the grass is too big and i wanna make it looks litle. I know its possible with photoshop. Help me plx


(ShadowAgent) #2

afaik you cant… never saw something like that when i read the shader manual (might have missed smthg).


(-SSF-Sage) #3

I don’t think you need to touch that one. Search the shaders they used for the terrain itself, because that shader adds the grass on to it.

Found from radar.shader an example, don’t know if it’s the correct shader for this, but here is the stuff you need to search for. However i’m a complete noob what comes to shaders.

textures/radar/lmterrain2_foliage_fade
{
q3map_baseShader textures/radar/lmterrain2_base

[b]q3map_foliage models/foliage/grassfoliage1.md3 1.25 64 0.1 2[/b] //here! and the two below. Check [this](http://tramdesign.planetwolfenstein.gamespy.com/tutorials/etdocs/foliage.html) for further help! 
q3map_foliage models/foliage/grassfoliage2.md3 1.1 64 0.1 2
q3map_foliage models/foliage/grassfoliage3.md3 1 64 0.1 2

}

Edit. and the scale is what you want to change here. : )


(TNR360) #4

so the grass foliage model is added via shader?


(kamikazee) #5

If you see heaps of grass, like on radar, it sure is added through a shader.

Q3Map2 compiles those grass models into the map geometry, so do make sure the model contains as few polygons as possible. (Mostly 2)


(-SSF-Sage) #6

Hmmm. Making foliage requires compiling, I’m not sure if this does. If it does that would be really bad thing… :slight_smile:


(ag0n) #7

its possible. Atleast using photoshop. I tryed what u said… but didnt work :<. I dont have any md3 file for foliage btw :<


(-SSF-Sage) #8

Yes you don’t because they are compiled into the map, so they doesn’t need to be included to the pk3. There are some models (I guess they were made by rayban, search for it) that are looking nice, and doesn’t eat too much fps. BUT however it requires compiling! I don’t know if there is anyway to change it without compiling, and decompiling and then compiling, makes many things not working (radar isn’t open source). If that isn’t possible with changing shader It’s not possible afaik.


(ag0n) #9

Well, thanks anyway. Apreciated your help. I will use photoshop (its for movies, nP)