Page 2 of 2

Posted: Mon Nov 01, 2010 3:37 pm
by VeeZed
ent1ty wrote: However, mine runs on 360 fps when i switch to default irrlicht lighting :lol:

But, yes, your map is a lot bigger

And you also have some AI and animated characters there.

So it's hard to tell. Mine looks a lot nicer though :P Also, your grass animates in a weird way. :)
OK. You win. Doesn't matter.

The question is where I missed the point. I.e. 360 yours versus 120 mine - this is clearly a way for an optimization. Could you describe the geometry you are using in yours? (i.e. single poly structure, overall mesh-structure, how you cull them). I see that I can learn a bit from this. Hope you don't mind.

Posted: Mon Nov 01, 2010 3:39 pm
by Virion
ent1ty wrote:
VeeZed wrote:This looks pretty good :) Please bear in mind that 5470 is 4 years newer than mine, so it would be interesting to compare the results on the same app (i.e. your chipset is 5 times quicker than mine in terms of fillrate). So could you send me yours, or use mine? :)
Ok, checked yours. Runs on 130 fps.

However, mine runs on 360 fps when i switch to default irrlicht lighting :lol:

But, yes, your map is a lot bigger

And you also have some AI and animated characters there.

So it's hard to tell. Mine looks a lot nicer though :P Also, your grass animates in a weird way. :)
all i can say is, nice texture. :D

Posted: Mon Nov 01, 2010 3:48 pm
by ent1ty
Indeed, the texture is probably what matters the most :D (thanks, ACE :wink: )

VeeZed: my grass meshes are triangles - so each is made of 3 planes. The culling is very simple, you just do

Code: Select all

Node->setAutomaticCulling(irr::scene::EAC_FRUSTUM_BOX);
It's also very fast, because you don't need to loop them two times, but are looped only once - when rendered(at least i think that's how irrlicht does this). Also, those grass objects, which are out of range, are not only invisible, but they are destroyed completely - and recreated, when they come into range of the active camera.

EDIT: oh, and mine is animated in the shader

Posted: Mon Nov 01, 2010 3:59 pm
by VeeZed
ent1ty wrote:Indeed, the texture is probably what matters the most :D (thanks, ACE :wink: )

VeeZed: my grass meshes are triangles - so each is made of 3 planes.
it's not easy to understand the exact location of these 3 planes (too dark for this :) ). i.e. whether it's a 3 vertical ones with different angles, or something else. Could you let me know how it will look when viewed from above?
ent1ty wrote: EDIT: oh, and mine is animated in the shader
I can't see the animation on images, sorry :) Did you post an URLs anywhere on this forum?

Posted: Mon Nov 01, 2010 4:09 pm
by ent1ty
Image

The one on the right, shaped like a triangle.

No, i didn't post any link :P It's work in progress :wink: I may record a video, and see if i can upload it(i have very slow network here)

Posted: Mon Nov 01, 2010 4:54 pm
by VeeZed
ent1ty wrote: The one on the right, shaped like a triangle.
OK. I see. This always work good for the FPS (specially terrain-based FPS), but it isn't very nice for the RTS-like things. The camera in RTS is positioned much higher, so you often see the top part of the "mesh" (i.e. you actually see that it is just a flat quad.

And you didn't tell what kind of animation do you apply (i.e. whether this is a vertex shader or fragment one, how does it work etc).

Posted: Mon Nov 01, 2010 4:58 pm
by ent1ty
Well, i supposed that you know a thing or two about shaders, and knew, that fragment shader only applies color :wink:

Anyway, vertex code here!

Code: Select all

if(gl_MultiTexCoord0.y <= 0.9)
    {
        vec4 vertex= gl_Vertex;
        vertex.z+= Offset;
        vertex.x+= Offset;
        gl_Position = gl_ModelViewProjectionMatrix * vertex;
    }
Offset is calculated by Irrlicht:

Code: Select all

float offset= sin(Timer->getTime()/1000.0) / 10.0;

Posted: Mon Nov 01, 2010 5:11 pm
by VeeZed
ent1ty wrote:Well, i supposed that you know a thing or two about shaders, and knew, that fragment shader only applies color :wink:
Well, as you might know (as you too know a thing or two about shaders), they can also be used to make a "distortion effect" in texture (say, per-pixel adjust of the texture coordinates). This can also lead to a very nice motion.

That is why I asked :wink:

Posted: Mon Nov 01, 2010 5:14 pm
by ent1ty
Yes. A very nice way of killing the frame rate, while hiding it cunningly into some shader math :) :lol:


Maybe we could call this way a la Blackadder? :wink:

Image

Posted: Mon Nov 01, 2010 5:25 pm
by VeeZed
ent1ty wrote:Yes. A very nice way of killing the frame rate, while hiding it cunningly into some shader math :) :lol:
OK. Good to know that you are not one of this "anything-can-be-done-by-pixel-shader" guys (or should I say geometry shaders? because it seems that it's a new idol for a lot). Nothing personal, I just had to check ;)

Posted: Mon Nov 01, 2010 7:29 pm
by slavik262
Don't hate on shaders, hate on overly complicated ones. If you only do a few ops besides multiplying by your transforms, your shader doesn't need to be much slower than the fixed function pipeline at all. Of course, you should always minimize the work done in shaders for maximum scalability.

Posted: Sun Nov 14, 2010 2:04 pm
by VeeZed
OK. I just wanted to update the status. The change of the texture added a lot to the appearance of the grass. I've also added "bushes" using the same generation technique.

The results are the following:
Image
Image
Image

PS: don't look at the FPS now - this is done using my work laptop (very bad videocard). additionally, I'm still working to optimize these things and I hope to get a significant increase of the performance after the next several tweaks.

Posted: Sun Nov 14, 2010 4:35 pm
by macron12388
It's looking good :D

Posted: Thu Nov 18, 2010 9:09 am
by agamemnus
Those leaf blades look infinitely better than the original textures.