Squamster-Mesh viewer/painter - v0.4 *New Version: 7-04-09

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Squamster-Mesh viewer/painter - v0.4 *New Version: 7-04-09

Post by mcaden »

Name: Squamster
License: GPL


Funny name, I know - Long story. I'll get to that later, but for now, Screenshots!

I'm working on a mesh viewer/painter for Ogre .mesh files.

So!

Current Version - 0.4 - Added Filters and Tools
  • Brush
  • Blur
  • Sharpen
  • Dodge
  • Burn
Image

Initial Release
Image
Image
Image


The Name
I was talking to a friend of mine and I asked about a name idea for this program. She mentioned that about 1/2 of the viewers she's seen (although she hasn't seen that many) have animal names. In college some friends and I created a 'legend' about an escaped hamster mating with one of the numerous squirrels on campus and forming a mutant "Squamster". This is a combination of things you normally don't see together (Viewer, Painter, Open Source) we decided the program was also a mutant.


Features
  • Load any Ogre.mesh using its own material and shaders
  • View the mesh from any angle
  • Play and pause any of the meshes animations
  • A lot faster than the other mesh viewers I've seen
  • View all the textures attached to the mesh
  • Paint directly onto any texture attached to the mesh in real-time
  • Customizable brushes with opacity and scale
Upcoming planned features
  • Empty the "Known Bugs" list
  • Image Filters - Brightness, Contrast, Scale, Rotate
  • Blur, Smudge tools
  • User settings - control undo history, add additional resource locations from settings.
  • Image Layers
Prerequisites
  • Visual Studio 2008 redist
  • DirectX redist
The Download
http://code.google.com/p/squamster/downloads/list

The Code
http://code.google.com/p/squamster/source/checkout


Known Bugs
  • If a resource location is added outside the viewer's project, "Load all" won't load from its old locations any more. (bug persists from previous release)
Known Quirks
  • If the mesh you load doesn't have the materials/textures in the same folder or a subfolder, it will appear as texture-less
Last edited by mcaden on Sun Jul 05, 2009 9:00 am, edited 6 times in total.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Pretty cool! :D

Is it written in MOgre? Looks accomplished. Looking forward to the mesh painting. :)

Is Squamster scriptable via Squirrel? :P
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

It's Mogre.

Squirrel isn't in it...maybe I'll add it later so you can script macros or something just because of the name :)
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Nice work!
What is your exact goal for painting meshes? Some kind of 3D Paint app?
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

Yes, being able to paint directly on the models.

I know blender and the other 3d modeling tools do it...but I'm thinking about 2d artists who are asked to texture a model, but don't feel like taking the time to learn one of the modeling packages and don't have the money to get something that is specifically for painting 3d models (like bodypaint).

My artist is a graphic designer/2d illustrator...no money, and is overwhelmed by blender. So my other game project also falls into it's target audience.

That, and it should be good portfolio stuff. I'm trying to build my portfolio so I can start my professional career in game development. I've got this and I hope to have an alpha demo of my game project available within the next 2 weeks.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Centipede wrote an incomplete texture painter 2 1/2 years ago (wow, time flies!), which you can use as a base.
Well, it's not using Ogre, but I bet you can use the shaders and the ideas.
I am probably able to dig it up somewhere.
Here's it's topic:
http://www.ogre3d.org/phpBB2/viewtopic. ... ght=insect :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Wait!
Here it is:
http://vaults.atomicmonstergirls.net/us ... s/insects/ :)

Screen shots here:
http://vaults.atomicmonstergirls.net/pu ... reenshots/

Sorry about spamming your showcase topic, but I really want a working 3D painter! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

Ah, I was just about to post saying all links were dead :( even googling it.

Glad you found it, I'm downloading it now.
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

I could get the program to run but it was a little slow. I couldn't get it to load meshes from the xml files. It kept saying it couldn't find "../../media/tips" even though the folder was obviously there.

EDIT: Gave it another try. Still couldn't load my mesh but realized the "Canvas" is actually a cube. Painted around a bit. The painting was smooth and I really liked the brushes/textures, but it didn't stick to the mesh right. The painting was offset and distorted.
jacmoe wrote:Wait!
Here it is:
http://vaults.atomicmonstergirls.net/us ... s/insects/ :)

Screen shots here:
http://vaults.atomicmonstergirls.net/pu ... reenshots/

Sorry about spamming your showcase topic, but I really want a working 3D painter! :)

I'm REALLY glad to know there's a need/interest for it. That's why I did it and that's also why it's open-source (in case somebody has a better solution than I do).

Honestly, I coded this in 2-3 days, after having not touched C# in nearly 3 years. Most of it is relatively simple stuff. The next parts are the parts that are difficult, but I have plans on carrying them out.

Right now I'm working on the "Raycasting to the Polygon level" code. From there (as I understand it) I need to get the barycentric coordinates and convert them to UV coords, then I can draw on a bitmap at those coords. For minimizing bleed I plan on getting all the used UV coords on a mesh when it loads and creating a mask (probably is harder than I describe it). This would allow me to limit a brush from bleeding across a gap in the texture to other UVs (painting a human's head suddenly also paints his pants == no good). From there I can use bitmaps as brushes - blending the color the user has selected from the brush with the texture in various fashions (add, subtract, multiply, divide, mix ) along with taking into account opacity and feathering.

From there's as I can see it it's adding much easier features like customizing light position (right now, single directional light from the direction of the camera). I believe layers would be making each one as a separate image and adding each one as a pass.

If somebody wants to add a feature or a bug fix, please e-mail me a patch. If somebody wants to be very active on it they can e-mail me expressing their interest and after proving themselves with a couple bugfixes/patches I'll add them as a member to the project.

This is also my first open-source project I've created...If there are any suggestions about managing the project please let me know. I've created it's space on google code.

http://code.google.com/p/squamster/
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16

Post by KungFooMasta »

I'm interested! Aside from artists who don't know modelling packages, this functionality would be useful for allowing users (players) to customize their avatar. For example I recently played Okami for the Wii and a part of the game gives you a mask that you can paint on. I thought it was pretty sweet. The editor itself won't help in this, but the code you write to do painting will.
Creator of QuickGUI!
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

I've played okami a little...the artist I originally started doing this for is obsessed with it.

I also started it due to a player-customization idea I had for a paintball game. Part of this project may need to be separating the mesh painting stuff out as a separate library...or at least copying a lot of the functionality into one.
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

You can expect at least screenshots of a limited-functionality mesh painter within the next 24 hours.

I can currently paint directly on a mesh, have it immediately show up on the mesh, and have it show up in a texture preview.

I need to
  1. Improve the precision of the mousepicking (should actually only take like 10 minutes once I actually do it)
  2. Track down a crash on close (Crashing trying to destroy TexturePtr)
  3. Implement Saving
  4. Implement at least 2-3 brushes (right now I can only paint 1-pixel at a time).
  5. Implement a color-picker.
I'm really only worried about #2...afraid it might impact functionality. I honestly have very few ideas about the reasons for the crash and each of them seem unlikely.
Last edited by mcaden on Mon Dec 08, 2008 5:26 pm, edited 1 time in total.
Katalyst Studios indie game dev project
Squamster - open source mesh viewer/painter
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Post by calsmurf2904 »

I thought that destroying root destroys the ResourceManager wich destroys all the resources (Like TexturePtr).
Try enabling Ogre Memory Tracker and then remove the code that destroys it to check if it leaks memory.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

It's in the TexturePtr destructor...it's acting like it's trying to destroy a Texture that has already been destroyed.

I don't know how to use the ogre memory tracker. I tried googling it but can't find it. I searched the forums a bit and came up with "#define OGRE_MEMORY_TRACKER_DEBUG_MODE" but it did nothing.
Katalyst Studios indie game dev project
Squamster - open source mesh viewer/painter
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Post by calsmurf2904 »

In OgreConfig.h change these lines :

Code: Select all

#ifndef OGRE_MEMORY_TRACKER_DEBUG_MODE
#  define OGRE_MEMORY_TRACKER_DEBUG_MODE 0
#endif
to

Code: Select all

#ifndef OGRE_MEMORY_TRACKER_DEBUG_MODE
#  define OGRE_MEMORY_TRACKER_DEBUG_MODE 1
#endif
and then recompile everything (even ogre).
This will enable the Memory Tracker in Debug mode.
Release is still fine :)
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

Thanks for the info, I'll do that tomorrow. For now I'm going to bed.

I did however step through the destruction process and confirmed that it IS trying to delete my TexturePtr twice.

EDIT: I think it's because I'm manually creating a pass for that manual texture:

Code: Select all

    Pass drawPass = techniqueItr.Current.CreatePass();
    drawPass.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
    drawPass.CreateTextureUnitState( "drawTex" );
    drawPass.LightingEnabled = false;
Katalyst Studios indie game dev project
Squamster - open source mesh viewer/painter
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Post by calsmurf2904 »

maybe that's because root destroys it first....you should wait to see if it still leaks memory if you remove the delete TexturePtr code.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

I'm letting root destroy it. I'm using C#. Unless I'm misunderstanding things I don't need to manually destroy the TexturePtr.



Creation:

Code: Select all

drawTexture = TextureManager.Singleton.CreateManual("drawTex",
                ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, TextureType.TEX_TYPE_2D,
                mWindow.Width, mWindow.Height, 0, PixelFormat.PF_R8G8B8A8, (int)TextureUsage.TU_DYNAMIC);
Adding pass to technique::

Code: Select all

        Pass drawPass = techniqueItr.Current.CreatePass();
        drawPass.SetSceneBlending(SceneBlendType.SBT_TRANSPARENT_ALPHA);
        TextureUnitState texState = drawPass.CreateTextureUnitState( "drawTex" );
        drawPass.LightingEnabled = false;


Aaaaand going to bed for real this time, I've got work in the morning.
Katalyst Studios indie game dev project
Squamster - open source mesh viewer/painter
Baddcog
Halfling
Posts: 62
Joined: Sat Jul 12, 2008 12:16 am

Post by Baddcog »

Wow, awesome project.

2 things I've wanted. A better viewer and a 3d painter (if even just for basic stuff to touch up in Photoshop and to help paint seams).

Wacom compatibility would be very cool. I don't know much about it, that's possibly included as the tablet just seems to substitue for mouse/keyboard.

Would be very cool to have something working to have the materials in a folder other than the mesh's folder. But I can live with using one folder.
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

I believe what was happening was that C# was calling my TexturePtr's destructor before root was being disposed...so I set the TexturePtrs to null and let root take care of it. I plan on checking for memory leaks soon. Unless I'm mistaken it should be taken-care-of in C#'s garbage collection but I'll check anyway just in case I'm wrong.

So...I'm having a problem with the textures being invalidated but...

Image

Pay attention to the thumbnail on the right ;)

As soon as I take care of that, add a couple brushes, a color picker, and save functionality I'll do another commit and package a download.


All crashes are gone as far as I can tell. No more random crashes and no more crashes on closing.
Katalyst Studios indie game dev project
Squamster - open source mesh viewer/painter
User avatar
mcaden
Goblin
Posts: 206
Joined: Wed Jul 02, 2008 9:29 am
Location: Texas, USA

Post by mcaden »

Well...hard part complete :)

Image
Katalyst Studios indie game dev project
Squamster - open source mesh viewer/painter
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Wow, that looks great! Good work! :P
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Excellent, mcaden - just excellent! :D
Are you able to post a video of it in action? :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Bekas
OGRE Expert User
OGRE Expert User
Posts: 253
Joined: Sat Oct 16, 2004 11:21 pm
x 1

Post by Bekas »

Whoa, cool project!

About the crash, it's in the FAQ: Why do I get a crash when I dispose Root ?
MOGRE (Managed OGRE) - Advanced .NET wrapper for Ogre