Grass Node v0.3.x

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

or irrExt if nothing else (which it might be part of)
reetu.raj
Posts: 17
Joined: Wed Aug 27, 2008 5:11 pm
Location: Orlando
Contact:

Post by reetu.raj »

It is really cool looking grass !! Great work !
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

can this grass scene node be saved to irr scene?
marmz
Posts: 7
Joined: Wed Jul 29, 2009 2:48 pm

Help compiling in Linux

Post by marmz »

Hi all.
I'm trying to compile the GrassPatchSceneNode
here's output:
------------------------------------------------------------------------
main.cpp: In function ‘int main()’:
main.cpp:311: error: ‘ALLOW_ZWRITE_ON_TRANSPARENT’ is not a member of ‘irr::scene’
--------------------------------------------------------------------------------------------------------
any ideas?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Looks like you're using an old version of Irrlicht. The transparency settings were introduced in 1.5
m_krzywy
Posts: 133
Joined: Sat Nov 04, 2006 2:05 pm

Post by m_krzywy »

Not working with 1.5 - app crash :P
After that i have changed: height sth with getting height to found on the forums:

Code: Select all

f32 ay = TerrainHeightMap->getPixel(x1,z1).getBlue()* Terrain->getScale().Y;
f32 by = TerrainHeightMap->getPixel(x1+1,z1).getBlue()* Terrain->getScale().Y;
f32 cy = TerrainHeightMap->getPixel(x1,z1+1).getBlue()* Terrain->getScale().Y;
f32 dy = TerrainHeightMap->getPixel(x1+1,z1+1).getBlue()* Terrain->getScale().Y;
f32 u = xz.X - (f32)x1;
f32 v2 = xz.Z - (f32)z1;
height = ay*(1.0f-u)*(1.0f-v2) + by*u*(1.0f-v2) + cy*(1.0f-u)*v2 + dy*u*v2; 
working but very buggy. My terrain is scaled and grass is like on the sky when terrain is lower in y than 0.

It seems not to listen to grassmap i made :P
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

it must be in the sky because when you multiply (terrain below y0) a negative by a negative you get a positive.
digoxy
Posts: 51
Joined: Wed Feb 17, 2010 3:55 pm
Location: Currently Germany.

Post by digoxy »

Bitplane, do you have a version of this that will work with arras ShTlTerrainSceneNode? These two combined would make for a great landscape.

Thanks in advance.
Grandma-- / Grandpa --
JustMax
Posts: 7
Joined: Sat Nov 10, 2007 10:26 pm
Location: Germany

Post by JustMax »

hey,

I compiled the GrassSceneNode with irrlicht 1.7.1 and I got this error
'class irr::video::SMaterialLayer' has no member named 'TextureWrap'

Code: Select all

		grass[x*width + z]->getMaterial(0).TextureLayer[0].TextureWrap = video::ETC_CLAMP;
if I commend that line out it seems to works fine though(tested on win7 an Linux).

Another thing, I don't know if that is a bug in Irrlicht or the GrassSceneNode but when I edit or just save the terrain-grassmap with Paint(Win7) it won't work.
Maybe its not a bug at all but MS screwing with the .png standard.
if(Hell.isFrozen())
{
...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

TextureWrap is now split into TextureWrapU and TextureWrapV, so you need to double the line and change the attribute names accordingly.
ilovechocolat
Posts: 2
Joined: Sun Mar 28, 2010 10:34 pm

Post by ilovechocolat »

hello !
First i'm french and my english is very bad .

where can i found the v 0.3 of the grassNode because the 0.31 dont work with Irrlicht 1.7.1 very well (material dont work so the grass look like black cube), the v 0.25 work but i think v 0.3 is very most beautifull as v 1.25 .
JustMax
Posts: 7
Joined: Sat Nov 10, 2007 10:26 pm
Location: Germany

Post by JustMax »

hey,

I have some bugfixes:

in CGrassPatchSceneNode.cpp:
you should change (257):

Code: Select all

f32 dist =(Box.getCenter() + getPosition()).getDistanceFromSQ(SceneManager->getActiveCamera()->getPosition()) + 1;
to:

Code: Select all

f32 dist =(Box.getCenter() + getPosition()).getDistanceFromSQ(SceneManager->getActiveCamera()->getAbsolutePosition()) + 1;
and (237):

Code: Select all

core::vector3df campos = SceneManager->getActiveCamera()->getPosition();
to:

Code: Select all

core::vector3df campos = SceneManager->getActiveCamera()->getAbsolutePosition();
is everyone cool with it?
if(Hell.isFrozen())
{
...
JustMax
Posts: 7
Joined: Sat Nov 10, 2007 10:26 pm
Location: Germany

Post by JustMax »

sorry for the double post but I want the make the grass more even and stop the "popping up" of the blades. What lines of code do i have to modify?
Could somebody please give me a hint?
if(Hell.isFrozen())
{
...
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

You may try fading in the grass blades. Instead of popping in, just increase the alpha value from 0 to 255. It's still obvious when they appear, but it looks much smoother. Oblivion did something like this.
JustMax
Posts: 7
Joined: Sat Nov 10, 2007 10:26 pm
Location: Germany

Post by JustMax »

well blending them in with alpha would be über cool but for now all im trying to do is taking away the quadratic characteristic of the distribution of the blades and using a more liner one. But I can't find the lines of code responsible for the distributing the grass.
if(Hell.isFrozen())
{
...
Post Reply