After playing around with some live wallpaper stuff, I decided to re-use the code I have in a fashion that's potentially usable to polycounters and other artists out there. So with that in mind I've put together a model viewing application for displaying real-time models on your android phone or tablet.
The current features are as listed:
- Blinn-phong specular model with fresnel
- Up to 3 lights supported (needs to be updated to save presets)
- Emissive and Transparency support
- Diffuse, Specular, Normal and Emissive png or jpg's supported
- Toggle enabled texturesd
- Wireframe display mode
- Fullbright display of a single texture
- Multiple models
- Live wallpaper mode with various viewing options
Future plans include:
- faster model loading
- light and camera presets
- free/paid versions on the marketplace
- gallery mode (basically swipe left/right to view different models)
Preview Image: (click for an imgur album)
Beta Version 11 Release
Installation Instructions: place the polyviewer folder within your data directory on your android phone or in the root directory on your microSD. Installing the apk requires browsing to it where you have placed it and installing it from your phone (you may have to allow for installation of unknown sources).
Models must be in obj format. Textures have to use the naming convention of the obj model name and contain diffuse, specular, normal or emissive in the name. To use alpha channels, you have to save the textures out as pre-multiplied alphas (limitation of android) if you wish to use transparency.
The diffuse map alpha is used for transparency and the specular alpha is used as the roughness value for the specular (between 0 and 255 currently).
Multiple models can be placed into a folder and will be loaded and displayed as a single scene. each model and it's textures should be unique.
This has been tested and runs smoothly on my galaxy s2. I DO NOT GUARANTEE this will run smoothly if at all. This is a test release so I can hopefully get more feedback on performance and other issues. Feel free to leave any feedback or comments. I am also looking for perhaps a couple test environments to build some more stuff into the live wallpaper.
Edit: updated the to the 11th revision.
Replies
Thanks, I hope to have access to some apple hardware at some point so I can port the app over to iOS.
Selecting any of them gives me a force close.
HTC Evo 3D
BenHenry - An iOS version would be nice. It's a matter of being unemployed and the cost barrier for development for apple products is slightly excessive at the moment.
Running Gingerbread on an HTC Desire HD
I can't say 100% certain this works as I am having trouble making the app crash on my phone. Either way, I suspect it was due to how I am doing a search of the directories for available models. Hopefully the options and help pages will show up properly without crashing.
Any log details and such can be emailed to polyviewer at gmail dot com and I'll try to respond within a timely manner.
galaxy nexus here!
The release is bugged, which I am glad I am finding out now before I putting it on google play. I'm going to work on things tomorrow and hopefully figure out the problem when it comes to searching for the correct directories as that's where the crash seems to currently be occurring for everyone.
same here
Moto Defy, android 2.3
Same, tried putting it on both my primary and external sdcard
to confirm, it's looking for the folder in /sdcard/polyviewer right?
EDIT: does anyone have the old apk?
I have hopefully fixed things and have uploaded a new version here
Both on my nexus and iconia tablet it fails to find the files though. Again, which directory is it searching for? I couldn't really see anything in the logcat I grabbed.
I'm happy to do any testing if you want, have a couple of meshes set up, both a gnex and a tablet and a half decent understanding of android on a system level.
Edit: I just want to say thanks for this too, I'm looking for work at the moment and IMO it would be great to be able to show models on my tablet, instead of just screenshots from marmoset or whatever.
The polyviewer folder is in /sdcard as required. Here's hoping you crack the problem.
Same problem that others seem to have. Upon clicking the Model button I get a "Failed to find files." error, and when I click on the error message it seems to try to load models and textures but then crashes. I installed it on my SDcard.
For the external sd card, I'm probably going to need some info since right now it's searching for the polyviewer folder within either the "external_sd" or the "data" directory from the base directory when using a file explorer. Not sure if some folks have their external sd card folder named as something like "sdcard".
Edit: to be clear, within the drive format the program currently searches for mnt/sdcard/data/polyviewer or mnt/sdcard/external_sd/polyviewer
Beta version 4 Release
Nothing changed other than a toast message stating if the program cannot find either directory or unable to read from external storage.
Does the location of the APK matter at all?
Couple questions:
- When plugged into a computer, what drives appear for access?
- If browsing the android file structure from your phone is there an external_sd, sdcard, microsd or a directory that would represent a removable micro sd card? (file browsers are easy to find on the marketplace if needed)
This is turning out to be something to be more of a headache than I originally thought. Turns out manufacturers and google can't settle on ways to keep a consistent naming structure and layout for things.I'm going to hold off on more releases here until I've sorted out this bug some more. If you'd like to get updated versions, feel free to send an email to polyviewer at gmail dot com preferably with your forum name as well and I'll send out emails with new test builds.
this is the toast message you mentioned?
I'm on a galaxy s2
"Unable to access: local storage external storage"
Thanks for creating this man!
Khiro, Yea I'm working on fixing things. the current version is broken and being worked on.
I'm going to be doing some testing and coding today. I am hoping to get a release out tonight that hopefully works for people.
Changes:
- searches mnt/sdcard/polyviewer, mnt/sdcard/data/polyviewer and mnt/sdcard/external_sd/polyviewer (external_sd = micro sd card slot and it seemingly varies from manufacturer so if you have a micro sd, please inform me of it's location within internal android memory)
- on first load of a new model, each is saved in a binary format for faster re-loads so that initial load may be slower. (needs some proper testing to verify the integrity of this working.
- Fixes so the shaders compile on tegra 2 devices. Can't test on other devices.
That's mostly what I've been up to when I've had the time to work on the code. There remains a bug with the live wallpaper option that requires fixing. Basically it crashes when first created, but runs fine after that.I have a bunch of features I plan on adding down the road which include:
- Object Selection as a button overlay
- Replace the colour picker with an rgb slider setup (perhaps with HSL as an option)
- Free and Paid versions on the app store.
- Environment maps
- Cloud drive support (dropbox, google drive, etc)
- Light and Camera presets
- Slight layout redesign (move options, help etc to a side bar menu setup ala google+)
- Lower quality shader support for those in need of some performance
I've not decided fully yet on how I plan on splitting the paid and free versions. My current plans are to include a gallery mode, and limit emissive and reflective to the paid versions among a couple other features. I'm wanting to make sure even the free versions is more than adequate for users to show their portfolio work.*PS yes, there is a live wallpaper option and that will get some tweaks and improvements as well.
Not sure if it's a hardware compatibility issue, but as ballpark reference, Reckless Racing runs just about flawlessly.
dunno if I'm doing anything wrong?
Works fairly well for me
Having a few issues with some alpha mapped planes (they aren't showing up), but I'll talk to you about that next time you're on irc.
Looking forward to multiple lights too
Lotekk, Tigerfeet - damn don't like hearing that. possible to go into the options and tell me if limiting the fps helps performance? default is render as fast as possible, which might be causing issues.
hellbender, I have a galaxy s2. I just had to tweak the shader code to work with tegra chipsets. The shader code should work on most hardware now. I only have access to an asus transformer and my galaxy s2 phone so testing can be limited.
Pampers, weird. not sure what could be causing that. perhaps try using jpg's to see if that works instead of the png's? you won't have alphas but that might narrow down the issue.
Mystichobo, looking good. multiple lights are available. just somewhat clunky with selection and property values hidden in the menu. going to be replaced with an overlay system so the object selection and light options will be visible on screen and not hidden away.
Pampers, Good to hear that it's working for you. I am currently working on overlay controls for camera/light selection as well as light controls and fps display. Here's an old preview. I've since reduced the size of the icons a bit.
When I try to load in my own mesh I get the following message: Sorry! The application Polyviewer (process com.fusedresistance.polyviewer) has stopped unexpectedly. Please try again.
I noticed that in the files that came with the program there's a .pvb file along with the .obj. Is that a file I also need? I looked through google but couldn't find and/or didn't understand what kind of a file type it is.
The fps issue I'm going to have to look into. I'm working on some bugs within the overlay code and I plan on a new release before long.
What's new:
- New overlay controls for camera/light selection
- FPS display
- Fullscreen mode with all options hidden in the menu
I also disabled alpha blending. I don't suspect that's part of the performance issues, but it's something I think it is work checking in helping to eliminate causes of the performance issues some folks are having. I've noticed a few discussions on the fill rate being killed with alpha blending enabled on some phones.I have also tossed in place holders for camera and light presets. I am going to start putting together some presets and hopefully release this update available tomorrow.
Is it necesary Tegra or something like that?
Just at about 0.3fps
I can see this being a great little tool/viewer keep up the good work!
I can run the application but when i pick any model from the list it says loading models and textures and instantly crashes.