[C++] OpenGL Performance - Windows Mobile Development and Hacking General

hi developers,
i have developing in OpenGL for testing but i have a problem with the performance (tested in Diamond).
In attachements files you have a example compiled and the source code, its very simple, the scene is a set de icons (quads with 2 triangles). I do not understand how can this simple program has this performance (my iphonetoday its faster and its pure GDI), some developer can say me where is the problem?

I tried it on my diamond and I can confirm it's very choppy... maybe you could force the code to skip less frames somehow, I'm currently a noob at c++ and don't know anything about Open GL so..
Good luck anyways!

I use Vincent 3D, have i enable the graphics acceleration with some function?

Vincent3D is a software implementation, don't use it on the device! I'm using it only on the emulator while developing.
Just tried to run your example on my device but it starts and closes again without any message. (tried with and without Vincent3D)
Had a quick look in the code: you are requesting a 24bit framebuffer (R8G8B8) try (R5G6B5))!
Maybe you want to try my OpenGL test app found in my sig (check first post to get the latest version).

heliosdev said:
Vincent3D is a software implementation/QUOTE]
ooooooohhhh these is the key!!! Can you test now?? its very very fast!!
Click to expand...
Click to collapse

Cool, now it works on my device, too!
Now add an alpha layer to the texture to be 0 at the white corners and 1 everywhere else and enable alpha blending to get rid of the white corners to have 'round' icons.
To read an RGBA texture you'll have to use IImagingFactory::CreateImageFrom*.

Related

Managed Direct3D code--slow!

I wrote some Managed Direct3D Mobile code, using fixed point arithmetic. It runs slow as a dog and its performance relative to the floating point version of the code shows little improvement.
This is on a Kaiser phone. I know that there are issues with graphics on that thing. I am only trying to use the software renderer, but the speed of my app is so slow that I wonder if it's in my implementation. It is a cube with textured faces, spinning as as fast as it can, and I can only achieve 7 seconds per frame (yes... seconds per frame. Obviously my goal is something in the FPS range!).
Would anyone with experience in writing D3DM code care to give me a hand by looking at my code? I'm at kramer (underscore inserted) ae (at) hotmail (dot) com.
Thanks,
Brian
Sorry to say the Kaiser only has reference drivers for d3dm, all software driven. Thats why its a dog.
and it also dont help that ms stoped all development of Managed Directx along time agoe and most people who wanna do 3d from .net these days use opengl
also on a as weak platform as arm compared to pc
.net being much much relatively slow on arm compared to on x86
doing 3d in a not truely native language as c++ will never give much speed
less so when it comes to graphics
These comments aren't helping. I understand that my environment is not up to industry standards in terms of performance (15-60 fps, for example). But rendering a cube in Direct3D should not be as bad as one frame every 10 seconds. I'm in search of someone who knows the correct baseline performance expectation for my scenario and can help bring the perf of my simple 3D application in line with what is really expected. Alternatively, there may be anecotal information that says my application is actually performing as fast as expected. I don't know that.
The attached archive contains a native and a managed D3D example showing a rotating textured cylinder (from the WM6 SDK). Both run interactive on my HTC Touch (Elf).

[App] [Updated 02-NOV-2008] Diamond Cubes

Here is a small OpenGL based program that allows you to use your Diamond as a "Dice Shaker". It is a simple program and it was written to learn how to use OpenGL together with C# on my Diamond.
There are still some bugs in the collision detection code, but I think it is a good example of what can be done with this lovely PDA/Phone.
I apologize for the bad interface, there is not much else you can do then shake it and exit from the program.
The dices are 3D objects and tumble across your screen. I still think there should some better "randomness" and there is an annoying bug, which I short-fused in a very ugly way
Anyway have fun and if I find the time, I will certainly try to improve it.
Done:
- Add sound effects/ buzzer triggering - thanks to gerDiamond to fix the "bugs" in the collision detection and surur for the sound and background file. Also thanks to simplifight to clean up some of the code.
- Better graphics - I think I finally understand OpenGL lighting
- Menu choice for the number of dices - You can choose 1 till 7 dices
- Ticking on the screen is the same as shaking the device.
Still todo
- Different faces for different types of games (for example the dice colors needed for "Cities3D" ?) - Basic setup for this is done, just need to find the time to create the images
- Nicer graphics for the playboard. Again I have the graphics understood and made some code changes with regard to the rendering of the dices.
- 3D tilting. Have a look at my "Paper Plane" app, which shows a 3D F16, which you can look at from all sides.
Lower priority todo
- Zoom in or out ??
- Change size of play-field ???
Any suggestions are welcome.
I will post the latest sources again, but it could take a few days, since they sort of are a mess for the moment.
Dice can be parked by clicking on them. Clicking on them when parked, they will go back to the "field".
Help needed
I could still use some help in the dice rotation algorithm. Currently there is a tendency to favor some numbers, but I need to randomize it better. One solution is perhaps to randomly choose between turning around the x or y-axis ?
Graphics are welcome.
I also could use some help or guidance in using a "3DS" loader or something similar, so that people can design their own dice textures.
If you have nice pictures of dices, preferable JPG or PNG with square sides, I will try to use them. Usable sizes are 64x64, 128x128 or 512x512
got the sofa!!
Hi there!! It looks great for fun with your friends!!!
I will try it right away !!
I just tested this first version.
The animation is great, perhaps de Gsensor sensitivity could be enhanced to be more realistic the "shake" to trow the cubes.
Great job my friend!
Wow.. very nice
This looks great... A little more programming and it will be perfect...
some sound... and interaction with the cubes.. ( now they can land ontop on eachother)
Looking forward to see the next version
nice job!
how about adding another 3 dice so i can play yatzee?
Great app, but it doesn't work for me. I'm using 1.93 NL official rom.
I allso found an iPhone dice app so here is the link for inspiration for further developement http://www.youtube.com/watch?v=ugoq8M2XxVE
I'm also willing to make the dice so they look more beutifull but i don't know how this is done with mobile phone apps. Will a Cinema 4D or 3DSMAX render do?
.NET CF 3.5 needed
gebruikershaes said:
Great app, but it doesn't work for me. I'm using 1.93 NL official rom.
I allso found an iPhone dice app so here is the link for inspiration for further developement http://www.youtube.com/watch?v=ugoq8M2XxVE
I'm also willing to make the dice so they look more beutifull but i don't know how this is done with mobile phone apps. Will a Cinema 4D or 3DSMAX render do?
Click to expand...
Click to collapse
Problem 1: You might want to check if you have .NET CF 3.5 installed. I always use that because it is installed in my ROM.
The dice is created as a cube on which I render 6 different images. So I don't know if you can use Cinema 4D or 3DSMAX. Check the sources, maybe that it gives you a better idea ? Any way I appreciate any help I can get, I am still learning to use the OpenGL software, so I have not really a clue about all the possibilities. Sometimes it feels like I have managed to understand about 5%
Maybe some other people can help out here ?
My main reason to add the sources also was the hope that somebody would take the application and make it better, so that I can learn of it too.
Nice app!
A little laggy though, besides that it looks great!
Great idea. Should be called "Diamond Dice" though? sounds more appropriate ;-) And is the animation quite smooth for everybody else? not very smooth on my Diamond, but that might be due to the high memory usage I usually have
Greatttt ... thanks a lot...
Can you make a version for Yahtzee?
gebruikershaes said:
Great app, but it doesn't work for me. I'm using 1.93 NL official rom.
I allso found an iPhone dice app so here is the link for inspiration for further developement http://www.youtube.com/watch?v=ugoq8M2XxVE
I'm also willing to make the dice so they look more beutifull but i don't know how this is done with mobile phone apps. Will a Cinema 4D or 3DSMAX render do?
Click to expand...
Click to collapse
The graphics looks very realistic for the iphone...hope someone can do better for the diamond.
Would b great if can add in sound and slight vibrations when the dices hit the sides of diamond...
Very nice app. Just a little bit more tweaking. Thanks a lot.
I've tried looking into it but tbh i have no clue about how that stuff is done. But this might help you improving your opengl skills . http://nehe.gamedev.net/ on the left are lots of tutorials.
ykyong said:
The graphics looks very realistic for the iphone...hope someone can do better for the diamond.
Would b great if can add in sound and slight vibrations when the dices hit the sides of diamond...
Click to expand...
Click to collapse
I settle for "just as good". I hope someone here will take on the challenge to create a similar app. Diamond Cubes is a really good start!
Yeah this is cool to start with, heres hoping someon can expand this with sounds, better responses etc.
Wow.. very nice thanks!!!!!!!!!!!!!
Is there anyone working on this or is it forgotten? Hopefully not, I’d love to see a yatzy version ala Iphone style…
Hi, congratulations and thanks for the app!
after having seen this app i wondered if it is usable for playing table top role playing games like d&d
It would be very nice to have those features (first are most relevant):
- type of dice (4, 6, 8, 10, 12 or 20 faces are standard dices)
- how many dices
- color one or more dices differently (in d&d you may be using one dice for fire damages and another one for ice damages for example)
- save and quick load presets like "2D8+1D6(fire)"
- if we have presets it would be nice to save fixed modifiers and calculate the final result, for example ""2D8+1D6(fire)+2" means you roll 2 8 faces dices, 1 red 6 faces dice and sum 2 to the final result.
- ok.. since maybe i am the only one who needs those features a simple and advanced selector at the startup would be nice for everybody
thanks!
Video of the app here.
http://wmpoweruser.com/?p=1016
Surur

Touch-Shell Graphic Library (WMGL) with Fast Alpha Blending & 3D Effects is Released!

Touch-Shell Graphic Library (WMGL) with Fast Alpha Blending & 3D Effects is Released!
Hi guys!
WMGL - Windows Mobile Graphic Library is released!
As it is our first launch of the library to public, please do not criticize us too much
Please post here all your questions and suggestions! Your feedback will be appreciated!
This library currently used in the our project Touch Shell.
Key features:
Various "3D" Effects
Fast Alpha Blending
Blending types (HUE, Color, Saturation etc.)
Transparent PNG Support
Filtering
Bordered blitting (resize skinnable elements without resizing its borders)
Easy usage from .NET
Features in development:
More 3D Effects
User filters
Hardware acceleration support
and more...
Library details:
C++ optimized procedures for semi-transparent drawing
Used libraries: Direct Draw, Imaging API (for PNG loading only, not for drawing)
Free for freeware applications
Download wmgl_setup.exe version 1.0 (~550Kb)
More information at the official web page.
Ya, that will be very useful for various developers.
Mobilityflow said:
...How I can create a poll here? I can not find a check box like described in FAQ
Click to expand...
Click to collapse
Suggest you PM one of the mods...
Interested, yes !
(is it a .net lib?)
Yep, interested if easily used in .NET.
What are you basing your library off of? Direct X, GDI, Open GL, ect.
And what language is it written in?
Mr_Gee said:
Interested, yes !
(is it a .net lib?)
Click to expand...
Click to collapse
It is C++ library, but we can create DLL and write .NET classes for easy usage.
chetstriker said:
Yep, interested if easily used in .NET.
What are you basing your library off of? Direct X, GDI, Open GL, ect.
And what language is it written in?
Click to expand...
Click to collapse
We'll create DLL and write .NET classes for easy usage - it is not a problem.
Our library uses standard WM libraries: DirectDraw and ImagingAPI.
Mobilityflow said:
Our library uses standard WM libraries: DirectDraw and ImagingAPI.
Click to expand...
Click to collapse
a bit offtopic:
For AlphaBlending and semitransparent PNGs ImagingAPI not so fast on WindowsMobile.
I have tried compare: ImagingAPI vs AlphaBlend with loading PNGs using libpngce.
Loading a lot of graphics ImagingAPI wins (i'm think linpngce not so fast with zlibce) but drawing semitransparent PNG with AlphaBlend API faster that using ImagingAPI. Also exists solution use ImagingAPI to load PNGs and then draw it using AlphaBlend, but this way uses more memory and a bit more time for load images because AlphaBlend need perpixel modification of bitmap for semitransparent image drawing.
ps: comparing using two devices: Diamond and Touch HD.
pps: easy to find ImagingAPI C# wrapper for loading and drawing transparent images (perpixel semitransparent images most interest, because simple transparent like GIF can be loaded and drawed using more fast API)
pps: But your library will be very useful for developers, i'm think. Also i what to test it, if it be on public test (for free software )
exidler said:
a bit offtopic:
For AlphaBlending and semitransparent PNGs ImagingAPI not so fast on WindowsMobile.
Click to expand...
Click to collapse
We are using ImagingAPI for PNG loading only. For semi-transparent blitting we are using our optimized C procedures.
We going to prepare a library for publishing in a week. I will update the post.
Mobilityflow said:
We are using ImagingAPI for PNG loading only. For semi-transparent blitting we are using our optimized C procedures.
We going to prepare a library for publishing in a week. I will update the post.
Click to expand...
Click to collapse
Nice, waiting for the release
Nice idea, i think lots of developers on this forum would be interested in such a library, since they have very good and potential ideas that can be developed and they wont have to worry about the visual effects and concentrate more on the core functionality... nice work!
waiting for the release
I'm also interested.
This would be amazing! Please share! Thanks in advance.
Thanks for the reply
put me on the queue!
Any idea when this is going to be released? I am patiently (not really ) waiting
Count me in
Me to this would be ever useful
Very nice work! It will be perfect if we can use with C#.
Waiting for the release
Doesn't matter to me. It was slow and unresponsive on my Touch Pro anyway. Good luck.
WMGL is released!
WMGL is released and available for download!
wmgl_setup.exe version 1.0 (~550Kb)
Please see original topic - I've updated it.
Waiting for your feedback!

{Updated-12/10/09}[Project] DirectMobile - DirectX Accellerated UI Framework for WM

DirectMobile is a DirectX based Managed UI Framework for Windows Mobile. Aim of the framework is to provide an elegant UI for Windows Mobile devices which is simple to develop against.
Target Platform:
WM6.0+
.NET CF 3.5
Current Implementation:
All graphics rendered in Direct3D. Each DM Application gets access to the rendering device and has one host window. The host window renders one frame at a time. Each frame can hold other elements such as buttons, labels or lists.
Design Considerations:
Sharing of GPU by multiple applications [High Priority]: Ideally a DirectMobile Rendering service must be implemented and applications request rendering via named pipes. This will reduce GPU and CPU utilization.
Remove dependencies on System.Windows.Forms [Low Priority]: To reduce developer confusion, references to Windows Forms need to be removed. This can be implemented via native calls to AGL lib.
Tested Against:
Blackstone: WM 6.5 + Neo Driver Pack r3
Touch Cruise: WM 6.5
WM 6.5 Device Emulator
WM 6.1 Device Emulator
WM 6.0 Device Emulator
Sample Code:
public static void Main()
{
//Start DirectMobile Application
DMApplication.Run();
//Render a new Frame
DMApplication.Current.ShowFrame(new Controls.Frame{ BackgroundColor=Color.Black, ForeGroundColor=Color.White, Title="My First Frame"});
}
DirectMobile on Codeplex
put me down for pre-alpha, alpha, beta, rc tester.
Nice initiative. It is rumoured that MS will let go of Direct3D with the onset of WM7. Is OpenGLES not the way forward?
On a side note, I wouldn't mind beta testing, heh.
Thanks in advance.
Count me in for graphics and ideas (if needed).
nuke1 said:
Nice initiative. It is rumoured that MS will let go of Direct3D with the onset of WM7. Is OpenGLES not the way forward?
On a side note, I wouldn't mind beta testing, heh.
Thanks in advance.
Click to expand...
Click to collapse
I did a quick lookup and i dont see any references on OpenGLES been used with WM7. If you find something let us know but please lets not discuss this here
Am always willing to test for constructive purposes. Let me know if you need a tester for the HTC Fuze / Touch Pro
i am also willing for some alpha and beta testing!!!! using a diamond
twolf said:
Count me in for graphics and ideas (if needed).
Click to expand...
Click to collapse
me too, graphics and usability issues.
wondering if XDA Flame will support this in HW Accelerated mode.
Most of the drivers on Flame are reference BS, slapped from the MS emulator onto the device. Fingers crossed for this one.
Count me in to test it (VGA device, HTC Universal).
I'm in as a developer. I have a decent amount of c# experience.
will to beta test for usabilty and bugs - diamond user.
Count me in. Sprint touch pro
I'm also want to be a tester. Also, can help in development, if free time will be exists.
I'm not try use managed DirectX, only OpenGL small apps for PC.
HTC Blackstone.
I thought about writing something like this a while back - don't have a ton of cycles, but can contribute on the dev side and testing.
I can help with testing this time around. Maybe I can help with developing later on. I'm using an HTC Touch VOGU100
tester
just got a touch pro and can consider as intermediate user .....well i can help out as tester ... do giv me a pm ..... hopefully i can help out n also gain some exp ..... thanks
I will be happy to help with graphics and design. I have helped with the manila - framework.
BTW: my other account it call UknownDev
also I am have some nice TF3D Themes.
So.. I'll be more than happy to help.
nice!
I'm in for testing and graphics!
I own an ASUS P550 (greek WM6.1pro) and will probably switch to an Omnia variant soom.
This seems to me like a great idea!
I'm experienced with C# and would like to help in this project (the development part). I don't have much spare time because of my current job, but whenever I can find some, I'd love to help.
-- edit:
I've got a Codeplex Id: w0lf

PocketCM Imageviewer test opengl build

Hi,
I usually post in the "global dev" and not a device specific forum, but as I recently got a Diamond, I've been experimenting a bit with OpenGL.
For the curious, you can download an opengl enabled build of ImageViewer using HW opengl of our beloved device.
You can find it here:
www.pocketcm.com/daily.php
Of course it require real accelerated driver (which come with the device by default if I'm right), and it's still experimental, it seems to works decently until a certain number of images (texture) are loaded.
In practice, on my device, it's A LOT faster than the software version and it makes it as nice to use as... on my old HTC Touch phone.
Enjoy!
Cool program for an experimental version.... i like the way it rotates the image
just wanna let you know GREAT APP .... im sure ur putting in a lotta features...i was wondering if u can make a coverflo activated on the rotation of the phone...it'll be uber cool...thanx
nice idea..
tried it on my XDA Flame which has Goforce 5500 GPU and it does not run!
log file says "cant initialize opengl"
(of course we do have opengl drivers official on Flame)
please fix !!
works on my TP, but often gets stuck...

Categories

Resources