Page 1 of 1
Re: Grass Module
Posted: Tue Feb 04, 2014 10:44 am
by Kelebrindae
Hi, Alexi.
If you replace:
Code: Select all
vertex_program_ref vs_Grass {
param_named_auto offset custom 1
}
by
Code: Select all
vertex_program_ref vs_Grass {
param_named_auto offset costime_0_x 10000.0
}
in grass.material, you can skip the calls to "Grass::Update(hGrass)" in the PB code.
=> you loose a little control over the grass blades, but it could lead to a big performance increase (all the animation is done in the shader + no need to access the entities, so you can use static geometry).
Re: Grass Module
Posted: Tue Feb 04, 2014 11:19 am
by Bananenfreak
Uhh, thank you alexis. I will test it as soon as possible

Re: Grass Module
Posted: Tue Feb 04, 2014 1:53 pm
by Kelebrindae
You're welcome!
You can find all the "auto" parameters here:
http://www.ogre3d.org/docs/manual/manua ... d_005fauto
Re: Grass Module 2
Posted: Sun Feb 16, 2014 9:21 am
by Samuel
Alexi wrote:
Shadows actually not working, maybe the shader master samuel will take a look.
I'm not even close to a master. A master would know what he's doing. Half the time I'm guessing.
Sorry for the late reply. I've been busy, but I finally found the time to look through the shader.
The original script was setup to use a shadow caster and receiver.
As far as I know we can't use them because we need to enable them in Ogre with
Code: Select all
SceneManager::setShadowTextureCasterMaterial("ShadowCasterName");
SceneManager::setShadowTextureReceiverMaterial("ShadowReceiverName");
So, I don't think there's much we can do about the shadows for now.
Re: Grass Module 2
Posted: Sun Feb 16, 2014 10:39 am
by Bananenfreak
Hmm, then cut the Piece with shadow out of the material,... . If TextureAdditive works in your example, it could be possible that we see right shadows (I believe there were big grammar issues).
Re: Grass Module 2
Posted: Sun Feb 16, 2014 11:09 am
by Samuel
http://www.purebasic.fr/english/viewtop ... 77#p421777
This was a method I used in the past to allow TextureAdditive shadows on an alpha image.
Unfortunately, I can't get it to work in this case.
I believe it doesn't work now because we are using shaders to create the wind effect.
The shader has control over the texture and how it gets applied to the scene.
In my old example I was just using a simple material script without shaders.
If someone can get my old example to work with shaders or find some other way to create the shadows that would be great.
If not then we will probably have to wait until we can get more control over the shadow materials.
Assuming I understand all this correctly. If and when we get control of the shadows. We will be able to create shaders for soft shadows and other cool shadow effects.
Re: Grass Module 2
Posted: Mon Feb 17, 2014 8:59 am
by Bananenfreak
No shadow isn´t right...
"Shadows" are only updated at the end of move from left to right or right to left. And... It´s not really a shadow. I think it casts itself...
And also there is one terrainbug. I posted it already a few months ago.