Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Grass and Shaders

Page: 1 of 1
 Arkon11
07-08-2004, 8:56 AM
#1
Well, I'm working on an un-anouced map, I found this neat grass shader in a bushido map pack for JO.

-----------------------------------------
textures/f0x0r/japanvertgrass01
{
qer_editorimage textures/f0x0r/japanvertgrass01
{
map textures/f0x0r/japanvertgrass01
}
{
map $lightmap
blendfunc filter
rgbgen identity
}
{
map textures/f0x0r/ss_grassjapan
surfaceSprites vertical 5 20 25 2000
ssVariance 1 2
ssWind 4.0
alphaFunc GE192
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
rgbGen vertex
}
}
-----------------------------------

It's pretty decent, and with a little tweaking it will suit my needs (if i get permission to use it that is). But I am having trouble. to use this shader, you have to lay down this grass shader/texture. Which is visable and solid. Then the grass sprites appear on that. I want it so I can lay down something that is invisible and not solid. Kinda like nodraw. I don't have any idea what to do. Any suggestions.



Oh and I just did this---


Well, I made a few changes, ignore the file names and stuff.

------------------------------
textures/grass/floor
{
qer_editorimage textures/grass/floor
surfaceparm nomarks
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm nonopaque
surfaceparm trans
q3map_nolightmap

{
map $lightmap
blendfunc filter
rgbgen identity
}
{
map textures/f0x0r/ss_grassjapan
surfaceSprites vertical 5 20 25 2000
ssVariance 1
ssWind 0.0
alphaFunc GE192
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
rgbGen vertex
}
}

-----------------------

I thought that would make the ground texture invisble.(the nodraw part) But it made everything invisable so it seems. I still need some help.
 lauser
07-09-2004, 1:00 AM
#2
Okay is this for M/P? If it is and you use grass_sprites all over, don't expect great framerates. Sprites lag maps.
 wedge2211
07-10-2004, 12:45 AM
#3
Get rid of surfaceparm nodraw. This section:

Originally posted by Arkon11
{
map textures/f0x0r/ss_grassjapan
surfaceSprites vertical 5 20 25 2000
ssVariance 1
ssWind 0.0
alphaFunc GE192
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
rgbGen vertex
}

Is what maps a texture to the surface. (See the "map textures/..." line?) Try making yourself a jpeg that's all black and replacing the stage I highlighted with:

{
map textures/whatever/black
blendfunc add
}

Then you should be able to apply the shader to a brush and just get grass sprites sprouting from an invisible surface.
Page: 1 of 1