Game Development Community

Some Sprites don't Render

by Abimael Avila · in Torque X 2D · 12/19/2008 (1:16 pm) · 4 replies

Hello there:

I have a problem when render a level on the game, only a few sprites renders.

On the Editor I have this:

http://www.losmangaus.com/images/Img-Editor.jpg

but on the game its draw like this

http://www.losmangaus.com/images/Img-Game.jpg

The level has Y Axis Sort on all his layers. The wall images are on layer 10. The floor images are on layer 15. The Floor with little holes are on layer 14. The box images are on layer 10. There are some empty SceneObject on layer 30, for collision pourpose.

Can you help me solve this problem??. I'm using TorqueX Pro 2.0 with XNA 3.0 and Visual C# Express 2008.

Thanks a lot for your help.

#1
12/20/2008 (9:37 pm)
I don't think torque x official supports XNA 3.0 yet. (correct me if I'm wrong) That could be causing issues.

I'm assuming all the floor objects are the same Object type and are all set to render in the Cameras Render masks?
#2
12/21/2008 (10:11 am)
I tested it with XNA 2.0 too and Visual C# Express 2005.

All the floor types are the same objet type and the object type are added on the scene file too.

I noticed that when and object that is actualy rendered moves outside the camera bounds one floor object starts to render. It seems like its only rendering a constant number of objects inside the camera bounds and objects that are not ocluded by other objects, because I change the layer of the floors to 1 and all floor objects starts to render.

I havnt tested the Camera Render masks, where can I set it??

Thanks
#3
12/24/2008 (1:02 am)
You might be having this problem. A lot of people bump into it:

http://www.garagegames.com/mg/forums/result.thread.php?qt=71127

?
#4
12/26/2008 (8:01 am)
I finally solved the problem.

With the examples form the threads that you point me to, I change this line

sceneObject.LayerDepth = _useLayerSorting ? i - count : -(float)sceneObject.Layer;

to this one:

sceneObject.LayerDepth = _useLayerSorting ? -(float)sceneObject.Layer : i - count;

on the T2DSceneGraph.cs file, and then I have all my objects rendered, and it is working on XNA 3.0.

Thanks a lot for your help, and Happy Holidays to all.