Grass Node v0.3.x
Nice work, maybe one day it will look like this photo http://www.pbase.com/shaun/image/45971252 (maybe you can use it for grass texture...)
Hi bitplane,
I want to use your node in my project. But I have to change the size of the grass billboards. I took a look into your code and found that it has something to do with the "dimensions" value.
How could I scale these billboards down, as I use my own camera node with a far clipping plane of 300, which seems to affect the size?
Thanks in advance and best regards - Xaron
I want to use your node in my project. But I have to change the size of the grass billboards. I took a look into your code and found that it has something to do with the "dimensions" value.
How could I scale these billboards down, as I use my own camera node with a far clipping plane of 300, which seems to affect the size?
Thanks in advance and best regards - Xaron
Hey Xaron
The far plane shouldn't affect the size of the blades, to change their size, just change the following line in CGrassPatchSceneNode::Create :
as you can see, its currently set to make grass between 50 and 90 wide and 50 and 110 tall. Wider grass provides better coverage, but thinner grass looks better on steep hills or when it is more sparce
hope this helps
The far plane shouldn't affect the size of the blades, to change their size, just change the following line in CGrassPatchSceneNode::Create :
Code: Select all
core::dimension2d<f32> size(rand() % 40 +50, rand() % 60 + 50);
hope this helps
Hey bitplane, it's me again.
I have a suggestion concerning these lines:
Due to the fact that you use the grey value as a height parameter you get some really ugly interpolation errors, especially if you use a 8 bit heightmap. I will try to improve this using some kind of interpolation.
How do you get around this?
Thanks and best regards - Xaron
I have a suggestion concerning these lines:
Code: Select all
s32 x1 = (s32)(p.X/TerrainScale.X);
s32 z1 = (s32)(p.Z/TerrainScale.Z);
video::SColor c = TerrainHeightMap->getPixel(x1,z1);
f32 height = c.getBlue() * TerrainScale.Y;
Particles[i].pos.Y = height + Particles[i].size.Height/2;
How do you get around this?
Thanks and best regards - Xaron
hmm this reminds me, the wind interpolation code is also wrong. currently it interpolates diagnally across the middle from top left to bottom right without worrying about the other two corners. it should go left side, right side, then across the middle (or the other way round).
the height of the grass should really use code stolen from the terrain node, but i got that code from these forums and haven't really looked into it properly. I'll squirt out a new version sometime this weekend!
the height of the grass should really use code stolen from the terrain node, but i got that code from these forums and haven't really looked into it properly. I'll squirt out a new version sometime this weekend!