Skeletal animation for ZGE

Use of external libraries (DLLs) from ZGE.

Moderator: Moderators

User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: Skeletal animation for ZGE

Post 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.
User avatar
Barefists
Posts: 17
Joined: Fri Jan 01, 2016 4:25 pm
Location: Singapore

Re: Skeletal animation for ZGE

Post by Barefists »

Ah, thanks! I understand now :)
User avatar
Barefists
Posts: 17
Joined: Fri Jan 01, 2016 4:25 pm
Location: Singapore

Re: Skeletal animation for ZGE

Post 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
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: Skeletal animation for ZGE

Post 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.
User avatar
Barefists
Posts: 17
Joined: Fri Jan 01, 2016 4:25 pm
Location: Singapore

Re: Skeletal animation for ZGE

Post 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.
User avatar
Barefists
Posts: 17
Joined: Fri Jan 01, 2016 4:25 pm
Location: Singapore

Re: Skeletal animation for ZGE

Post 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.
User avatar
Barefists
Posts: 17
Joined: Fri Jan 01, 2016 4:25 pm
Location: Singapore

Re: Skeletal animation for ZGE

Post 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. :/
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: Skeletal animation for ZGE

Post 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?
User avatar
Barefists
Posts: 17
Joined: Fri Jan 01, 2016 4:25 pm
Location: Singapore

Re: Skeletal animation for ZGE

Post 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
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: Skeletal animation for ZGE

Post 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...
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Re: Skeletal animation for ZGE

Post 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
Post Reply