[WIP] Flying Bird

I’m tying to make my first mini-game with Panda3d.

It’s work in progress but comments and crits are welcomed.

Screens:

Video:
http://youtu.be/zJl4GoZiDmY

Needs a gameplay now :arrow_right:

Nice.
Did you want to post this video instead? youtube.com/watch?v=Kx0KNK7y … re=related
I found it in the list of suggestions.

Anyway, poor bird can’t find it’s flock? (spoiler?)

I like the painterly rendering.
how do you do it?
it has still too much polygon/cube visible in the cloud imo but it’s nice.

Looks cool. Have you decided what kind of gameplay it’s gonna have? It could have some flying through rings with limited time. Or maybe dodging other birds who try to attack you. One important thing for such game is to keep movement fluid.

Thanks for replies!

Ok I will remake the clouds :smiley:

What do you mean by painterly rendering ? (background, shader or bird)

Thanks for ideas, I think I will make him dodge flying birds or other objects.

I’m talking of the shader ( for the bird in particular ).

for the polygon, my guest in that you should have a texture with alpha = 100% on the edge with a nice gradient to ‘round’ it.

Hello,

the bird texture is hand-painted and at first I used a zelda WW shading style (2 ranges for light) :

classic cell shading gives this :

// cell shading
    float intensity = dot(L, N);
    float factor = 1.0;
    if ( intensity < 0.9 ) factor = 0.9;
    if ( intensity < 0.5 ) factor = 0.5;
    if ( intensity < 0.2 ) factor = 0.0;

But if you have too many light zones, it’s gonna look like posterization effect. In case of zelda WW, I think there is 2 zones of light : 1 for light, 1 for self-shadows :

// cell shading WW style
    float intensity = dot(L, N);
    float factor = 1.0;
    if ( intensity < 0.5 ) factor = 0.1;

You can have factor = 0, for full black shadows, 0.1 is to simulate ambiant light.

On the screens of this thread it’s using simple phong shading however.


This bird was a bit old and he’s annoying me right now :smiley: so I rewiped the textures and models, it looks less cartoon now, but I have problems to finalize it, I should have remake it from scratch ( I hate modelling).

The clouds are simple quads, the “square” effect was desired to contrast with round shapes from the bird, but if it looks like a bug or polygon at first sight, I need to redo it as well.

really well done. I tough that the shader for the bird were more complex from the video.

the edge seems a bit blurred, I tough that was an artefact from the shader.

I forgot to say there is a fxaa shader on top of all shaders, that’s why the edges are blurred. You can find this shader in my deferred shading thread, it’s not last fxaa version, but it’s simple to implement and not so expensive.

Update.

video:
http://youtu.be/kYVcyG60u38

EDIT : animations following keyboard inputs :
http://youtu.be/M_ngNDz6viU

screens:

I have some problems with blender => panda,

  • how do you know how your texture is gonna behave when your quads are triangulated, you can see some differences between blender quads model and panda tris model (noticable on the eye not round anymore) ?

  • how do you unwrap a sphere to paint it without having uv seams appear ? (artifacts noticeable in video)

PS : the wings alpha needs some cleanup, I’m having a hard time animating them too.

Sometimes you need to triangulate a mesh before exporting. Just go to Edit mode, select all faces (A), then Ctr + T. if you are not happy with how some quads were triangulated, select the two triangles, and do “Meshes->Faces->Flip triangle edges”. I’m afriad that’s unavoidable, there are two possible triangle pairs you can get by triangulating a quad, Blender and Panda decide each randomly (there is no other way for Blender to guess which is “right” or which is what you want) and so it’s not surprising that they don’t do it the same way always.
So just triangulate it in Blender before exporting.

I can think of these ways to unwrap an uvsphere:

It doesn’t matter how you unwrap it, how you make the texture matters, as I tried to show with the green text.

I think it’s just caused by the texture wrap mode. Try this instead:

texture.setBorderColor(Vec4(0,0,0,0))
texture.setWrapU(Texture.WMBorderColor)
texture.setWrapV(Texture.WMBorderColor)

Or in Blender, the Extend button in the “Map image” tap, under “Texture buttons”. Or just add some more alpha border to the texture.

Nice model anyway.

Redpanda thanks for the explanations ! I tried the flip triangle edges thing, it’s working nicely, but it will take long to get correct results :confused:

unfortunately, I texture the model in the shader, what does this line exactly do “Texture.WMBorderColor” ?

I noticed difference too in blender when I use alpha premultiply on feather texture or not. I wonder if it’s possible to do the same in Panda.

Update:
I’m adding feathers, this is gonna take a long time :smiley:

There will be black and white feathers, each color with its own texture atlas to vary feather form. I want to do this, but I don’t know if it will work.

that starting to be reallty beautiful.

you will have problem with alpha on the feather, since they will overlap.

If your UV maps are bigger than the texture (UV plane), what happens?
The manual explains this:
panda3d.org/manual/index.php … Wrap_Modes

Basically if you have a texture like this:

It I think by default will repeat like this:

So a little bit from the opposite side of the texture gets rendered, which you don’t want.

When you use the mode WMBorderColor,

anything beyond the UV plane (texture) is replaced with the color you specify. If you set (0,0,0,0) it will be transparent and that’s what you want.

There should be something like that in Cg.

That’s another thing. basically png and some other formats have something like a “background” color, which is used when calculating the feathered edges or something. When you use “premultiply”, I think the background color isn’t written and calculated at runtime or something? I’m not sure myself.

EDIT: BTW, if you get render artifacts on overlapping alpha textured polygons (the feathers), just use Dual or Binary alpha modes.

Some update,
I’ve put the scene online, still a long way to go (code & models).

here is the link : http://plb5.free.fr/index.php?/current/flying-bird/

You can tell me if it’s working on your computer and if you get the same lighting as in the videos, thanks ^^. If not, tell me what your computer specs are.

See you soon!

runs fine here, except for the lightning-flashes it pretty much matches the video visuals.
as always, excellent work you did there :slight_smile:

this looks great! keep up the good work! somehow this reminds me of Okami

Thanks!

Some update : grebble, tori and sounds, “gameplay” code structure.

The sound is not synchronized, my recorder is bad : http://youtu.be/xf1PcUFbGZE

Gimp preview of shaders :

Box :

The bird is entirely white on my Macmini (model Macmini5,1).

Thanks, I’ll post lighter version soon, the current one is not using basic shader only.