Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / BUG ? 2.016 (windows8) : SetObjectShader() & PlayObjectAnimation() : no animation

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 15th Jan 2016 18:10 Edited at: 15th Jan 2016 18:13
Hi

I don't know if it's a bug or if there is a special technic to use a shader with an animated model (.dae), but if I use a shader on an animated model :
- the model is rotated in X (90°)
- the animation doesn't work (no animation at all).

Tested with LoadObjectWithChildren() and CloneObject() : same result.



Is there a way ot use a shader on an animated model ?

I can post a complete example or the sahder if needed, but it doesn't work with all of my shaders tests.
Thanks
AGK2 tier1 - http://www.dracaena-studio.com
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 16th Jan 2016 11:25
Hi Blendman

You need to include the animation stuff in the shader , this is the shader i use with animations and no problems:



And:



Just remove the lightmap and shadow stuff and replace it with your own , and your ready to rock

best regards Preben Eriksen,
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 16th Jan 2016 12:30
@Preben : thanks.
I have tried to change my shader.
But I have a problem to convert it, because I use a different position to calculte gl_Position from my original shader (to have a sphere mapping projection) :

Do you know how I can convert :


To work with your code :


I have tried several solutions without succes ^^.
AGK2 tier1 - http://www.dracaena-studio.com
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 16th Jan 2016 12:47
To add world matix , try using agk_WorldViewProj , it should combine world, view, and projection , so replace agk_ViewProj with agk_WorldViewProj ( in my code ).
best regards Preben Eriksen,
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 17th Jan 2016 16:47
Hi
I have tested and it doesn't work. In fact, I have to change the normal calculation not the position for the shader.

So, I have changed the uv1Varying in my old code :


By :


And it's ok now, thanks for your help .

AGK2 tier1 - http://www.dracaena-studio.com

Login to post a reply

Server time is: 2024-11-17 03:04:20
Your offset time is: 2024-11-17 03:04:20