Following on from my SunBurn session for the TechDays event in march, I am following up with a few short snippets for how to get started and troubleshooting.
Feel free to add comments to this post for further suggestions in the use of tools as an input to Blender.
if you want to learn more about SunBurn or the SunBurn editor, i suggest you visit their site and even check out the excellent video series about the editor. Also there is the YouTube channel you can subscribe to for more of the editor tutorial videos.
Anyway enough of this preamble and on with the show, I’ve decided to do this one in two flavours the video here and the write of it below:
So the video above shows you all the steps, here’s a bit more.
Requirements for SunBurn
In getting started with any modelling tool when you are using SunBurn you just need to work out what it is you need populated in the model in order to make it work, this also depends on which platforms you intend to deploy on:
- Windows & XBOX
- Properly rigged objects
- Named Materials (useful in editor)
- UV Mapped textures (or just a base UV map if you are texturing in SunBurn)
- Animation (if required)
- Windows Phone
- Everything for Windows / XBOX – plus
- Second uniquely mapped UV Channel
I’m not going to cover all the different permutations of these, were just going to keep it basic for this example.
**Update
It’s noted on the latest release of the SunBurn engine that in future we not need a second lightmap channel for models, so for now this second UV channel technique is needed.
It’s not clear however yet if this will be the case for the Phone in the future, time will tell
Getting set-up
So for the basic example (as shown in the video) we are going to take the most basic object (a cube), texture it, UV map it and then export it for use in SunBurn, then to finish off we will import it into the SunBurn editor.
So after starting Blender you should be presented with the default scene:
Now to make our lives easier (and take advantage of one of the new features in the new blender) we are going to split our main viewport so we can see both the model and the texture/UV mapping we are going to use.
Simply drag left from the top right hand corner of the main viewport. This will create a second viewport we can use for the separate view |
So now you should have a two pane view, model on the left and image area to the right:
Next we’ll generate the texture you wish to use on our model (as stated before you could simply use an existing texture like a crate design or such), In the UV Image window simply click on the “+ New” button and give it some detail and select a colour, then click “OK”:
Before we continue, it is recommended to save both the current model and the texture we just created in their respective folders, Model to one folder and the Texture to a separate “Texture” folder under the same structure, thus:
Getting to the meaty bit
So now whisking through (beating the eggs as it were, not that I have anything against eggs of course ), we need to define the UV map of the object and assign a texture to it.
I will point out that I am just creating a basic texture through Blender, you could of course use a more complicated texture from elsewhere or even use several textures mapped around the object.
So first switch to “Edit mode” using the selector toward the lower left portion of the screen (A) and then use the “Mesh” menu (if you do not see Mesh it is because you have not selected “Edit mode” to select “UV Unwrap –> Smart Project” (B).
Note that our texture has now disappeared, this is simply because we have created a new UV layer, we just need to state which texture the layer is intending to use. Because we selected it earlier, by clicking on the picture icon next to the image name you will see a list of known textures to pick from, just select ours. |
If you are using an existing image and skipped the texture creation / selection section earlier, you can just select “Image –> Open” at this point to assign it as well. Note if your image is a single face, then simply use a different UV Unwrap mode to paint your object properly. This will not affect the next steps.
That done and you should now see your image with the UV Overlay. So now we need to take this and assign the texture to the model.
So now our texture is mapped to our model, next we need to check and change the material properties, mainly so it is represented correctly in SunBurn.
Swap to the “Material” tab in the properties window:
Making sure you have the correct material selected (if you have multiple materials) then change the name of the material to something a bit more meaningful and hit “enter”, this is what you will see in the SunBurn Editor should you wish to apply different materials to objects there (you might have a generic Box model and several crate textures for example)
I also find it useful to also click on the “Assign” button here, it just affirms that the selected material is applied to the model.
Now for the important bit
So far we have done everything as normal as you would do if you are just using models for XNA, now we need to enhance our model so that we can use light maps against it in SunBurn.
First switch to the “Object Data” tab in the properties window
Now you should have two UV maps for your model, one textured and one not, just click on each to see the effect.
With that done Save everything (just to be sure), once done we just need to export the model.
Now I mention the “XNA FBX Exporter” script in the video, reason being this script is incompatible with SunBurn, it is useful for normal XNA projects (it sets up a load of defaults specific to XNA like bounding volumes and a few other settings used by the content pipeline, it even now comes as default with the latest Blender builds, no need to install it separately) but SunBurn doesn’t like it. So just use the Normal “Autodesk FBX” exporter to save your model (into the models folder) and you are done.
Where to go from here
I’m not going to detail here how to import a model in to the SunBurn engine, it’s covered in the video for completeness, but you are better heading over to the Official training videos on the SunBurn site, specifically this one if you need to know now.
Done
Right I'm done for now, I am going to follow up with two other snippets, but just as videos this time to show some common troubleshooting tips for issues I found common when learning all this stuff, namely:
Why is the Lightmap option Disabled in the Editor
Why is my lighting not working correctly, it’s all white
These took a little while and a few questions in the Forums to solve, which is the best place to go to get help by the way (Just search first!!!)
Ta ta
Comments and queries welcome
Excellent tutorial. I was wondering how to use multiple materials.
ReplyDeleteI'm a bit disappointed and surprised that the Blender to XNA fbx exporter does not work with Sunburn. I did not know that Sunburn used their own fbx importer! What results do you get?
Have you tried the Release Candidate version 2.57 of Blender?
By the way, I am the author of the modified Python script but I don't use Sunburn.
I'm not sure what it is about the Blender XNA exporter that throws off the SunBurn Editor.
ReplyDeleteBut something extra in the FBX file seems to really throw off models generated by it, they become drastically reduced in size and are unmanageable by the editor.
SO I had to resort to the native FBX exporter available.
Perhaps a post in the SunBurn forums might sort this out so that users can get the benefits of what the Exporter gives, or possibly an extra script to use features of Blender in SunBurn. Possibilities possibilities ;-)
As for the materials, it took some time to figure out exactly which option or setting was needed to pass through the materials through to SunBurn, but the practice is fairly simple.
In edit mode just select the portions of the model you want to assign the material to and click assign. In the video I just selected the entire model, but you can just select certain faces (or points even in some cases) to create separate effects.
If it would be useful, I'll do a separate video on that.
Oh and thanks for the tip for 2.57. I've been a bit out of the loop for the Blender updates recently.
ReplyDeleteAlthough it's still not available from the main Blender.org site?, lol
I use Vertex groups a lot when UV unwrapping. I assume that would work well with the matrial assignment.
ReplyDeleteA short video might be useful because it was not obvious to me as a novice that when UV unwrapping or with the materials that you can do that for individual or groups of faces. I think that gets the best results.
Thanks
OK, I'll see what I can do for another snippet.
ReplyDeleteWill most likely do two, one with a downloaded model and one with a crafted model to mimic what is being used in the other tutorial videos on the SunBurn site (The tunnel)