Page 7 of 8

Posted: Sun Dec 21, 2008 6:46 pm
by Dorth
or irrExt if nothing else (which it might be part of)

Posted: Tue Jan 27, 2009 3:12 pm
by reetu.raj
It is really cool looking grass !! Great work !

Posted: Wed May 13, 2009 12:58 pm
by pera
can this grass scene node be saved to irr scene?

Help compiling in Linux

Posted: Thu Jul 30, 2009 1:29 pm
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?

Posted: Thu Jul 30, 2009 2:26 pm
by hybrid
Looks like you're using an old version of Irrlicht. The transparency settings were introduced in 1.5

Posted: Sun Aug 16, 2009 11:01 pm
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

Posted: Mon Aug 17, 2009 3:43 pm
by devsh
it must be in the sky because when you multiply (terrain below y0) a negative by a negative you get a positive.

Posted: Thu Mar 11, 2010 5:29 pm
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.

Posted: Fri Mar 26, 2010 3:08 pm
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.

Posted: Fri Mar 26, 2010 3:42 pm
by hybrid
TextureWrap is now split into TextureWrapU and TextureWrapV, so you need to double the line and change the attribute names accordingly.

Posted: Mon Mar 29, 2010 6:29 pm
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 .

Posted: Fri Apr 02, 2010 6:55 pm
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?

Posted: Fri Apr 02, 2010 8:40 pm
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?

Posted: Fri Apr 02, 2010 8:44 pm
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.

Posted: Sat Apr 03, 2010 12:17 pm
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.