Page 2 of 2

Re: Skeletal animation for ZGE

Posted: Wed Jan 06, 2016 9:58 am
by Rado1
Barefists wrote:but it seems the Cal3D model only accepts lighting from one source.
That's not problem of Cal3D, the problem is that your shader uses just one light (it access only gl_LightSource[0]). It should iterate through all lights on scene.

BTW you do not need to use external library to add more lights. Simply, add more Light components to the ZApplication.Lights section.

Re: Skeletal animation for ZGE

Posted: Wed Jan 06, 2016 2:07 pm
by Barefists
Ah, thanks! I understand now :)

Re: Skeletal animation for ZGE

Posted: Thu Jan 07, 2016 4:49 am
by Barefists
Took a morning out to learn GLSL, finally got it to work! Thanks Rado1, and sorry for having so many questions for you.

Right now it doesn't take into account distance from each light yet, and specularness is a little odd, will improve it!

Image

Re: Skeletal animation for ZGE

Posted: Thu Jan 07, 2016 1:30 pm
by Rado1
Your example looks nice. If possible, I would be curious to see your shader code when finished. BTW having meaningful questions is the best way of learning for you and also for me, do not worry.

Re: Skeletal animation for ZGE

Posted: Thu Jan 07, 2016 4:33 pm
by Barefists
I improved it a little, also made it reference the ambient light set in ZGE.

Image

The project can be download here in it's current state.

The original shader code was referenced from this website. I added in the adjustments to make it iterate through all available lights.

Right now there's no way to adjust the strength and dropoff for point lights in ZGE, but I think I might be able to hack it using shaders and referencing the spot dropoff float. That'll probably be the next improvement I'll add to the shader.

Re: Skeletal animation for ZGE

Posted: Mon Jan 11, 2016 10:10 am
by Barefists
I'm having another issue, trying to add any new bitmap from file to the project crashes the build. I can't figure out what's wrong with it :(
If anyone has a clue, please give me some pointers.

Re: Skeletal animation for ZGE

Posted: Tue Jan 12, 2016 1:56 pm
by Barefists
Strange, when I save it, close ZGE, then reopen ZGE, it works. I have to do this each time I import a new bitmap with the project attached above. :/

Re: Skeletal animation for ZGE

Posted: Tue Jan 12, 2016 2:05 pm
by Rado1
I have tried your project and dragging/dropping a bitmap to project tree makes no problem... Is the bitmap in correct format? Could you please provide the bitmap that makes problems and/or describe steps leading to crash?

Re: Skeletal animation for ZGE

Posted: Sat Jan 16, 2016 2:38 am
by Barefists
Hi, Sorry for the late reply - was a busy week.

I'm actually just re-importing the same textures on blondie again to test, and the crash happens on trying to play the project, not during the import.
Also, I'm getting a blank screen when trying to export it to an exe, not sure if it's a problem with shaders or dll. :(

XM

Re: Skeletal animation for ZGE

Posted: Sat Jan 16, 2016 5:15 pm
by Rado1
hi, you should check the error messages and try to detect where the problem in ZGE project occurs. Maybe try to revert some of your changes to localize the problem... if your trials fail, you can send me the project files for analysis...

Re: Skeletal animation for ZGE

Posted: Tue Apr 11, 2017 7:05 pm
by Rado1
Because google drive has changed links of my public folders, I' giving you updated link to ZgeSkelet library and demos: https://drive.google.com/drive/folders/ ... sp=sharing