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 / Agk 2.0.15b, fragment shader problem agk_ObjColor.

Author
Message
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 2nd Nov 2015 10:36
Hi,

After i updated to 2.0.15b , all of my own shaders do not work as they should, it looks like agk_ObjColor is always empty (0,0,0,0).

uniform vec4 agk_ObjColor;

Did it change name ?
best regards Preben Eriksen,
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 2nd Nov 2015 19:11
Yeah, I need to write a guide on all the shader changes, as there is a new shader generation system that creates shaders on the fly based on how many lights there are.

The new parameter for color is agk_MeshDiffuse and there is a new one agk_MeshEmissive for the SetObjectColorEmissive color.
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 3rd Nov 2015 16:42

agk_MeshDiffuse works perfectly

FYI:
I also noticed that when using animations , the animations dont work if i use my own shader, only when using the default shaders. ( it do display the object, but only the first frame ).
making a small demo and just needed this:
vertex:
distToCamera = gl_Position.z;
fragment:
gl_FragColor = mix(gl_FragColor, vec4(fogColor, gl_FragColor.w), clamp(distToCamera/CameraRange,0.00,1.00) );
(not a huge problem)

SetObjectScale dont work with animated objects , but SetObjectScalePermanent do work!

Animations only seams to work when using direct x .x files. ( tried some of the other supported formats with no luck ).

InstanceObject , CloneObject or using ( CreateMemblockFromObjectMesh(1,objectid,1) : newobj=CreateObjectFromMeshMemblock(1) ) none of these works.

Overall everything works great in this release , thanks

best regards Preben Eriksen,
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Nov 2015 18:09
For an animated object the vertex shader needs to look something like this
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 5th Nov 2015 15:37
Animated vertex shader with fog is working perfectly now , Thanks.

FYI:
iOS and Andoid player do not reset 3d physics when it receives a new app ( broadcast ).

So if you use Delete3DPhysicsWorld() anywhere in your app then it will only work
the first time you broadcast the app , the next time it will crash because you can’t run
Create3DPhysicsWorld() , it thinks its already been called.

Gives a lot of random crashes when testing , if your not aware of the problem.
Workaround: don’t use Delete3DPhysicsWorld or Reset3DPhysicsWorld.

if you use Reset3DPhysicsWorld() it will crash every 5 times or so , so something there also need to be cleaned.

if running my demo without using Delete3DPhysicsWorld or Reset3DPhysicsWorld it works every time
best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-11-17 00:05:25
Your offset time is: 2024-11-17 00:05:25