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 / Some questions about 3D AGK

Author
Message
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 28th Jan 2013 15:37 Edited at: 28th Jan 2013 15:38
Hi!

Some questions about 3D AGK

1. Is it possible to scroll texture of the object, or you receive this functionality in the near future?
2. Shader normally work on iOS? I have an error loading.
3. SetObjectLightMode 1 does not work. Build 88 Beta
4. If I do SetObjectVisible 0, then do InstanceObject and in the new object SetObjectVisible 1 - it looks bad. If using CloneObject - all good.
5. How to get the actual number of triangles in the frame? GetPolygonsDrawn returns all triangles. Even those that are not visible. They are all drawn?

thanks
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 28th Jan 2013 17:29 Edited at: 28th Jan 2013 17:31
Quote: "1. Is it possible to scroll texture of the object, or you receive this functionality in the near future?"


Yes, with shaders. All you have to do is add some values to UV coordinates.

Quote: "2. Shader normally work on iOS? I have an error loading."


Not sure here, but it would be wise to provide that error here.

Quote: "3. SetObjectLightMode 1 does not work. Build 88 Beta"


See if there wasn't such bug reported here:
http://code.google.com/p/agk/issues/list
If there wasn't, submit it as a bug there.

Quote: "4. If I do SetObjectVisible 0, then do InstanceObject and in the new object SetObjectVisible 1 - it looks bad. If using CloneObject - all good."


What do you mean by "looks bad"?

Quote: "5. How to get the actual number of triangles in the frame? GetPolygonsDrawn returns all triangles. Even those that are not visible. They are all drawn?"


I don't think it's currently possible (nor will ever be).

Follow me on twitter! @MotionStruct
Motion Struct blog
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 28th Jan 2013 19:11 Edited at: 28th Jan 2013 19:12
Quote: "Yes, with shaders. All you have to do is add some values to UV coordinates."

Good idea

Quote: "Not sure here, but it would be wise to provide that error here."

Maybe it's my fault. I found a problem in the code.

Quote: "What do you mean by "looks bad"?"

see attached file (iOS)

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 28th Jan 2013 19:33 Edited at: 28th Jan 2013 19:34
Quote: "see attached file (iOS)"


That would be because instanced objects are like one object, drawn many times, and clone object actually clones one object's data and draws it separately.

It won't get better. You either have to keep main object (the one that instances are coming from) visible, or use clone object. There are no workarounds for it for AppGameKit user. (Developers may add functionality to hide instanced objects separately later. Through, I wouldn't count on that)

Follow me on twitter! @MotionStruct
Motion Struct blog
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 30th Jan 2013 13:24 Edited at: 30th Jan 2013 13:26
OK, I'll use CloneObject
---
I thought about all the difficulties. Light works. Can I set the ambient light? When there is a light source, if it does not shine directly on the face, it goes dark.
agk :: CreateLightDirectional (1, -0.9, -1, 0.8, 255, 255, 255);
I need to upper faces were bright.

When the scene have a light, the log displays error:
Shader "" requires vertex attributes that object 0 does not provide, this shader may fail to display the object
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Jan 2013 16:21
Quote: "Shader "" requires vertex attributes that object 0 does not provide, this shader may fail to display the object"


Means the shader requires, say, position, normals, and UV, and the object only has position and UV. It might work, but it might not look right.
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 31st Jan 2013 19:27
Quote: "Means the shader requires, say, position, normals, and UV, and the object only has position and UV. It might work, but it might not look right."


my shader:
vertex


pixel


in console:
Quote: "Shader "data/sdr_diff.vs" requires vertex attributes that object 10004 does not provide, this shader may fail to display the object"


What is wrong?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st Jan 2013 21:27
Depends on the .obj file you used to load the object. It might be missing normals or UV data.
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 3rd Feb 2013 12:37
Quote: "Depends on the .obj file you used to load the object. It might be missing normals or UV data."

Yes, there was the problem of the 3D model. Only 3DsMax 2010+ correctly exports obj.

InstanceObject works correctly with my shader. If you do not assign a shader, then we get that in the screenshot.

Now there's a new question. Can I turn off vertical sync?
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 3rd Feb 2013 15:39 Edited at: 3rd Feb 2013 15:41
sync(0,0) ?

But depending on devices the framerate is limited by hardware and energy mode.
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 3rd Feb 2013 21:11
MikeMax
anyway maximum 60 fps. It may be the case in iOS.
But I solved the problem with the performance.

Else noticed the error. If I copy or make an instance of the object - it is not drawn transparency top objects.
I'm make endless runner, so I have to use an instance for more speed. I have to make the shadow of skateboarding, but I do not know how. Can advise something, please.

Login to post a reply

Server time is: 2024-05-06 15:33:59
Your offset time is: 2024-05-06 15:33:59