SIO2 1.4 is around the corner...

View previous topic View next topic Go down

SIO2 1.4 is around the corner...

Post  sio2interactive on Fri Jul 17, 2009 2:35 am

Here's the final layout of functions, fix, addition and new functionalities that pass the stable phase, and will be out in about a week or so...

- Exporter now export emptymesh
- Emitter culling bug fix
- SIO2frame support normals
- Add sio2ResetListener function
- Sound stream improvements & bug fix
- sio2ObjectRenderFrame optimization
- File format optimization (shorter tag faster parsing almost 50% faster but less user friendly) -> Please re-export your scenes...
- Lamp flag export bug fix
- sio2ImageBlur
- Added safety net for SIO2thread
- Video stop thread bug fix
- Video mem leak fix
- Video optimization (almost 2x)
- New action system based on Blender action strips.
- SIO2widget & SIO2object SIO2_TRANSFORM_MATRIX_NONE bug fix.
- Bullet 2.75 rc3 (need -fno-regmove compiler flag)
- sio2TransformRotateX & sio2TransformRotateZ takes now degree
- Adjustable clipping planes, default 5 ~ 16% faster
- Integration of nvtristrip (optimize up to 40% faster)
- GL_EXT_texture_lod_bias integration optimization
- Dot3 Lighting & Normalmap Tutorial (basic)
- SIO2image bind check (avoid binding image over and over)
- SIO2image bind & unbind function callbacks (ideal for combiners & texture matrices)
- Add SIO2_OBJECT_INVISIBLE that can be toggled by the face property "invisible"
- SIO2_OBJECT_GHOST act now like the one in blender.
- Exporter now use pure Python to compress zipfile (ideal for cross platform assets creation)
- Machine state software support
- Now export static mesh of any kinds.
- Frustum clipping for small or long objects bug fixed. (http://robertmarkmorley.com/2008/11/16/frustum-culling-in-opengl/)
- sio2CameraPerspective bug fix.
- Port for iPhone OS 3.0 ( -Wno-write-strings )
- Exporter: automatic quads to triangles conversion + remove double at 0.001f of threshold
- OpenGL ES trace
- SIO2video optimization and flexibility improvement
- LUA VM Reset Function
- Material SIO2vertexshader calback (in object space)
- sio2ObjectSoftCopy create an instance at 0,0,0
- sio2ObjectHardCopy create a full copy at 0,0,0
- sio2Frame callback, give the opportunity to callback a function when rendering a frame on an animation.
- Lower SIO2object memory footprint. Now init. struct for physic and animation.
- SIO2frame callback, provide callback functionalities for animation sequence
- SIO2ipo callback, provide callback functionalities for curve sequence
- General optimization, leaks & bug fix (no known bugs)

I will release a "pre" SDK, what that means is basically the current SDK ported to 1.4 and will prepare a brand new SDK with all new tutorials and videos (since the current one start to be pretty much outdated and use blender 2.47)...

I would like to have your suggestions of the material that you would like to see covered in the new official 1.4 SDK.

Please provide me a list of the tutorials or functionalities that you would like to see in the new SDK as well as suggestions of comments about the things you like / didn't like about the current one.

Tks in advance,

You guys are the boss this time hehehe Wink

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  goldfrapp0x0309 on Fri Jul 17, 2009 2:44 am

Someone has been working :^). Nice !
avatar
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

View user profile

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  ColorDelta on Fri Jul 17, 2009 6:56 am

Wow, that change log has just grown and grown over the past few weeks, Rom. Looks like 1.4 will be a real milestone for SIO2 and the whole community! You're not only giving us loads of bugfixes but you've also put in a huge effort to optimise the entire rendering pipeline. We've got a lot to be grateful for - thanks for all your hard work! cheers

As for a list of "Most wanted" tutorials, it's tricky because you've already covered so many features in the existing tutorials/examples.

But if you want to make it easier for complete newbies to get started I guess you could consider creating an example that shows a small generic game/application structure with a splash screen, a start menu (Play, Settings, Exit) and say, 3 very simple levels (Move camera from A to B in each level to trigger the loading of the next level).

Something I'd personally like to see is an example that demonstrates dynamic object instancing and removal (including Bullet), e.g. using the new sio2ObjectSoftCopy/HardCopy functions. A really simple example application would be fine, e.g. a mini-game where balloons spawn at random positions just below the viewport. Bullet physics would then cause them to rise slowly, and whenever you tap them they disappear from the screen (and from memory).

An example demonstrating how to use multitouch would also be greatly appreciated.

That's all I can think of at the moment...

Note to self: Upgrade brain Wink

ColorDelta

Posts : 16
Join date : 2009-03-25
Location : London, UK

View user profile

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  zzajin on Fri Jul 17, 2009 12:13 pm

- Material SIO2vertexshader calback (in object space)


Will this allow for software based shading like linear and spherical mapping? Or projecting textures onto objects?

If so a tutorial on this would be cool.


Bah ... I think I just found an example of spherical mapping. I might be a ble to figure this out myself - dowsn't look hard.


http://www.mvps.org/directx/articles/spheremap.htm

zzajin

Posts : 81
Join date : 2008-10-14

View user profile

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  sio2interactive on Fri Jul 17, 2009 4:11 pm

No this is not going to give the effect that you want... this spherical mapping is static... what you want is to have it in screen space. So when you move the camera you see the reflection moving...

Me Im using this:

sio2Vec3Diff( _v, sio2->_SIO2object->_SIO2transform->loc, &d );
sio2Normalize( &d, &d );

sio2Vec3Diff( _v, jggame->_JGgarden->_SIO2camera->_SIO2transform->loc, &p );
sio2Normalize( &p, &p );

_u1->x = asinf( d.x ) / SIO2_PI + 0.5f * p.x;
_u1->y = asinf( d.y ) / SIO2_PI + 0.5f * p.y;


Its not accurate but its fast enough and give "sort of" the desired effect...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  Francescu on Sun Jul 19, 2009 3:47 pm

Great stuffs ROm, as usual - looking forward to it...

Impressive list for sure - still digesting it Wink

Francescu

Posts : 136
Join date : 2009-03-18

View user profile

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  Don Jaffa on Sun Jul 19, 2009 8:55 pm

Change log looks great Very Happy

Just curious.. a few days ago I downloaded v1.5... So now I'm confused. Do I have v1.5? Razz

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  sio2interactive on Sun Jul 19, 2009 9:40 pm

heuuuuuu you don't... you have 1.3.5... this is 1.4 Wink

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

conversion to 1.4

Post  waterbuffalo99 on Sat Aug 15, 2009 6:02 pm

OK 1.4 is out and it has some great features. I'm converting and have made a lot of progress. Most things are working as far as I can tell. For one thing it loads quite a bit faster which is great!

So, as I work my way through it, I'll report my issues. Any of these could just be me overlooking something obvious... if so please help, because I'm not gonna put it here until I've at least tried to figure it out.

Here goes:

Converting to 1.4 Issue #1
There is no sio2ObjectDuplicate in the API, and neither sio2ObjectSoftCopy or sio2ObjectHardCopy do what -Duplicate used to do.

I would think -HardCopy would work, but after calling it the resulting object has no _btRigidBody in the _SIO2objectphysic

I tried to port back sio2ObjectDuplicate but a lot of things have changed and I'm thinking this is probably not the best approach to solving this problem.

-George

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

converting to 1.4 duplicating objects, issue #1 solution

Post  waterbuffalo99 on Sat Aug 15, 2009 10:19 pm

This solved issue #1:

Based on Rom's suggestion, this is straight from the source for tutorial 061 with slight changes. I turned the example code into a function and added some parameters to generalize it a bit. The name needs to be unique (maybe "oldname_12" for the 12th copy). The loc and rot params are optional (NULL if you don't want to supply them, but you might not like the results -- especially if loc is NULL -- since the new object will coincide with the original object).

This compiles and works:

Code:

SIO2object *duplicateObject(SIO2object* obj, const char* name, const vec3* loc, const vec3* rot)
{
   SIO2object *parent = NULL;
   
   SIO2object *dup = NULL;      
   
   // If the object is an instance find its parent,
   // SoftCopy & HardCopy can only work on parent.
   parent = obj->_SIO2instance ? ( SIO2object * )obj->_SIO2instance : obj;
   
   // Convex hull requires access to the vertices of the object
   // in this case we are going to create a hard copy for it.
   //
   // If not simply create an instance of the current selection
   // parent.
   //
   if( obj->_SIO2objectphysic->bounds == SIO2_PHYSIC_CONVEXHULL )
   { dup = sio2ObjectHardCopy( parent, _CONSTCHAR name ); }
   else
   { dup = sio2ObjectSoftCopy( parent, _CONSTCHAR name ); }
   
   // Set the loc and rot if supplied. We do not
   // have to be worried about affecting the current object
   // matrix cuz Bullet Physic is ON, and take over all the
   // matrix calculation.
   if (loc)
      *dup->_SIO2transform->loc = *loc;

   if (rot)
      *dup->_SIO2transform->rot = *rot;
   
   sio2TransformCopy( dup->_SIO2transform,
                 obj->_SIO2transform );
   
   sio2TransformBindMatrix( dup->_SIO2transform );
   
   sio2PhysicAddObject( sio2->_SIO2physic,
                  dup );
   
   // We need to have a VBO id generated...
   if( obj->_SIO2objectphysic->bounds == SIO2_PHYSIC_CONVEXHULL )
   { sio2ObjectGenId( dup ); }

   return dup;
}


Last edited by waterbuffalo99 on Mon Aug 17, 2009 10:21 am; edited 1 time in total

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

converting to 1.4 issue #2

Post  waterbuffalo99 on Sat Aug 15, 2009 10:34 pm

Debug printing changed a bit. Nothing wrong, just different. To handle my on screen debug printing I added these two convenience functions to encapsulate this a bit. I had to modify them slightly for 1.4.

Code:


SIO2font *_SIO2font = NULL;

void printAt(float x, float y)
{
   _SIO2font->_SIO2material->diffuse->x = 1.0f;
   _SIO2font->_SIO2material->diffuse->y = 1.0f;
   _SIO2font->_SIO2material->diffuse->z = 1.0f;
   _SIO2font->_SIO2transform->loc->x = x + 8.0f; // add 8.0 for a margin
   _SIO2font->_SIO2transform->loc->y = sio2->_SIO2window->scl->y - y + 8.0f;
}


void initFontPrint()
{
   if (_SIO2font)
      return;
   
   SIO2image    *_SIO2image    = NULL;
   SIO2material *_SIO2material = NULL;
   SIO2stream    *_SIO2stream   = NULL;
   
   _SIO2stream = sio2StreamOpen( "default16x16.tga", 1 );
   
   if( _SIO2stream )
   {
      _SIO2image = sio2ImageInit( "default16x16.tga" );
      {
         sio2ImageLoad( _SIO2image, _SIO2stream );
         
         sio2ImageGenId( _SIO2image, NULL, 0.0f );
      }
      _SIO2stream = sio2StreamClose( _SIO2stream );
      
      _SIO2material = sio2MaterialInit( "default16x16" );
      {
         _SIO2material->blend = SIO2_MATERIAL_COLOR;
         _SIO2material->_SIO2image[ SIO2_MATERIAL_CHANNEL0 ] = _SIO2image;
      }
      
      _SIO2font = sio2FontInit( "default16x16" );
      
      _SIO2font->_SIO2material = _SIO2material;
      
      _SIO2font->n_char = 16;
      _SIO2font->size  = 16.0f;
      _SIO2font->space  = 8.0f;
      
      sio2FontBuild( _SIO2font );
   }   
}   

and here's an example of printing:

Code:


    printAt(8.0f, 176.0f);
    sio2FontPrint(_SIO2font, SIO2_TRANSFORM_MATRIX_APPLY, "Joy: %.4f, %.4f ROT_Z: %.4f, Turbo: %s", joyPos.x, joyPos.y, ROT_Z, doTurbo ? "On" : "Off");

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

converting to 1.4 issue #3

Post  waterbuffalo99 on Sat Aug 15, 2009 10:40 pm

Converting to 1.4 issue #3:

My 3rd person player controller code and display of the character object and corresponding camera control works exactly as before. However, there is some weird coordinate translation problem between the physics and GL worlds. My plane and other static objects are there, but they are in the wrong place. My ball character for example, rolls around as though on the surface where I know it should be when it drops into my sandbox world (it's not really a game yet), but the display is in another place altogether translated in X, Y, and Z. Again, ball displays correctly in the view, camera follows it around just fine as before, but the rest of the world is shifted a distance of over 1000 from where it should be.

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

anybody out there?

Post  waterbuffalo99 on Mon Aug 17, 2009 10:16 am

Issue #3 solved:

This was caused by my sky dome not having the bounds button set. Maybe in 1.3.5 if this was the case SIO2 would default to "triangle mesh". In 1.4 in this case it had this strange effect. On closer observation I think what was happening was not a coordinate translation problem, but rather the skydome seemed to be rendering in the right place, but physics wise it was in the wrong place. The result was as though my player was riding on top of the dome (btw - it was also set to 2-sided). This is just a guess, I can't really explain it, except that it was bizarre, and that it went away when I set it to Bounds - Triangle Mesh.

-George

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

converting to 1.4 issue #4

Post  waterbuffalo99 on Mon Aug 17, 2009 10:20 am

My player animation doesn't work. It still works in blender (of course). I converted it to NLA actions, actually only 1, and the model looks exactly like the new tutorial 15 zombie model. After exporting there is an action in the .sio2 file. All the code is converted to look like tut 15 and it works (i.e. it doesn't blow up), but no animation is happening.

Any ideas? Thanks in advance,

George

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

issue #4 solution

Post  waterbuffalo99 on Mon Aug 17, 2009 12:20 pm

This was due to the conversion to NLA in blender. The action frames and the keyframes were out of sync which resulted in the vertex data output by the export script having all the same data for all frames. How can this happen, beats me! The frames were originally frame 1 - 48, and they became frame 48 - 95, and the keyframes were still 1 - 48 (there were just 6 keyframes). I moved the data back, and the keys moved to -46 to 0. This didn't help.

Then it undid that, and then in the timeline view I changed the range to not include 1 - 48, and was able to move the data back without the keyframes moving backwards simultaneously (blender is a real POS sometimes!). Discovering this was about 4 hours of head-banging-against-the-wall! I have a small and light head apparently so it doesnt hurt as much.

-George

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

Almost done... Issue #5

Post  waterbuffalo99 on Mon Aug 17, 2009 1:24 pm

At this point, almost everything is converted to 1.4 and works at least as well as before.

Here's a list in no particular order to give you an idea of the coverage of this as an informal test:

Sound (ambient and fx), shooting objects (hit test on the object, applies a linear and angular force, and play a sound), walking, running, and jet-pack style flying character control with animation, changing the rotation (so character is facing the way he's walking/flying), character wrapped with an invisible rigid-body sphere, changing the animation fps (function of character velocity), emitters (pending testing), changing the animation strip (pending testing), 3rd person camera control including changing the fov, shadows, mist, multiple lamps, duplicating objects ("enemy" objects appear out of nowhere to attack the player), semi-transparent objects, collision events, hide/show objects, doing physics and rendering on separate threads, some physics constraints (only a hinge constraint or two), applying changing force and velocity, changing texture of individual vertex groups, player entering and moving around inside enclosed spaces (and soon animated door opening/closing), a pretty large complicated model with many static and rigid body objects (I'll get a total poly count).

In other words, with a few exceptions, its features from most of the tutorials (no soft bodies, no MD2 animation, no attempt to be pretty just experiment and test a lot of things).

I have not tried my emitter tests yet or multiple/changing animations (I have tested changing fps of the animation). I'll report on performance changes for better or worse (I also haven't tried it on the device yet), and other pros and cons as I encounter them. I think it will be worth it for action strips alone, if not other things.

Now here's issue #5

Sometimes my rigid body objects don't render (I don't know if its all of them, but the ones close to the starting point of my sandbox game). The solution seems to be restarting the emulator, so I suspect a memory leak (maybe its only a leak if it is killed in debug mode), or maybe some initialization that is sensitive to the order of things (but usually works, in which case my perception that restarting the emulator fixes it is wrong). I'll profile it and try to characterize this better. This never happened before and it only takes a few tries before it fails.

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

Converting to 1.4 Issue #6

Post  waterbuffalo99 on Mon Aug 17, 2009 7:41 pm

Issue #6:

The emitter causes a rendering bug / side effect. Once it has been enabled then any objects with alpha transparency render incorrectly. They look like they've got twice the alpha (more transparent) and they also seem washed out (higher saturation). In attempting to debug it, I made sure the emitter is rendered last -- this doesn't help.

I found a bug in sio2EmitterRenderer: there is a glPushMatrix that is balanced with a glPopMatrix but the pop is inside a while loop (so it would be executed multiple times against the one push).

This did not affect the alpha bug.

waterbuffalo99

Posts : 36
Join date : 2009-06-03

View user profile

Back to top Go down

Re: SIO2 1.4 is around the corner...

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum