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 / [SOLVED] [Bug?] Object animation doesn't work with custom shader.

Author
Message
Nieb
9
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 7th Aug 2018 07:49
I can't get animations to work while using custom shaders. Am I doing something wrong?
Test project attached.

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 7th Aug 2018 09:07 Edited at: 7th Aug 2018 09:08
This post has been marked by the post author as the answer.
No its not a bug and yes your doing it wrong. 3D object animation is handled in the vertex shader.

If you replace the stock vertex shader then you have to include the stock animation shader code with it too which uses quaternions to work out the blended positions and normals. You can get the stock vertex shader code by using GetObjectMeshShader() - take a look at it and add the bits relating to positions and normals to your shader and you can have a fully animated reflection shader. (at least I think thats what your after)
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Aug 2018 17:46
Model based animation isn't done in the vertex shader is it? Do animations not work with shadows then? Because they are calculated before the scene so any movement in the vertex shader isn't accounted for.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Aug 2018 17:52
@Santman
For the shadows you basically have a second shader set to render the depth into a render target which is then used to compare against the actual fragment depth.
So "yes" there is a step before rendering the actual object but "no" because you still use a vertex shader with the animation code in the previous step.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Aug 2018 18:45
Janbo, not sure what your saying yes too. Lol.

So, when I move, for example, tree branches and grass in the vertex shader the shadows don't move with them.....so why does animation??
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Aug 2018 19:27 Edited at: 7th Aug 2018 19:30
If you do the branch animation in a custom shader, how can the previous step for the shadows know what you are about to do ?
If its the default vertex shader then it should be fine, if not ...you have no chance but creating a command set to pass custom depth images using the new Git Project
Or maybe alter my shadow shader I made some time ago
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Aug 2018 20:34
That's my point.

Yeah, thank you for that link, still to look at it, but the AppGameKit shadows don't cut it for me anyway.....if something is too large vertically, the shadow cuts out when you move past it. Not sure I have the knowledge to fix that though.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 8th Aug 2018 21:30 Edited at: 8th Aug 2018 21:33
What happens to your large object if you set it up with SetObjectScreenCulling( objID, 0 ) ?

Login to post a reply

Server time is: 2024-04-18 09:59:51
Your offset time is: 2024-04-18 09:59:51