Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PoC, kind of][Grass] Can I borrow your lawn mower?

#1
I was experimenting with LOD models, and what would they be more suitable for than a nice lawn?
Turns out they are not fit for this purpose, at least not several hundred models in one map.

HOWEVER, I was impressed how well DP (and q3map2) can handle the good old q3map_surfaceModel, with ultra-low-poly models.
And because there's no point in keeping it to myself, I put together a test map to share my little grass experiment:

[Image: Vho5uLgt.jpg][Image: pUZkI1Ct.jpg]
http://www.mediafire.com/file/jlz9nnzlt3..._grass.pk3 (6MB)
(~6250 grass models with 8 triangles = ~50'000 individual grass blades)

It's a bit over the top and not very refined, but makes me chuckle every time I see it.
It could easily be improved with more diverse plant models and some further experimenting.
In an actual map, one would obviously need to be very careful about how many of the models are rendered at any given time.
Reply

#2
Right. I'll try it after Christmas, as I'm getting a new video card (yay!).
(08-10-2012, 02:37 AM)Mr. Bougo Wrote: Cloud is the new Web 2.0. It makes no damn sense to me.
Reply

#3
*hugs sev

thank you! I'd love to see this grass in some maps *.*
MY NOOB STATS:
[Image: 788.png]
Reply

#4
(12-16-2010, 02:16 PM)rainerzufalldererste Wrote: I'd love to see this grass in some maps *.*

Ons Reborn used that feature.
<Samual> I am the most unprofessional developer ever
<bluez> halogene, you make awesome music, but you have no clue about ctf.
<Halogene> I didn't know mappers include some mysterious waypoints so members of the BOT clan can navigate a map?
<divVerent> if you don't pay for a premium account, your movement speed is limited to 100qu/s
Reply

#5
Looks closer to shards of glass Big Grin, still impressive though. I don't even think Crysis had that many models on screen at once.
ECKZBAWKZ HUGE LIST OF ACHIEVEMENTS GOES HERE....


Oh wait.
Reply

#6
Dude Big Grin I love grass! No! Not that grass! Regular grass!
And I miss foliage in DP badly Smile If this could run smoothly, then - your name shall always be seen in this grass Smile sev, the creator of grass Big Grin

Btw: Can't it be improved by using textures istead of models for every single leaf (?) of grass?
You could have planes with textures and that could maybe save a lot of DP's power... much less triangles IDK...
[Image: BSF48.png][Image: HMITP48.png][Image: S48.png][Image: TLT48.png]
Reply

#7
(12-18-2010, 04:46 AM)Lee_Stricklin Wrote: Looks closer to shards of glass Big Grin, still impressive though. I don't even think Crysis had that many models on screen at once.

Crysis probably counts their total on-screen models as multiples of 6250. Tongue
Links to my: SoundCloud and bandcamp accounts
Reply

#8
(12-18-2010, 08:27 AM)unfa Wrote: Btw: Can't it be improved by using textures istead of models for every single leaf (?) of grass?
You could have planes with textures and that could maybe save a lot of DP's power... much less triangles IDK...

It highly depends on how it's done. It's often quite obvious and simply feels "cheap". There are also some other problems, like propper lighting of bigger texture surfaces (the models above are vertex lit).

I also have the experience that textures with an alpha channel are not necessarily performance friendly. (In Desert Factory v1r1, I replaced the alpha foliage and grates with actual models, without a performance loss)
Reply

#9
i really like this it will turn flat grass textures into a authentic grass landscape Big Grin

maybe it would be good to have a maximum view distance of the grass and the grass which is far away will become smaller and not just disappear
Reply

#10
I'd really like to see this grass used on an official map... unlike ons-reborn, this one actually looks good.
BRLOGENSHFEGLE (core dumped)

The Bot Orchestra is back! | Xoylent Easter Egg | 5bots1piano
My music on Google Play and SoundCloud
Reply

#11
i think in combination with the facility114 texture pack you can make a pretty sci fi biosphere or spacestation
<Samual> I am the most unprofessional developer ever
<bluez> halogene, you make awesome music, but you have no clue about ctf.
<Halogene> I didn't know mappers include some mysterious waypoints so members of the BOT clan can navigate a map?
<divVerent> if you don't pay for a premium account, your movement speed is limited to 100qu/s
Reply

#12
To kill your GPU, just copy paste this into your data/scripts folder, and name is as grass.shader:

Code:
textures/skies/bluesky
{
    qer_editorimage env/bluesky/bluesky_up.tga

    surfaceparm sky
    surfaceparm nolightmap
    surfaceparm nodlight
    surfaceparm noimpact
    surfaceparm nomarks

    skyparms env/bluesky/bluesky - - //farbox cloudheight nearbox
    q3map_sunExt 1 0.96875 0.9375 320 55 50 0 16 //rgb intensity degrees elevation deviance samples
}

textures/grass/grass1
{
    qer_editorimage textures/grass/grass.tga

    surfaceparm nomarks
    q3map_surfaceModel models/grass/grass.obj 21 0.25 8 24 0 360 1
        //modelpath density odds minscale maxscale minangle maxangle oriented
        {
        map textures/grass/grass.tga
            }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}

textures/grass/grass2
{
    qer_editorimage textures/grass/grass.tga

    surfaceparm nomarks
    q3map_surfaceModel models/grass/grass.obj 19 0.5 8 24 0 360 1
        //modelpath density odds minscale maxscale minangle maxangle oriented
    
    {
        map textures/grass/grass.tga        
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}

models/grass/grass
{
    qer_editorimage models/grass/grass.tga

    surfaceparm trans
    surfaceparm nonsolid
    surfaceparm nomarks
    surfaceparm noimpact
    deformVertexes wave 75 sin 0 2 0.1 0.1
    cull none

    {
        map models/grass/grass.tga
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}
[Image: 561.png]
"One should strive to achieve; not sit in bitter regret."
Reply

#13
sorry to dig this up, but do you think sev or someone could write a full tutorial on how to set this up?
Master of mysterious geometries

Imgur Gallery
Reply

#14
You just need to add the q3map_surfacemodel parameter to your shader, then q3map2 will randomly spawn models anywhere you apply the texture.
http://www.robotrenegade.com/q3map2/docs...rfaceModel

You should try applying a deformvertexes wave funciton to the grass, that would be schweet Tongue
Reply

#15
I've posted a modified shader above with wave function. low.cfg gives 2-5 FPS Big Grin
[Image: 561.png]
"One should strive to achieve; not sit in bitter regret."
Reply

#16
Sorry for bumping, but I would really hope we take a second look at this. It can give a REALLY realistic effect, and its just something that most modern engines are capable of doing. As I described on #darkplaces, foliage systems can mask a very simple terrain we are limited to using by the q3bsp. It allows for creating a much more visually impressive outdoor landscape. I can only imagine how good greatwall would look with the addition of 3d grass.

I changed the model to a 3-sided polygon with a dozen blades of grass on the one plane. Just like the above I used surfacemodel to place them about the map.
Code:
textures/grass/grass1
{
    qer_editorimage textures/ground/grassdead.jpg
    surfaceparm nomarks
    //modelpath density odds minscale maxscale minangle maxangle oriented
    q3map_surfaceModel models/plants/grass/grass.md3 20 0.25 0.5 2 0 360 1
    {
        map textures/ground/grassdead.jpg
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}
textures/plants/grass/grass1
{
    nomipmaps
    nopicmip
    surfaceparm nomarks
    surfaceparm pointlight
    surfaceparm trans
    surfaceparm nonsolid
    cull none
    {
        map models/plants/grass/grass01a.tga
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaFunc GT0
        depthWrite
        rgbGen identity
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}
produces:
[Image: dp000001.jpg]
The problem is there is no way to cull and thin out the grass that is far away.
What I'd suggest is it possible to add this feature to the engine? Whats stopping us from adding a per-distance culled model which gets randomly placed about a given shader?
Why can't we have this shader keyword?:
Code:
dp_foliage modelpath density odds minscale maxscale minangle maxangle oriented distance-cull
This would remove the limitation on misc_models that surfacemodel has and load the models into the map at run-time.
Reply

#17
(04-14-2011, 02:07 PM)GiffE Wrote: Sorry for bumping, but I would really hope we take a second look at this. It can give a REALLY realistic effect, and its just something that most modern engines are capable of doing. As I described on #darkplaces, foliage systems can mask a very simple terrain we are limited to using by the q3bsp. It allows for creating a much more visually impressive outdoor landscape. I can only imagine how good greatwall would look with the addition of 3d grass.

I changed the model to a 3-sided polygon with a dozen blades of grass on the one plane. Just like the above I used surfacemodel to place them about the map.
Code:
textures/grass/grass1
{
    qer_editorimage textures/ground/grassdead.jpg
    surfaceparm nomarks
    //modelpath density odds minscale maxscale minangle maxangle oriented
    q3map_surfaceModel models/plants/grass/grass.md3 20 0.25 0.5 2 0 360 1
    {
        map textures/ground/grassdead.jpg
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}
textures/plants/grass/grass1
{
    nomipmaps
    nopicmip
    surfaceparm nomarks
    surfaceparm pointlight
    surfaceparm trans
    surfaceparm nonsolid
    cull none
    {
        map models/plants/grass/grass01a.tga
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaFunc GT0
        depthWrite
        rgbGen identity
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendFunc filter
    }
}
produces:
[Image: dp000001.jpg]
The problem is there is no way to cull and thin out the grass that is far away.
What I'd suggest is it possible to add this feature to the engine? Whats stopping us from adding a per-distance culled model which gets randomly placed about a given shader?
Why can't we have this shader keyword?:
Code:
dp_foliage modelpath density odds minscale maxscale minangle maxangle oriented distance-cull
This would remove the limitation on misc_models that surfacemodel has and load the models into the map at run-time.

Hmm, we can use LOD on misc_gamemodel already (see entities.def in the Xonotic gamepack for NetRadiant), I don't see why it couldn't be extended to this. Of course our LOD implementation lies in QuakeC afaik, and this would have to be an engine feature.
Links to my: SoundCloud and bandcamp accounts
Reply

#18
(04-14-2011, 06:05 PM)FruitieX Wrote: Hmm, we can use LOD on misc_gamemodel already (see entities.def in the Xonotic gamepack for NetRadiant), I don't see why it couldn't be extended to this. Of course our LOD implementation lies in QuakeC afaik, and this would have to be an engine feature.

That would be nice if it's adapted for foliage.
In the current implementation though, that didn't work. Even a few 100 models make the map unplayable (crash; memory overflow ?).
Loading times are extremely long in any case.
And lights are less efficiently added as well, I guess. I got very poor performance with only a few dozen models.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-