Vegeta Posted October 12, 2015 Share Posted October 12, 2015 I was creating a new grass texture/shader and realized that I didn't know how to change a few of the sprites' properties. I want to know what determines sprite size (height of grass blades), and density (how many there are per brush). Below is an example of one of my shaders. textures/2_modernist/wildgrass { q3map_normalimage textures/2_modernist/grass_normal qer_editorimage textures/2_modernist/wildgrass q3map_material ShortGrass q3map_forceSunlight q3map_nonplanar q3map_shadeangle 120 tessSize 2048 { map $lightmap } { map textures/2_modernist/wildgrass blendFunc GL_DST_COLOR GL_ZERO } { map textures/2_modernist/grassprites2 surfaceSprites vertical 15 10 20 250 ssFademax 1600 ssFadescale 1.0 ssVariance 1 2 ssWind 0.5 alphaFunc GE192 blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA depthWrite rgbGen vertex } } This functions well in game, yet the grass is almost as tall as the player, and density is not very desirable. I tried changing the ssFadescale value, but anything above 3000 lags. The cause of lag is somewhat of a mystery to me, since my PC is able to run GTA V and SWtoR at maximum graphics without issues. For those who haven't seen it, below is an image of SWtoR grass. Finally, this is what I'm attempting to achieve with my grass shader. NumberWan likes this Link to comment
Asgarath83 Posted October 12, 2015 Share Posted October 12, 2015 Wow!!! Impressive!!!!@@Vegeta i have two question.1: what is the map of your screenshot?2: can you pass me the model of the blue dark beast on the left of the first screen? D: Link to comment
NumberWan Posted October 12, 2015 Share Posted October 12, 2015 @Asgarath83I am afraid, the creature you speak of is the Dashade from Star Wars: The Old Republic, and that is the actual screenshot from this game. The second picture is likely from a different game. But I am not unfamiliar with the shader @Vegeta mentions. I have a few examples back at home, but if you need these badly, try looking for the map with swoop bike trip. In the canyons a few shaders recreate grass growing in some areas. For the size, try changing these parameters: surfaceSprites vertical 15 10 20 250 Link to comment
Asgarath83 Posted October 12, 2015 Share Posted October 12, 2015 @Asgarath83I am afraid, the creature you speak of is the Dashade from Star Wars: The Old Republic, and that is the actual screenshot from this game. The second picture is likely from a different game. But I am not unfamiliar with the shader @Vegeta mentions. I have a few examples back at home, but if you need these badly, try looking for the map with swoop bike trip. In the canyons a few shaders recreate grass growing in some areas. For the size, try changing these parameters: surfaceSprites vertical 15 10 20 250A Dashade?? Oh, i understand. So no model ç_çthanks for istruction, grass sprites of default of yavin texture is not much good as visual >.< mmm i think i will edit the yavin grasssprites of game with quicktrip grassside + surfacesprites vertical .15 10 20 250 Link to comment
Xycaleth Posted October 12, 2015 Share Posted October 12, 2015 Unfortunately you're not going to be able to get the same density of grass over such a large area and with good frame rate in JKA. It wasn't built to efficiently render that many things :/ Link to comment
Tempust85 Posted October 12, 2015 Share Posted October 12, 2015 Even though it's just a bunch of planes? How shit! Link to comment
Ramikad Posted October 12, 2015 Share Posted October 12, 2015 Unfortunately you're not going to be able to get the same density of grass over such a large area and with good frame rate in JKA. It wasn't built to efficiently render that many things :/ True, unfortunately. But you can play with density and have quite a lot of grass and decrease it on the distance. I think a good mix is possible - likely not what you're trying to achieve, though.Maybe having grass as an effect instead of sprite might help the framerate, after all effects also have a hide distance and shouldn't be (dynamically) as heavy as grass sprites. Even though it's just a bunch of planes? How shit! It's more than that, I think the wind effect that deforms them is one of the causes why the grass is so heavy.It would be interesting to see if other types of surfaceSprite or zero wind affect the framerate as much as the "original". Asgarath83 and Vegeta like this Link to comment
Tempust85 Posted October 12, 2015 Share Posted October 12, 2015 Well you could just make grass MD3 models, and put them in with misc_model. Sure they won't deform, but still might be cheaper fps-wise. Asgarath83 likes this Link to comment
Asgarath83 Posted October 12, 2015 Share Posted October 12, 2015 Well you could just make grass MD3 models, and put them in with misc_model. Sure they won't deform, but still might be cheaper fps-wise.for the sound that's need too a custom shortgrass material physic clip shader ... otherwise, place the model upon a grasssprite textured brushes. but i think short grass not need a solid clipper like a tree or a bush. Vegeta likes this Link to comment
Ramikad Posted October 12, 2015 Share Posted October 12, 2015 Well you could just make grass MD3 models, and put them in with misc_model. Sure they won't deform, but still might be cheaper fps-wise. Much easier with a surfaceModel shader. But then... filling an entire map with grass made of models would probably hit FPS even more than the surfaceSprite. http://q3map2.everyonelookbusy.net/shader_manual/ch3.htm#surfacemodel Link to comment
Vegeta Posted October 12, 2015 Author Share Posted October 12, 2015 @@Ramikad That q3map_surfaceModel option seems as though it may work. I have an idea. Perhaps I could make a grass model that is a single surface with a grass sprite texture, then animate that texture in a shader to simulate wind. I could then use that model in a texture shader that makes use of the surfaceModel option. Unfortunately I foresee this method as causing more fps drop than before, due to the high amount of models that would be rendered, regardless of their simplicity. Still, I feel as though there must be some kind of loophole that we could exploit in order to get more realistic grass in game. Link to comment
Tempust85 Posted October 13, 2015 Share Posted October 13, 2015 I wasn't including the thought of wind in what I said, but still what I said is an option though surfacemodel sounds easier. Link to comment
mrwonko Posted October 13, 2015 Share Posted October 13, 2015 A modern OpenJK renderer could greatly speed up grass rendering. Just saying. Link to comment
Vegeta Posted October 13, 2015 Author Share Posted October 13, 2015 @@mrwonko Do you know of any OpenJK mods that include "trueview" in their source code? I've never understood code very well, but I'm fairly confident that the set of .dlls that I'm currently using are what allow for "trueview." It would be very nice to have a more efficient renderer, but at the same time I can't really afford to lose the nice camera effects in my current set of code. Link to comment
mrwonko Posted October 14, 2015 Share Posted October 14, 2015 Efficient grass rendering would be a renderer thing (rd-*.dll), while camera code is gamecode (jampgamex86.dll) so they can be combined. Link to comment
Vegeta Posted October 14, 2015 Author Share Posted October 14, 2015 Oh, cool. I had considered that, but wasn't really sure if the mixed .dlls would function properly together. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now