Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - xDonny

#1
Support / Re: Culling inner-cubes
December 04, 2013, 02:42:42 PM
So I tried the first Idea and I liked the result, it had a few bugs that I need to work out so I'm back to my original, (this time I'll make a backup before I go on these excursions ;)).

So what I tried was having 16x16x16 blocks, in each block only the top-most cubes were set to "visible". If a block on top is destroyed, the corresponding block underneath is set to visible, if there is a block beside it which isn't visible, that is set to visible. However by creating objects to do this instead of a boolean array, it turned out to be just as intensive memory wise.

[EDIT]
I was unclear above, the FPS was dramatically increased from my current model which I was very pleased. I also rendered all cubes currently visible. I was unable to make a working algorithm to detet hidden-faces. Therefore I was still unable to place as many cubes as I would like.
[/EDIT]

I'll try again with the boolean idea. Perhaps I can find some documentation on an algorithm to detect hidden-faces quickly

I like this triangle reduction idea. How would you go about it?

My Theory:

Have two worlds, the main world has the singular cubes but doesn't render them (for collisions), the second world is a copy, where I merge all of the objects and then draw the singularity(will this reduce faces automatically?)

I think that sounds good

The only problem with this is the memory consumption, on previous games I've had to expand the allowed heap. This hasn't hindered anybody from playing my games (that I'm aware, only around 50 unique devices have tried them)

Perhaps implementing both methods would be beneficial?

I'm thinking of a 3 dimensional array of booleans and integers, and an enumeration for the type (for setting textures on the fly)


Let me know what you gentlemen think,
Donny
#2
Support / Re: Culling inner-cubes
December 04, 2013, 03:03:58 AM
Thanks for the reply, I'll give it a shot.

Any other theories are still welcome!
#3
Support / Culling inner-cubes
December 03, 2013, 05:38:46 PM
My game is coming along quite nicely. Right now I have a plane of cubes rendered (20x20) and performance is great. However, when I add a lot of cubes to the scene, the frame rate slows down and eventually it becomes unplayable.

I had tried to use picking to get objects from the scene that are currently "on top" but this is even slower (<1 fps).

Does anybody have any experience with culling interior objects like this?

I have generated a new test (10x10x10) and when you look at the center the framerate drops very quickly, but if you look at a glancing angle the framerate is fine.

All the objects share compiled-data with a single cube, the only thing that changes is the texture.

Thanks for your help again,

Donny
#4
Support / Re: Disable texture resize
November 27, 2013, 11:49:52 PM
Well, I'm stumped. They're all 64x64 png's. I just wrote a script and converted them all to 256x256 so and that's what i'll make them in from now on :p Thanks
#5
Support / Re: Disable texture resize
November 27, 2013, 09:20:21 PM
for (int i = 0; i < texList.length; i++)
      {
         Bitmap temp = BitmapFactory.decodeStream(c.getResources().openRawResource(texList));
         
      preview = Bitmap.createBitmap(temp, 16, 32, 16, 16);
      Texture texture = new Texture(temp,true);
      texture.defaultToMipmapping(true);
      
      if (!TextureManager.getInstance().containsTexture(c.getResources().getResourceEntryName(texList)))
      {
         TextureManager.getInstance().addTexture(c.getResources().getResourceEntryName(texList), texture);
         TextureManager.getInstance().addTexture(c.getResources().getResourceEntryName(texList) + "preview", new Texture(preview,true));
      }
      }
#6
Support / Re: Disable texture resize
November 27, 2013, 08:11:03 PM
I'm using the raw folder in resources. I believe this because I am using 50 64x64 textures and when I filter by "texture" the log tells me that it's loading a texture that is 256x256 50 times
#7
Support / Disable texture resize
November 27, 2013, 05:09:56 PM
I have 64x64 textures but it always re-sizes to 256x256 and then looks blurry when applied to my object.
#8
Support / Re: Side detection for cube
November 21, 2013, 02:17:49 PM
I do! I'll upload an .apk when I'm at home.

I'm just having issues with collisions, it works for ground and standing on cubes. But side collision with cubes is non existent (you can walk through them and be elevated up.)

Perhaps you have a solution for that as well? I'm currently using the camera as my player, So i'm using

World.checkCameraCollisionEllipsoid();

Thanks,
Donny
#9
Support / Re: Side detection for cube
November 21, 2013, 03:15:12 AM
Quote from: aZen on November 21, 2013, 12:38:30 AM
Here you go:


        SimpleVector dir = this.getDirection(point.x, point.y);
        Object[] res = world.calcMinDistanceAndObject3D(camera.getPosition(), dir, 10000);
        if (res[1] != null) { // something hit
            Object3D obj3D = ((Object3D)res[1]);
            Voxel hitVoxel = data.getVoxel(world.getVoxelId(obj3D.getID()));
            if (hitVoxel != null) {
                voxelPos = hitVoxel.getPosAsInt();
                // find collision point
                SimpleVector colPoint = camera.getPosition();
                dir.scalarMul((Float)res[0]);
                colPoint.add(dir);
                colPoint.sub(obj3D.getOrigin());
                // find side that it hits
                int lastActiveSide = 0; // assume it's zero (no need to check)
                float dist = colPoint.distance(directionVectors[0]);
                for (int i = 1; i < directionVectors.length; i++) {
                    float tempDist = colPoint.distance(directionVectors[i]);
                    if (dist > tempDist) {
                        dist = tempDist;
                        lastActiveSide = i;
                    }
                }
            }
        }


For the direction I use Interact2D.reproject2D3DWS

Please let me know if you have any questions.

Just curious, what are you up to?


Thank you - I figured this out by generating 6 cubes around it and detecting if those are collided.

I'm making a game called CubeCraft, yes, it's exactly what you think it is ;)


Thanks,
Donny
#10
Support / Side detection for cube
November 20, 2013, 06:11:56 PM
I've been working for 2 days to figure out which side of a box i'm hitting when using picking. I get a SimpleVector from the picking and I have tried numerous things to figure it out but all to no avail.

I have tried:

a) adding the SimpleVector and the center of the box together, and finding which side it's closest too, unfortunately it's always closest to the character, even if the top is clicked it will put it on the side that's facing the camera.
b) pulling out my hair
c) crying

I need a fresh mind to help me with this

Thanks


EDIT:

This is my picking code:

SimpleVector dir=Interact2D.reproject2D3DWS(g.camera, g.fb, (int) me.getX(), (int) me.getY()).normalize();
Object[] res=g.world.calcMinDistanceAndObject3D(g.camera.getPosition(), dir, 18 /*or whatever*/);

Object3D result = (Object3D) res[res.length-1];


some pseudo code of what I have tried:



dir.scalarMul(-1f);
dir.add(result.getTransformedCenter());

Object3D temp = result.cloneObject();

temp.translate(0,-2,0); // up
float dist1 = dir.distance(temp.getTransformedCenter());





I use 6 distances (one for each side) and it still doesn't work!


Again, thanks
#11
Support / Re: Texture Jitter/moving?
November 19, 2013, 06:22:55 AM
I can't believe I let myself get this frustrated over something so incredibly simple, my cube's were spaced too close together and they were fighting to show through each other
#12
Support / Re: Texture Jitter/moving?
November 14, 2013, 05:01:13 PM
Quote from: EgonOlsen on November 14, 2013, 07:51:15 AM
Because you are using the emulator...???

Actually I'm using a Samsung Galaxy SIIX Hercules (SGH-T989D) with Android 4.2.2 Running. I've tried disabling mip-maping, enabling tri-linear, anti aliasing. I've tried opengl 1 and 2 to no avail. I'm stumped. I've tried it on multiple phones so I know it's not just mine.

I wish I could describe it better, it's almost like a graphics card glitch but it's not linked to the graphics card. The texture kind of stays while the camera moves for a split second, goes pixelated and has lines through it.

#13
Support / Texture Jitter/moving?
November 14, 2013, 12:42:55 AM
I'm rendering 100 cubes with a simple texture applied to them. The way the scene works is you can only see the top and you can rotate the camera, however. Whenever I rotate there are lines and the texture seems to expand and shrink rapidly on each cube. Why does this happen? How can I stop it? I'm stumped and frustrated.
#14
Support / Re: Rendering back faces.
October 21, 2012, 06:40:15 PM
Thanks brother, I was trying to make my own software only engine, then I stumbled on this and it's excellent.
#15
Support / Rendering back faces.
October 21, 2012, 03:48:55 PM
Hello forum,

This is my first post so hello and I hope to be a contributing member.

Unfortunately my first post has to be in the Support forum because, well I need support.
I'm using the software renderer. I'm only interested in including jpct.jar. It all appears to be working fine,
however; when I load a model, you can see through some of the faces. The same behavior is apparent when
using the plane primitive.  When rotated you can only see one face.

Just wondering if this is a problem with the way I have it configured, or if it's just simply the way it is. If it does have to be
one way, what are some tips for blender to make sure everything looks solid?

Thanks,
Donny.