www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Modding > XNALara

Reply
 
Thread Tools
Old 05-09-12, 21:20   #11
Love2Raid
Tomb Raider
 
Love2Raid's Avatar
 
Join Date: Nov 2008
Posts: 20,660
Default

^
Yeah, I can name a few people on deviantArt who were asking about a Mac version. ^_^
__________________
It’s just an opinion, you don’t have to agree. ¯\_(ツ)_/¯
Love2Raid is offline   Reply With Quote
Old 06-09-12, 04:50   #12
XNAaraL
Professor
 
XNAaraL's Avatar
 
Join Date: Apr 2009
Location: The worthwhile problems are the U can really solve, the ones U can really contribute something to
Posts: 3,207
Default

Quote:
Originally Posted by Cochrane View Post
Ah, it seems someone has discovered my secret screenshot repository.

For everyone else interested, it is here:

https://github.com/cochrane/GLLara/t...es/screenshots

There's a story behind each screenshot, but it's usually not interesting for those who don't know a bit about 3D programming, and for those, it should be more or less obvious what's going on.



Anyway, inverse kinematics? I love the idea, but this is no trivial problem. On the other hand, I do have some other software where this would be useful. I guess I'll read up some more on the maths.
I can provide a C# class, created for XPS.

BTW: Good work with the "shadeless" shader, this night!
__________________
Link removed. - Why ? google, google “Google is your friend!”

Last edited by XNAaraL; 06-09-12 at 04:54.
XNAaraL is offline   Reply With Quote
Old 06-09-12, 14:27   #13
Cochrane
Golden
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,721
Default

And now you can pose models.



And damn, it's annoying. For reference: I haven't actually used XNALara before. I've written my own program, for Tomb Raider's 1-4, and now thought that having something like that for modern models would be cool, too. But the amount of bones here, that's beyond good and evil. So yes, I will do my best to give you better interfaces for posing, including inverse kinematics.

The app is still severely limited. You can't change the camera, you can't change the lights, you can load a total of six items, I think, you can't load or save anything and there are probably a few issues that I still haven't mentioned. So for now, you won't be able to download it, because releasing something like this and pretending it works would be embarrassing for me.

If you are really adventurous, you can of course download the source on Github (link is in the first post) and compile it for yourself. All you need is Xcode, which is available for free on the App Store. But if something doesn't work, remember, it's not a bug, I just didn't get around to that yet.

Quote:
Originally Posted by XNAaraL View Post
I can provide a C# class, created for XPS.

BTW: Good work with the "shadeless" shader, this night!
That would be awesome, if you don't mind me releasing my version as open source!
__________________
Güter auf die Bahn!

Last edited by Cochrane; 06-09-12 at 14:30.
Cochrane is online now   Reply With Quote
Old 11-09-12, 07:59   #14
lollercoaster
Hobbyist
 
Join Date: Aug 2012
Posts: 3
Default

it would be great if somebody coud make it like miku miku dance (a very basic animation program for vocaloid fans) Lara Lara Dance? lol no
but then again you can always import the model to blender and 3ds max so i guess it would be a needless feature in a way, for the extended mesh files
lollercoaster is offline   Reply With Quote
Old 11-09-12, 08:32   #15
XNAaraL
Professor
 
XNAaraL's Avatar
 
Join Date: Apr 2009
Location: The worthwhile problems are the U can really solve, the ones U can really contribute something to
Posts: 3,207
Default unused bones

Of course, IK is open source. http://www.digitalrune.com/Support/B...IK-Solver.aspx

About the the amount of bones: XNALara hide all bones if the "bone name" start with the string "unused"
The prefix unused means: "This bone is not very useful for animation purpose.", even if this bone control the surface.
__________________
Link removed. - Why ? google, google “Google is your friend!”
XNAaraL is offline   Reply With Quote
Old 11-09-12, 10:05   #16
Cochrane
Golden
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,721
Default

@lollercoaster: At the moment, static scenes are enough work - my program is already significantly bigger than XNALara if you exclude the code for the items. I'll keep the suggestion in mind, but this isn't something I'll do very soon, if at all.

@XNAaraL: Thanks for the link! And thanks for the explanation, I've been wondering about all this "unused". I think I'll get rid of it sooner or later. A question: If a bone is unused, can I safely hide its children, or is there a chance that some of them might be used?


And now for some screenshots and recent changes.

The model I'm using for these screenshots is Soul Calibur V - Natsu (alternative/p2) by Love2Raid. This model is really great for testing, because it uses a lot of interesting features. If I, as a developer, have been lazy, then this model will show it.

First of all, an overview over the interface as it now stands:

There are by default two windows: One for all the settings, one for the rendering. That is two windows per scene; you can have as many scenes open as you like - and as your computer can handle, of course, but if you use the same model twice, it will still get loaded only once, to save resources.

The main window contains all items, the lights and a generic field for settings - right now I don't actually have anything for that heading. Also, I need to put something in the right pane when nothing is selected, it looks horrible otherwise. The render window shows the scene. You can set the camera position and the window size explicitly with the bottom-left button, which opens a popover field. You can also prevent the window from being resized and the camera from being changed, to get your scene just right (you can still change them via these fields, though). Note that it says "Render view 1" - I'll get into that in a bit.

I think one of the biggest differences I have to classic XNALara is the lighting model.

You can see that I have an additional color for specular highlights. Maybe unnecessary, but in some cases, that extra degree of freedom is helpful. As you can also see, I don't have a shadow depth value here. Instead, there is an ambient color:

This is the basic color for the entire scene. Set it lighter to make everything brighter, or darker to make everything go darker, and change the color to set the mood, like here, "unhealthy". (Those colored squares in the window are standard Mac OS X color controls. Click on one and a color selection panel opens).

Another big change: You can set render parameters for meshes on the fly. This means that if you want to try less…

or more…

reflection, you can just do so. The view updates while you drag the slider. In a future version, I want that you will be able to change the shader (render group), too, but that opens a whole new set of questions that I don't want to answer right now. By the way, I am calculating my reflections in a different way from XNALara. If anyone wants, I can port that over to the improved shaders for XNA I've written, but I don't think the distinction matters a lot - I just like my version more from a mathematical point of view.

As part of my efforts to get this model to load, Love2Raid told me to implement culling (which was easy, it takes exactly two lines in OpenGL), and that it would be fun if you could set culling per mesh. Sure, why not?


Let's get back to the name of the render view. You can open as many views per scene as you like, instead of just the one.

My idea is that you have maybe one main view that you want to render, but to pose the details, you want to get more up-close and personal to what you're working on. This way, you can have both. The sizes of the render views are also saved and loaded.

Oh yes, I also have saving, opening of documents and infinite undo/redo for absolutely anything, but that doesn't make for good screenshots. I also have implemented what I spoke of in the requests thread - there is no longer a per-mesh limit on bones, but instead a per-model one. That per-model limit is 1024 bones, though, so I strongly believe that this won't actually hurt anyone. And due to the way it's implemented, it will actually make rendering slightly faster, especially in the case of mostly static scenes… which is what this app is all about, so yay!

What does make for good screenshots is that I now also support HiDPI (or, as Apple calls it, "Retina") mode. This also makes for extremely large screenshots, so as a link instead: https://raw.github.com/cochrane/GLLa...2011.54.09.png
This doesn't help me any, since I don't have a retina Mac (this was taken by setting my iMac to Retina resolution, via an official debug function, but everything is so large at that mode that it is completely impossible to use), but in this day and age, not supporting it would be a crime. It didn't take any real effort either; I just had to tell OpenGL that I want a high-resolution context, and the only custom artwork in the program (outside of OpenGL) is the camera icon, which is high-resolution anyway since it is a PDF (Yes, I can use PDF files as button images in Mac OS X. Cool, isn't it?).

I'm right now working on loading and saving poses, and then I'm going to update the posing some more. Essentially, I'm almost ready for an initial preview release - in fact, I could make one right now, it would just be very rough around the edges.
__________________
Güter auf die Bahn!
Cochrane is online now   Reply With Quote
Old 11-09-12, 11:00   #17
XNAaraL
Professor
 
XNAaraL's Avatar
 
Join Date: Apr 2009
Location: The worthwhile problems are the U can really solve, the ones U can really contribute something to
Posts: 3,207
Default

Quote:
Originally Posted by Cochrane View Post
...

@XNAaraL: Thanks for the link! And thanks for the explanation, I've been wondering about all this "unused". I think I'll get rid of it sooner or later. A question: If a bone is unused, can I safely hide its children, or is there a chance that some of them might be used?
...
If a bone is unused, dont hide all children. Take a look on the DLC_Bikini or better a TRL Lara made available by Dusan. unused003 (index 2) are the parent from nearly every bone.

Code:
153 # bones
root ground
-1
0 0 0
root hips
0
0 1.140024 0
unused003
1
0 1.140024 0
pelvis
2
It is a pity that not blanks are used to display the Hierarchy.
__________________
Link removed. - Why ? google, google “Google is your friend!”

Last edited by XNAaraL; 11-09-12 at 11:03.
XNAaraL is offline   Reply With Quote
Old 11-09-12, 11:02   #18
Cochrane
Golden
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,721
Default

Quote:
Originally Posted by XNAaraL View Post
If a bone is unused, dont hide all children. Take a look on the DLC_Bikini or better a TRL Lara made available by Dusan. unused003 (index 2) are the parent from nearly every bone.

Code:
153 # bones
root ground
-1
0 0 0
root hips
0
0 1.140024 0
unused003
1
0 1.140024 0
pelvis
2
I see. Then I'll simply display (in this example) the children of unused003 as the children of root hips instead, right?
__________________
Güter auf die Bahn!
Cochrane is online now   Reply With Quote
Old 11-09-12, 11:43   #19
XNAaraL
Professor
 
XNAaraL's Avatar
 
Join Date: Apr 2009
Location: The worthwhile problems are the U can really solve, the ones U can really contribute something to
Posts: 3,207
Default

Mache es wie ein Dachdecker. Dein Vorschlag kommt den Anwendern sehr entgegen
PS: Der German Thread spart mir viel Zeit, ich kann kein Englisch.
Code:
153 # bones
root ground
-1
0 0 0
root hips
0
0 1.140024 0
unused003
1
0 1.140024 0
pelvis
2
0 1.072824 -0.0068576
leg left thigh
3
0.0800232 0.9953844 -0.03070714
leg left knee
4
0.0800232 0.5813914 -0.01625019
leg left ankle
5
0.0800232 0.1071868 -0.04532434
leg left toes
6
0.0800232 0.01159057 0.07679858
It's your decision.
XNALara split the bone names using the whitespace character (blank) to build the tree.
root ground --> bone name (leave) "root ground" with dummy parent "root" (dummy root from the tree, "root ground" are the real root)
root hips --> bone name "root hips" with dummy parent "root"
pelvis --> bone name "pelvis" as 2nd root from the tree
leg left thigh --> bone name "leg left thigh" with dummy parent (node) "leg left" with dummy parent "leg". "leg" are the 3th root from the tree



ControlGUI.cs ControlGUI.BuildNodeTree()
Code:
        private void BuildNodeTree(List<Armature.Bone> sortedBones, 
                                   out List<TreeNode> treeRootNodes,
                                   out Dictionary<Armature.Bone, TreeNode> treeNodeDict) {
            List<TreeItem> items = new List<TreeItem>();
            foreach (Armature.Bone bone in sortedBones) {
                TreeItem item = new TreeItem();
                item.nameTokens = bone.name.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                item.bone = bone;
                items.Add(item);
            }
            treeNodeDict = new Dictionary<Armature.Bone, TreeNode>();
            TreeNode root = new TreeNode("Dummy");
            treeNodeDict = new Dictionary<Armature.Bone,TreeNode>();
            GroupTreeItems(items, 0, root, treeNodeDict);
            treeRootNodes = new List<TreeNode>();
            foreach (TreeNode node in root.Nodes) {
                treeRootNodes.Add(node);
            }
        }
Code:
        private void AddItem(Item item) {
            checkBoxLockItem.Checked = false;
            comboBoxItem.Enabled = true;
            //checkBoxLockCamera.Checked = false;
            //comboBoxCameraPivot.Enabled = true;

            items.Add(item);
            DataSet dataSet = new DataSet();
            dataSet.item = item;
            Armature.Bone[] bones = item.Model.Armature.Bones;
            List<Armature.Bone> sortedBones = new List<Armature.Bone>();
            foreach (Armature.Bone bone in bones) {
                if (!bone.name.StartsWith("unused")) {
                    sortedBones.Add(bone);
                }
            }
            sortedBones.Sort(CompareBonesByName);
            BuildNodeTree(sortedBones, out dataSet.treeRootNodes, out dataSet.treeNodeDict);
            dataSet.boneTransforms = new BoneTransform[bones.Length];
            for (int i = 0; i < bones.Length; i++) {
                dataSet.boneTransforms[i] = new BoneTransform();
            }
            dataSet.height = 0;
            dataSetDict[item] = dataSet;
            itemDict[item.Model] = item;

            int itemID = GetNextItemID(item);
            string itemTag = item.DirName;
            if (itemID > 1) {
                itemTag += string.Format(" #{0}", itemID);
            }
            comboBoxItem.Items.Add(new ComboBoxItem(itemTag));
            item.Tag = itemTag;

            HandleItemSelectedIn3D(item);
            game.HandleItemAdded(item);
        }
__________________
Link removed. - Why ? google, google “Google is your friend!”

Last edited by XNAaraL; 11-09-12 at 11:59.
XNAaraL is offline   Reply With Quote
Old 11-09-12, 11:59   #20
Cochrane
Golden
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,721
Default

Hm, that is odd. I guess it makes it easy to find a bone, but not very explicit where it is in the transform hierarchy. I might implement this as an alternate mode for the view, if a user wants it, but I don't think this mode should be the only choice.
__________________
Güter auf die Bahn!
Cochrane is online now   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 16:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.