erratic problem exporting and rendering

View previous topic View next topic Go down

erratic problem exporting and rendering

Post  jj on Thu Sep 25, 2008 6:28 am

I seem to have some erratic behavior when exporting meshes from Blender 2.47 to .sio2.

I have a duplicate copies (shift+d) of "Cylinder" and it (rightly?) becomes "Cylinder.001, .002, .003". When I try to render the scene, I only get the instance of Cylinder rendered??? If I try to change the name of the second Cylinder copy, I DO sometimes get a render of each object... Something seems wrong...

I also was having problems assigning a .jpg file as a texture. I checked the output folders and found the .jpg in the compressed .sio2. Could it be an incompatible .jpg file? I want to take one thing at a time, so first - 1. what's going on with the Cylinder erratic behavior? and 2. I also have a feeling the same thing could be happening with the 'naming conventions' of my Material (Material.001, .002, etc) and Texture...

Is naming convention something to pay close attention to? Could that be causing errant rendering?

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

got the mesh by changing all to .001,.002,.003,etc but...

Post  jj on Thu Sep 25, 2008 6:53 am

Yep, can't get that jpg, or tga (32bit) to render...? I'm using tutorial08 template...

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

The first issue

Post  sio2interactive on Thu Sep 25, 2008 7:26 am

For instancing you should pay close attention to tutorial06:

/*
The following functions binds all the child(s) to its parent, if you
watch closely the video this time I didn't rename any object when
I was duplicating them in blender (CTRL+D). The mechanism behind
this "pseudo" instancing system is quite simple it's working
by the name. eg:

Object Name: Cube.001

If the exporter find an object with a "." in the name it will try
to find the object Cube in the scene. If it founds it automatically
Cube.001 will share the same vertex, normals, vertex color, UV0, UV1
and Materials. Since basically the .sio2 is a ZIP archive constructed
from the command line every objects are in alphabetical order. So when
drawing it will first draw Cube and bind all the necessary resources
to draw it, when the next object comes in (our Cube.001) no need to
change any drawing state and we can just draw Cube again. However,
Cube.001 will still have its own position, scale, rotation and physic
data, only the "drawing" part is shared with Cube. Since on iPhone
there's no way to really instance in hardware that's basically the
most simple mechanism that can be implemented in order to gain speed.

Please take note that in the case of the ground or the collision map
in the demo I reset the tranformation in blender ( CTRL + A ). This
can also be applied on objects in order to gain a bit of speed during
the physic object creation. Use CTRL+A in blender wisely to make sure
that the vertices sent to create the physic object is the same as the
one used for rendering.
*/
sio2ResourceBindAllInstances( sio2->_SIO2resource );


Last edited by sio2interactive on Thu Sep 25, 2008 7:48 am; edited 1 time in total
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Your second issue

Post  sio2interactive on Thu Sep 25, 2008 7:40 am

SIO2 support regular JPEG, JPEG 2000 is not supported. Make sure that you assign the texture in the first channel of blender (since I presume that you try to get the diffuse channel for rendering), and that you respect the binding sequence:

// Bind all the images to the materials
sio2ResourceBindAllImages( sio2->_SIO2resource );

// Bind all the materials to the object
sio2ResourceBindAllMaterials( sio2->_SIO2resource );

// Generate texture & geometry ID
sio2ResourceGenId( sio2->_SIO2resource );

This is taken from tutorial03:

/*
SIO2 support natively the following image format:

JPEG 24bits (RGB) = Need decompression but no byte swap
JPEG 8bits (GRAYSCALE) = Need decompression but no byte swap

RAW TGA 24bits (RGB) = Need to swap BGR to RGB
RAW TGA 32bits (RGBA) = Fast, no decompression or byte swap
RAW TGA 8bits (GRAYSCALE) = Fast, no decompression or byte swap

RLE TGA 24bits(RGB) = Need decompression + byte swap ( BGR -> RGB )
RLE TGA 32bits(RGBA) = Need decompression but no byte swap
RLE TGA 8bits(GRAYSCALE) = Need decompression but no byte swap

Please take note that also due to the TGA file format some image
have to be flipped on the Y axis, to avoid flipping save your TGA
with the origin as the top left corner instead of bottom left,
they would load faster cuz no flipping is required.

ps: If flipping is required, it is done internally so no need to worry about it.
*/


Maybe you can send me your .blend and the JPG that cause problem by email or MSN so I can see what's wrong?

I also suggest you to review the video tutorial03.

Lemme know if you still have problem...
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Resolved

Post  jj on Thu Sep 25, 2008 5:15 pm

aha,

I finally got it to work. I went back through the docs and had missed the info on the width and height of the texture .jpg files needing to be a power of 2.

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: erratic problem exporting and rendering

Post  sio2interactive on Fri Sep 26, 2008 5:07 pm

Yeah that's important, unfortunately only GL_TEXTURE_2D is available in the iPhone / iPod Touch GL implementation.
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: erratic problem exporting and rendering

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