Rendering Meshes, how many triangles are too many? - Java for Android App Development

Hi,
I am experimenting with Mesh that I am filling in with colors.
I end up with 900 triangles that are have positions updated about 20 times per second.
On PC it works flawlessly, on my Nexus 4 its rather slow.
Is my code crap, or its too much to render real time?
Thanks!

Are your calculate the new position with the delta time (time between this and the last frame)?

EmptinessFiller said:
Are your calculate the new position with the delta time (time between this and the last frame)?
Click to expand...
Click to collapse
Hi ,yes I use delta time, and the actual new positions are calculated fine for my triangles.
e.g if I put it as wire frames (outlines only) it renders quick enough.
But if I make them filled with color, all halts to grid
I thought 1st person shooter games do way heavier calcs, and seem to survive fine...
Mine item is more like a water simulation, and to look decent it needs about 800 triangles filled at least with solid
color no transparency... any hints please?

Related

Outer Empires for the Shift

Hello,
Over the past few months I've been running a development team building a new game (Outer Empires - the link is below) - it's a space MMO in a browser, but a little different to other browser based games in that you actually fly around.. it requires no plugins (just a javascript enabled browser).
Last night I got a chance to get my hands on a Shift and decided to point the game at our test site to see how it fared. To cut a long story short, it worked and worked well.. you could fly around in game visit space stations, do jobs, etc.
The only down side was that the game is current formatted for 800x600 screens... so, this post is really to guage what the interest would be in a version of the game for the Shift (or other 800x480 res devices).
So - would anyone here be a) interested in playing and, if so, b) interested in testing a version?
For reference the address for the game is : http://outer-empires.com
Regards,
Paul Hutson
but the shift can easily change res to 1024x600 with a click of a button then we can easily run the game.
N_M_S said:
but the shift can easily change res to 1024x600 with a click of a button then we can easily run the game.
Click to expand...
Click to collapse
Ah - yes, true (having looked again that is indeed the case) - it's ever so slightly blurry though.
On another note, there is a short video of some of the browser bits working, here which you may be interested in :
http://www.youtube.com/watch?v=lAj2KYuFV2g

[Q] Archery Score App

Hello all.
Since I have my TP2 I thought by myself what kind of app could I really use.
I have been searching on the net for quite a while but couldn't find it.
My main sports and hobby is archery and basicly I am looking for an App where I can keep my scores, personal records etc.
Does an app like this exist already?
Normally one would say this is quite simple but in archery you have to consider the different distances and also the amount of arrows used per distance.
For example for a FITA round one shoots 90 meters, 70 meters, 50 meters and 30 meters.
Each distance has 36 arrows where on the first 2 distances one shoots 6 arrows in 1 end and on the last 2 distances one shoots 3 arrows in 1 end.
Then there are the indoor distances like 18 meters and 25 meters those distances are shot with 30 arrows with 3 arrows in 1 end.
Anyways my question is, is there already an app for this?
Freeware prefered ofcourse
Arkasius said:
Hello all.
Since I have my TP2 I thought by myself what kind of app could I really use.
I have been searching on the net for quite a while but couldn't find it.
My main sports and hobby is archery and basicly I am looking for an App where I can keep my scores, personal records etc.
Does an app like this exist already?
Normally one would say this is quite simple but in archery you have to consider the different distances and also the amount of arrows used per distance.
For example for a FITA round one shoots 90 meters, 70 meters, 50 meters and 30 meters.
Each distance has 36 arrows where on the first 2 distances one shoots 6 arrows in 1 end and on the last 2 distances one shoots 3 arrows in 1 end.
Then there are the indoor distances like 18 meters and 25 meters those distances are shot with 30 arrows with 3 arrows in 1 end.
Anyways my question is, is there already an app for this?
Freeware prefered ofcourse
Click to expand...
Click to collapse
I would suggest setting up an Excel Mobile spreadsheet.
Yes there are free ones cant remember names of the ones i tried.. One that is a pay app is bowbuddy. http://www.bowbuddy.com/ and there is another i cant remember the name i used in a tourny but that worked only on my fuze sure it may have been updated by now.
There is also another one that has it all , but also one i wanted to buy helps calc ur arrows and fps etc and has software to print out a tape for your sight ready to go.. thats if you dont use pins, something like atoxonics or pivot sight.
Ill try to find it.
Edit.
Google searched:
PPC Target Results
http://www.freewarepocketpc.net/ppc-download-ppc-target-shooting-results-calculator-v1-0.html I used this one but didnt like it.
Target:
http://www.freewarepocketpc.net/ppc-download-target-v1-2-66.html
*ASM*
http://www.archerysoftware.it/?q=en/node/35 This one is worth paying for.
http://www.youtube.com/watch?v=pTG5W1o1kQE
Trajectory calc
http://www.freewarepocketpc.net/ppc-download-trajectory-calc-v1-0.html
BTW you don't necessarily have to look for an archery app. Same concept as target shooting etc.

[Q] Default Xoom / Honeycomb Background Resolution

Does anybody know what the default background image resolution will be for the Xoom?
I had gotten the impression from the demo videos that Honeycomb didnt do the whole "pan slightly left and right when moving through the homescreens" thing, but AndroidPolice just posted a few backgrounds that were ripped out of the SDK and their resolution is 1920x1280... which Im having a hard time making sense of. Most notably, the fact that the height is off so much.
I think it's going to be 1280x800, same as the screen resolution.
Maybe the wallpapers in the SDK are covering the xtra large resolution.
And maybe the wallpapers in the final Xoom will be at 1280x800.
let me try...
when you turn the xoom into portrait mode, the height effectively becomes 1280px. So any wallpaper would have to have a height of 1280px to fit the screen.
I read that tegra 2 devices support full hdmi out...meaning if you have an hd tv hooked up to your device running at 1920x1080, the wallpaper would need a width of 1920px to fit the tv....
creating wallpapers at 1920x1280 covers all situations...
sounds good in theory...anyone have a different perspective?
Ahhh, someone else asking a similar question. Although I've posted this elsewhere, and since I'm not the thread starter, I'll post this here...
I’m about to purchase a Xoom, and simply stated, the Xoom has 5 ‘desktops’ that you can ‘pan across.’
I’ve seen a few videos of the Xoom on YouTube, where the ‘wallpaper’ shifts slightly when you pan right or left to another ‘desktop.’
I plan on using this device for a unique purpose, and when I pan right or left, I want the entire background to change.
For the sake of this post, let’s assume I want each desktop wallpaper to be a different color…red, blue, green, yellow, and orange. Further, when I pan, I don’t want to see anything but THAT one color.
So again, the distinction here is…
1) A slight shift in the ‘wallpaper’
Versus
2) a whole new image (color or otherwise) on each of the 5 ‘desktops.’
I'm looking for number 2. Is this possible?
I think the second comment was the good one, it's when the Xoom is put into portrait mode, I should have thought about that.
About the "a whole new image on each of the 5 desktops", I think we'll have to wait for a developer to make a tablet Home replacement with this option.
513 said:
I think the second comment was the good one, it's when the Xoom is put into portrait mode, I should have thought about that.
About the "a whole new image on each of the 5 desktops", I think we'll have to wait for a developer to make a tablet Home replacement with this option.
Click to expand...
Click to collapse
Bummer, that seemed like a simple enough request. lol.
sadiqa122 said:
let me try...
when you turn the xoom into portrait mode, the height effectively becomes 1280px. So any wallpaper would have to have a height of 1280px to fit the screen.
I read that tegra 2 devices support full hdmi out...meaning if you have an hd tv hooked up to your device running at 1920x1080, the wallpaper would need a width of 1920px to fit the tv....
creating wallpapers at 1920x1280 covers all situations...
sounds good in theory...anyone have a different perspective?
Click to expand...
Click to collapse
That makes a lot of sense. The idea of handling portrait also completely escaped me. Thanks
The only thing that still sounds fishy would be the re-scaling the UI resolution to fit the TV, rather than simply scaling to fit. I would think that would (seemingly) open the door to all sorts of shifting and alignment issues that they would have had to handle.
Hmm... well, so much for the idea of using the posted default backgrounds to identify "the" size. Downloaded a few and I'm seeing 2 at 1920x1408 and at least one at 1920x1280
Hmmm...Well if 1920 is the default height for portrait mode, and 1280 (or greater) is the width. Maybe the variation in width causes a "broader" slide when swiping left to right (so more of the image is exposed)?? So you could concievably create a wallpaper that's 1920 x 4000?

[DEV(ish)]Minecraft!

Okay, so I got minecraft to work using Backtrack (HERE) in one of the other threads, but it runs poor(<1 FPS).
Basically, what I did was install the dummy video driver for xorg(xserver-xorg-video-dummy, iirc), and use THIS script to launch it. I then attached x11vnc to it.
The default TinyVNC server doesn't support OpenGL, you'll need to use xorg + x11vnc + the dummy
As far as getting minecraft to run, I got the appropriate liblwjgl build from HERE.
I got the appropriate jinput build from HERE
After you run MC for the first time, it'll download everything and crash. Replace the ~/.minecraft/bin/native/ files with the ones in these packages. The packages don't need to be installed, just extracted to get at those files.
You'll also need libmawt, provided by THIS package. That does need to be installed. Mine was broken on install, I didn't care to fix it, but it still worked. It just needs at that one file.
I got the best luck connecting to a network server with the MC process renice'd to -15 or so.
This is what should launch it:
Code:
./Xdummy :2 &
x11vnc -display :2 -noshm &
nice -n -15 java -jar minecraft.jar
Then connect to localhost:5900 for VNC.
As I said, it's unplayable right now. I was hoping someone could help come up with some ideas on getting it to play decently, as it's good for little more than getting on and chatting to people right now.
The only idea I had for boosting it was to find a tegra driver and try to get X to start with that without trying to attach to a VT(Will that dummy file do it?).
Also, the controls for VNC aren't suited for MC, obviously. I was using an external keyboard when I was playing with it.
I'll post a video of it running as soon as I can get a camera. My Iconia is my camera, heh.
Yeah, it runs poor on my HP Touchsmart tm2 with i3, so I doubt this would be any close. It's surprising though, considering the 8-bit graphics in the game itself.
Sent from my A500 using XDA Premium App
well thats 8 bit graphics on top of rendering millions and millions of cubes. from a game design stand point. its really impressive.
gh123man said:
well thats 8 bit graphics on top of rendering millions and millions of cubes. from a game design stand point. its really impressive.
Click to expand...
Click to collapse
I'm assuming that was sarcasm...
It really is impressive. Most 3d games contain static rendered floors and walls. Whereas Minecraft requires that each individual block be rendered as a stand-alone manipulative item. It really does require a lot of number crunching and resources.
Yea, MC's large memory usage isn't just inefficient code.
Haha, well you're right from the standpoint of the fact that it's millions of blocks rendered, but if it's going to be that intensive, why use the 8-bit blocks? I love the game, but honestly, it's a little frustrating that it only works on my quad-core desktop. I'm curious to see how much fog will have to be in place for the Xperia Play version out soon.
Sent from my A500 using XDA Premium App
cybermage1 said:
I'm assuming that was sarcasm...
Click to expand...
Click to collapse
*facepalm*
The amount of power needed to run something isn't just determined by flashy colours.
Maddmatt said:
*facepalm*
The amount of power needed to run something isn't just determined by flashy colours.
Click to expand...
Click to collapse
Right but seriously - a cube at most is three polygons (squares) rendered at any given time. You don't bother to render faces that you can't see due to occlusion. If you store the world in a matrix(s) optimized for calculating what's viewable then OpenGL with hardware acceleration handles all of that very well and very fast.
If you're telling me that the reason Minecraft performance sucks (and yes, I think we all agree it does) is because it's rendering so many cubes, and if that's correct.... then the developer is truly dumb. And rich, but still dumb.
I've done OpenGL and DirectX graphics programming for isometric views before and it's amazing the amount of data that can be rendered very fast on a 486 when done correctly.
The Tegra2 renders somewhere (couldn't find exact specs) near 35 million polygons per second. If Minecraft is generating 35 million polygons for every frame, that would explain the 1 fps and support my opinion.
But I digress from the original topic. It'd be nice if the developer would put out an optimized Android version - just think how many more of us (including me) would buy it yet AGAIN just to be able to play on our tablets and phones. lol.
Rendering isn't the only slow part, it has to calculate what to render, light, etc... for each block.
Each chunk (16x16x128) has 32768 blocks in it, at any one time you may have upwards 500 chunks loaded (checking right now, I have 441 after playing for maybe 20 minutes), that is 16,384,000 blocks. Granted, you're never rendering all of those at once, but just cycling through all of them and reading all of them is incredibly intensive, on both RAM and CPU.
In the MC code(Check MCP for tools to decompile and deobfuscate it), you'll see that he's only checking if another block is on the face, and using that to determine if that face should render or not. My assumption on this is that it's quicker to render a face than it is to check occlusion for it.
Also, beyond that, you'd have to consider other things, such as the overhead for things like the X server, VNC, and the obvious lack of hardware acceleration on the X server.

Imprecise magnetometer/compass

Sadly I noticed that the magnetometer of my SGS2 is rather imprecise...
In fact, even just after a lot of effort spent on calibrating it, I notice this:
- With the phone horizontal on a table, I point it to a direction that the compass indicates to be the "south" (exactly 180 degrees), but it appears to me that the phone is actually pointing something like 10 - 15 degrees SE.
- Then, I turn the phone exacly 180 degrees on the table, expecting at least the compass to show 0 degrees North. Well... it doesn't!!! It shows 12 degrees West...
Another thing: I noticed that if I turn the phone at constant angular speed, The compass indication does not! It speeds up next to the north and slows down considerably next to the south, indicating that there is an error the entity of which is related to the absolute orientation of the device.
And last, the indication is a bit unstable. It continuously jumps left and right by +/- 2 degrees.
It does all above with all the applications I was able to test that use the compass.
So in the end, my question is: is all this "normal"? Because really, I can't see any use of a compass with such a bad precision!
118 reads and not a single answer ... yes, ok... I may be a "little" paranoic...
But sure that no one except me cares about the precision of the magnetometer?
I can only share my personal experience and similar questions if this helps at all:
my compass seemed pretty accurate until I read your post and tried to compare with an analogue one. Well, it seems off to the West by about 10 degrees. But than again, I can neither trust the analogue one since it's just the first thing to have turned up, and no one's really verified it. I guess the only way to be sure is to compare GPS and compass direction data in compass app, which I'll attempt tomorrow. Plus, even within a meter from the analogue compass the digital one may start complaining for abnormal magnetic field. They seem to jam each other quite strongly, so there's no chance of visual comparison.
What worries me more, however, is that it never settles down. Like you said, it always trembles somewher in +-2 degrees, which is especially noticeable in Star Chart app (almost impossible to focus on a star long enough to tap it for information popup), and also visible when I disable filtering in compass app.
Hope someon more informed clarifies this for us.
I think you should just be happy that such a small MEMS chip is able to sense the magnetic field of the earth and give you a general idea where north is.....
If you read comments for star chart on the market, you'll notice how there are no complaints of picture trembling, which gives me all the reasons I need to worry about the quality of my particular unit. With the compass always moving around in a sector of 5 degrees it's virtually impossible to use any augmented reality apps, unless they have some filtering features (which they rarely do).
As a side note, after posting yesterday I took a second glance at the analogue compass I've been using as a reference and noticed that it's creator believed a circle to have around 400 degrees. Did another test, this time not relying on the numbers and now I'm pretty confident that the digital one is accurate.
But it still trembles all the time. In fact, if I look at sensor readings in *#0*# both gyroscope, accelerometer and magnetometer tremble a lot while the device lies on a steady surface. I should probably make a video when I get home, and also check the display units in a local mall to compare.
Sent from my GT-I9100 using XDA Premium App
Well, apparently, it seems to be normal for sensors on sgs2 to tremble this much -compared with a display model at media markt... Sad, but at least I won't have to exchange my unit
Sent from my GT-I9100 using XDA Premium App
Sighs... Go into settings, set the filter to high stop ur *****ing and nexttime do some research before posting.
Sent from my GT-I9100 using xda premium
Please, enlighten me, oh, wise one, where is this system-wide filter setting, that will alter the data an app without it's own filter reads directly from sensor?
Sent from my GT-I9100 using XDA Premium App
Hi Artik. Yes there actually seem to be something wrong on how the galaxy s2 sensors are handled, and it looks like it is a firmware issue. Read this thread:
http://forum.xda-developers.com/showthread.php?t=1213138
Inviato dal mio GT-I9100 usando Tapatalk
Wow, thanks, I should've found that one instead of hijacking this one =)

Categories

Resources