Page 1 of 1

Best way to do Vegetation?

Posted: Wed Apr 03, 2013 5:00 pm
by Mexicouger
I am looking into vegetation(3D grass and plants), and have a couple various ways in my mind to go about it. I am curious to see how you guys would do vegetation for Darkplaces(Most optimal, best looking way).

My ways would be:

1- Create a particle graphic, add it to particlefont, alpha mask it, create a particle effect for it, and add a mapping entity where the particle can spawn in a randomized patch.
(Pros: fairly memory efficient, cons: not controllable, not affected by light)

2-Create 2 planes that intersect and use it as a model with an alpha grass vegetation texture. Spawn these models as an entity. (Pro: Full control of the grass in code, cons: uses alot more power to run them.)

On a side note, is there any way to make an alpha texture (whether it's tga or png) to be fully solid and not slightly translucent? Or is there a color in Darkplaces that can be used as a mask to remove a particular color?

Re: Best way to do Vegetation?

Posted: Wed Apr 03, 2013 10:39 pm
by frag.machine
Mexicouger wrote:On a side note, is there any way to make an alpha texture (whether it's tga or png) to be fully solid and not slightly translucent? Or is there a color in Darkplaces that can be used as a mask to remove a particular color?
On DP, using PNG without alpha channel but with a transparent color works for me. I use Irfanview to convert from BMP/TGA/whatever to PNG.

Re: Best way to do Vegetation?

Posted: Thu Apr 04, 2013 3:13 am
by Hectate
Combine the methods to get the best of both worlds?

Oh, and I didn't see anything on the DP docs that indicated that there could be a alpha map - it seems to be part of the diffuse only? I was going to suggest a 2-bit alpha texture if that was an option but I suppose not.

Re: Best way to do Vegetation?

Posted: Sun Apr 07, 2013 3:03 am
by goldenboy
completely model it?

Re: Best way to do Vegetation?

Posted: Sun Apr 07, 2013 5:03 am
by leileilol
BGRA32 should be fine.

Fun fact: on modern, shader-based hardware, it's slower to do the traditional alphatest than an alphablend.