Damn, and i thought my issues with FMOD Designer where complicated.....lol. Sorry guys, But i am eager to see how this will work. Don't give in just yet!!
Brian has emailed me some files, I've not had a chance to look at them just yet I have an exam to go to, but soon!
I quickly opened the .dae and .model files in the model viewer to find... an untextured cube and a .dae the viewer couldn't parse properly... ###### my life.
Here are the files Brian gave to me that I still can't even get the textures to show up: <a href="http://filesmelt.com/dl/testbox.rar" target="_blank">http://filesmelt.com/dl/testbox.rar</a>
I should clarify, I can't get them to show up when I re-compile the model, regardless of where I put them. Perhaps the builder is out of date?
This still an issue ? Aside from the textures not working you should not have to do anything outside setup the proper folders and export from sketchup to te Collada format. If you guys need an example setup I would be more than happy to provide one. As I tested this against about 20 or so different sektchup models in the latest version of sketchup and they all were able to export and show up in the editor.
<!--quoteo(post=1856013:date=Jun 24 2011, 09:11 AM:name=wacko)--><div class='quotetop'>QUOTE (wacko @ Jun 24 2011, 09:11 AM) <a href="index.php?act=findpost&pid=1856013"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->This still an issue ? Aside from the textures not working you should not have to do anything outside setup the proper folders and export from sketchup to te Collada format. If you guys need an example setup I would be more than happy to provide one. As I tested this against about 20 or so different sektchup models in the latest version of sketchup and they all were able to export and show up in the editor.<!--QuoteEnd--></div><!--QuoteEEnd-->
Getting them to show up untextured isn't the problem, i've been trying all sorts thinking textures would work and i was doing something wrong, i didn't realise that textures didn't work at all, why is that?
I think the thread has turned into a bit of a general model and texture troubleshooting thread for freely available tools, i've been trying to find a setup that works with tools like blender and sketchup for models, paint.net and gimp for textures, so far we've had problems with one thing or another, i thought for sure blender would work but models don't even show and there's no texture tag in the collada to change after export, there's also the issue of creating the proper format paintshop or .dds images for textures, i've been testing with textures taken from other in game models so far.
This really has to be possible with free tools otherwise most of us won't be able to model anything new for our maps.
All of mine have been dds (I lack photoshop, but I can export DDS files). The issue is the builder, for some reason it doesn't export models with textures. Even the files Brian supplied me with did not export correctly. I think the public builder is out of date or broken.
Yeah i just it tested as well using the same testbox while following the above info exactly, the model works and all the files were built but it's still untexture in the viewer and editor.
Earlier I somehow managed to import models with custom textures using GIMP and Blender so I decided to try the same using SketchUp and GIMP. To my surprise I was successful. Here are a few things I noticed:
- You can export the dds files yourself rather than let the Builder handle them. You just need the DDS plugin installed: ( DDS Plugin: <a href="http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop" target="_blank">Photoshop</a>, <a href="http://code.google.com/p/gimp-dds/" target="_blank">GIMP</a> )
- It appears that SketchUp by defaults exports .dae files with 'lambert' shading, whereas Blender exports them with 'phong'. I think changing 'lambert' to 'phong' was the last fix I had to make before the textures started to show. The shading method can be found in the .dae file and it is the child element of library_effects/effect/profile_COMMON/technique/. Maybe a dev can confirm this bug?
- After exporting .dae from SketchUp it has to be edited. Library_images/image/init_from must be changed to the name of the texture file, eg. <init_from>box.dds</init_from>
I will post more detailed walkthrough later today and maybe we can check if the instructions in ns2 wiki need to be updated?
I hope any of this helped.
edit: I think normal maps can also be added by editing the .dae file. I'll try that out. If it works I think I'll switch to SketchUp. :D
Amazing it actually works, seriously big thanks for this perso, these problems have been going on for far too long now so it's great someone finally got it working, i just can't believe all it took was a change to the shading tag, hopefully a dev can fix it so we don't have to edit?
I've now tested a few files and noticed one had 'blinn' instead of 'lambert', i also just realised you have to have a material file for every texture, not one material file per model, at least that's what it seems to ask for, i was only testing a simple box and texture before, all with the same name, so i didn't know until i moved onto more complex models with more than one texture.
I still don't know much about blender but when i followed a quick tutorial on texturing and exported the collada there was no 'library_images' tag to edit, also the model didn't even show up in the viewer untextured?
A tutorial on how to get all this working without much trouble would be great, thanks again!
Kouji_SanSr. Hινε UÏкεεÏεг - EUPT DeputyThe NetherlandsJoin Date: 2003-05-13Member: 16271Members, NS2 Playtester, Squad Five Blue
<!--quoteo(post=1856860:date=Jun 28 2011, 08:35 AM:name=perso)--><div class='quotetop'>QUOTE (perso @ Jun 28 2011, 08:35 AM) <a href="index.php?act=findpost&pid=1856860"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I will post more detailed walkthrough later today and maybe we can check if the instructions in ns2 wiki need to be updated?<!--QuoteEnd--></div><!--QuoteEEnd--> Awesome, you could also expand upon <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Building_Models" target="_blank">the wiki.</a> It has nicer format options for a walktrough/tutorial
Just found another problem, some models look fine in sketchup but after exporting the collada and making the usual edits, the textures show but are misaligned and messed up, is there anything i can do to fix them or is it just another bug?
<!--quoteo(post=1856890:date=Jun 28 2011, 09:35 AM:name=Kouji_San)--><div class='quotetop'>QUOTE (Kouji_San @ Jun 28 2011, 09:35 AM) <a href="index.php?act=findpost&pid=1856890"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Awesome, you could also expand upon <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Building_Models" target="_blank">the wiki.</a> It has nicer format options for a walktrough/tutorial<!--QuoteEnd--></div><!--QuoteEEnd-->
Agreed, I have to think about doing that. Below is what I've got so far. I didn't include instructions for setting up the Builder because they were already covered pretty nicely in the wiki.
Edit: The white CODE format boxes made my eyes bleed, so I changed them to quotes, sorry folks! For anyone who is interested, here are the files that I used to make the test box model: <a href="http://koti.mbnet.fi/tazu/pub/ns2/ns2_models.zip" target="_blank">ns2_models.zip</a>
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Importing models with custom textures using Builder<!--sizec--></span><!--/sizec-->
For the purpose of this tutorial I built a simple six sided box named "box". For your own model you can just substitute "box" with your model's name.
These are the files that we need to build the model. Put them in directory [source_dir]/modelsrc/props/[your_map_name]/, where [source_dir] is the source directory that you specified in Builder's settings.
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->[model_name].model_compile (needed to build model, see part 3) [model_name].material (specified model's material, see part 3) [model_name].dds (texture for the model, see part 1) [model_name].dae (the model itself, see part 2)<!--QuoteEnd--></div><!--QuoteEEnd-->
<b>Tools used in this tutorial:</b> - GIMP 2.6.11 with DDS Plugin (http://www.gimp.org/) (http://code.google.com/p/gimp-dds/) - Google SketchUp 8.0.4811
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->1. Create a custom texture in GIMP<!--sizec--></span><!--/sizec-->
NS2 uses DDS (DirectDraw Surface) file format for storing game textures. One way to convert your textures to .dds format is to save them as either .psd or .tga and throw them into Builder's source directory. Builder should then take care of the conversion automatically and place the files in correct directories. You might opt for this option if you are using photoshop to create your textures. In this tutorial I use the .dds plugin to export my textures directly from GIMP as .dds.
A few requirements to note:
- The image should be saved as DXT5 RGBA 8bit Interpolated Alpha. In GIMP this is done by selecting in the save dialog: <i> * Format: RGBA8</i> <i> * Compression: BC3/DXT5</i> - In GIMP, when saving the image as .dds select "Generate mipmaps" - Texture dimensions must be in power of 2 (64, 128, 256, 512, etc) For example 64x128 and 512x512 are proper dimension for texture. (not completely sure about this one, but better safe than sorry)
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->2. Create a custom model in SketchUp<!--sizec--></span><!--/sizec-->
In SketchUp, after you have created your model the first thing to do is to assign materials to it. This is done simply by using the Paint Bucket tool (B). In my case I just selected the whole box and clicked a material in the Select tab of the Materials window. After you have assigned material(s) to your object you can switch to Material window's Edit tab, check "Use texture image" and choose a texture image. SketchUp doesn't seem to support loading .dds files so you have to convert your image to .png or some other format SketchUp can read.
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->3. Build the model<!--sizec--></span><!--/sizec-->
See <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Getting_Started_-_Setting_up_the_Spark_Builder" target="_blank">The NS2 wiki</a> for instructions on how to configure Builder for building game assets if you haven't. The .dae file you exported from SketchUp should contain lines like these:
Note: if you have trouble getting textures to show up on your model after build, try to change the shading tag in your .dae file to 'phong': <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->... <technique sid="COMMON"> <phong> <diffuse> <texture texture="ID7" texcoord="UVSET0" /> </diffuse> </phong> ...<!--QuoteEnd--></div><!--QuoteEEnd-->
.model_compile and .material files should look like this
If your model has same uv coordinates for both diffuse and normal maps, then you can just reuse those coordinates. In the example we have lines like this: <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><texture texture="ID7" texcoord="UVSET0" /> ... <texture texture="Normal_ID_3" texcoord="UVSET0"/><!--QuoteEnd--></div><!--QuoteEEnd-->
Where "UVSET0" refers to the UV coordinates specified elsewhere in the .dae file.
<!--quoteo(post=1856892:date=Jun 28 2011, 09:38 AM:name=Magneto)--><div class='quotetop'>QUOTE (Magneto @ Jun 28 2011, 09:38 AM) <a href="index.php?act=findpost&pid=1856892"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Just found another problem, some models look fine in sketchup but after exporting the collada and making the usual edits, the textures show but are misaligned and messed up, is there anything i can do to fix them or is it just another bug?<!--QuoteEnd--></div><!--QuoteEEnd-->
I don't know much about SketchUp and how it handles UV Mapping. Perhaps you can UV map your models in for example Blender (there are tutorials for that)?
<!--quoteo(post=1856966:date=Jun 28 2011, 04:15 PM:name=Magneto)--><div class='quotetop'>QUOTE (Magneto @ Jun 28 2011, 04:15 PM) <a href="index.php?act=findpost&pid=1856966"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Another thing, how do you stop the lighting making all the model surfaces look curved, is it something to do with specular and normal textures?<!--QuoteEnd--></div><!--QuoteEEnd-->
Beats me. My box also has some lighting related issues... First of all, no matter how high radius the point light has, it still makes sharp edged shadows. Secondly there are these jagged edges. <img src="http://koti.mbnet.fi/tazu/pub/ns2/img/box3.png" border="0" class="linked-image" />
<!--quoteo(post=1856986:date=Jun 28 2011, 10:38 PM:name=perso)--><div class='quotetop'>QUOTE (perso @ Jun 28 2011, 10:38 PM) <a href="index.php?act=findpost&pid=1856986"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I don't know much about SketchUp and how it handles UV Mapping. Perhaps you can UV map your models in for example Blender (there are tutorials for that)?
Beats me. My box also has some lighting related issues... First of all, no matter how high radius the point light has, it still makes sharp edged shadows. Secondly there are these jagged edges. <img src="http://koti.mbnet.fi/tazu/pub/ns2/img/box3.png" border="0" class="linked-image" /><!--QuoteEnd--></div><!--QuoteEEnd-->
I wonder if that colladamax.dle works for 3DS Max 2010 (or 2011, I can't remember which I have). It would save me a lot of headaches. Now I just need to sort out what's going wrong with my builder that means it can't compile valid DAEs.
Wanted to share something I worked on during the past 2 days. <img src="http://i53.tinypic.com/qqsciw.jpg" border="0" class="linked-image" /> This welder was inspired by the one from the Alien movies <img src="http://www.yourprops.com/norm-4c79b05c163b4-Aliens%20(1986).jpeg" border="0" class="linked-image" /> Some detail could still be added to it and it looks so box like so I want to make some of the edges curvy and smooth looking but I dont know how as I am new to sketchup and I am still learning. Feedback is welcomed.
-EDIT- Did some minor changes on it. <img src="http://i56.tinypic.com/s5zbcg.jpg" border="0" class="linked-image" />
So I never really got any information back on as to what is not working? Aside from the texture issue is the basic ability to export from sketchup and compile a model still not working... if so can someone send me a model and compile file and I can take a look at this... It should not be too hard to fix if I have a broken example.
<!--quoteo(post=1861840:date=Jul 20 2011, 09:25 AM:name=wacko)--><div class='quotetop'>QUOTE (wacko @ Jul 20 2011, 09:25 AM) <a href="index.php?act=findpost&pid=1861840"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So I never really got any information back on as to what is not working? Aside from the texture issue is the basic ability to export from sketchup and compile a model still not working... if so can someone send me a model and compile file and I can take a look at this... It should not be too hard to fix if I have a broken example.<!--QuoteEnd--></div><!--QuoteEEnd-->
I think the model part is working ok with sketchup, blender though may be another issue as i've had no luck using that.
I think the main fix id like to see is the builder recognising incorrect shading tags so we don't have to edit, at the moment we have to change 'blinn' or 'lambert' to 'phong' to get textures working.
<!--quoteo(post=1856860:date=Jun 28 2011, 09:35 AM:name=perso)--><div class='quotetop'>QUOTE (perso @ Jun 28 2011, 09:35 AM) <a href="index.php?act=findpost&pid=1856860"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- It appears that SketchUp by defaults exports .dae files with 'lambert' shading, whereas Blender exports them with 'phong'. I think changing 'lambert' to 'phong' was the last fix I had to make before the textures started to show. The shading method can be found in the .dae file and it is the child element of library_effects/effect/profile_COMMON/technique/. Maybe a dev can confirm this bug?<!--QuoteEnd--></div><!--QuoteEEnd-->
Im not sure what was wrong, i tried exporting a simple model but nothing showed up in the viewer, i didn't play around with it beyond that as i don't know enough about it, if it works for you than i wouldn't worry about it.
Will there be a fix for the different shading tags used?
I know you were mainly interested in the model side of things but without working textures the models are useless anyway.
So I made a change to enable the lambert tags to work correctly... something to remember is that you need to define textures and not colors and you should not need to change the blinn to phong either as I am pretty sure that works correctly. This change will not be out until the next patch which should be sometime soon.
Yeah, thanks a lot wacko! I think the only real problem I encountered was with those shading tags in collada file.
Now what I really would like to see in the future would be more accurate error messages. Maybe there could some kind of validation step in the build process that would warn the user if there were some errors in the model file or textures. For example, it could warn of missing alpha channel etc.
Also would it be possible in the future to add some sort of scripting support to the builder? One could for example automate generation of overview or to copy for example self exported dds files to materials directories.
Then again these are only suggestions in case you're going to make updates to the builder. :)
BTW. how about sticky Brian's model importing guide? <a href="http://www.unknownworlds.com/ns2/news/2011/7/ns2_custom_model_importing_guide" target="_blank">http://www.unknownworlds.com/ns2/news/2011...importing_guide</a> I just remembered I have yet to watch it and had a hard time finding it because it's missing from the news archive. I will add link to ns2 wiki later if it's not already there.
<!--quoteo(post=1864554:date=Jul 29 2011, 12:12 PM:name=perso)--><div class='quotetop'>QUOTE (perso @ Jul 29 2011, 12:12 PM) <a href="index.php?act=findpost&pid=1864554"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Yeah, thanks a lot wacko! I think the only real problem I encountered was with those shading tags in collada file.
Now what I really would like to see in the future would be more accurate error messages. Maybe there could some kind of validation step in the build process that would warn the user if there were some errors in the model file or textures. For example, it could warn of missing alpha channel etc.
Also would it be possible in the future to add some sort of scripting support to the builder? One could for example automate generation of overview or to copy for example self exported dds files to materials directories.
Then again these are only suggestions in case you're going to make updates to the builder. :)
BTW. how about sticky Brian's model importing guide? <a href="http://www.unknownworlds.com/ns2/news/2011/7/ns2_custom_model_importing_guide" target="_blank">http://www.unknownworlds.com/ns2/news/2011...importing_guide</a> I just remembered I have yet to watch it and had a hard time finding it because it's missing from the news archive. I will add link to ns2 wiki later if it's not already there.<!--QuoteEnd--></div><!--QuoteEEnd--> Just search Unknownworlds on youtube and you can find it in their channel's upload.
Comments
I quickly opened the .dae and .model files in the model viewer to find... an untextured cube and a .dae the viewer couldn't parse properly... ###### my life.
<a href="http://filesmelt.com/dl/testbox.rar" target="_blank">http://filesmelt.com/dl/testbox.rar</a>
I should clarify, I can't get them to show up when I re-compile the model, regardless of where I put them. Perhaps the builder is out of date?
Getting them to show up untextured isn't the problem, i've been trying all sorts thinking textures would work and i was doing something wrong, i didn't realise that textures didn't work at all, why is that?
I think the thread has turned into a bit of a general model and texture troubleshooting thread for freely available tools, i've been trying to find a setup that works with tools like blender and sketchup for models, paint.net and gimp for textures, so far we've had problems with one thing or another, i thought for sure blender would work but models don't even show and there's no texture tag in the collada to change after export, there's also the issue of creating the proper format paintshop or .dds images for textures, i've been testing with textures taken from other in game models so far.
This really has to be possible with free tools otherwise most of us won't be able to model anything new for our maps.
Actually more specificly this is your common texture issue: The Library_Images tag in the DAE file.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> <library_images>
<image id="testbox.psd" name="testbox_psd">
<init_from>./testbox.psd</init_from>
</image>
</library_images>
<library_materials><!--c2--></div><!--ec2-->
becomes
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> <library_images>
<image id="testbox.dds" name="testbox_psd">
<init_from>./testbox.dds</init_from>
</image>
</library_images>
<library_materials><!--c2--></div><!--ec2-->
Actually more specificly this is your common texture issue: The Library_Images tag in the DAE file.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> <library_images>
<image id="testbox.psd" name="testbox_psd">
<init_from>./testbox.psd</init_from>
</image>
</library_images>
<library_materials><!--c2--></div><!--ec2-->
becomes
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> <library_images>
<image id="testbox.dds" name="testbox_psd">
<init_from>./testbox.dds</init_from>
</image>
</library_images>
<library_materials><!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->
All of mine have been dds (I lack photoshop, but I can export DDS files). The issue is the builder, for some reason it doesn't export models with textures. Even the files Brian supplied me with did not export correctly. I think the public builder is out of date or broken.
Earlier I somehow managed to import models with custom textures using GIMP and Blender so I decided to try the same using
SketchUp and GIMP. To my surprise I was successful. Here are a few things I noticed:
- You can export the dds files yourself rather than let the Builder handle them. You just need the DDS plugin installed:
( DDS Plugin: <a href="http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop" target="_blank">Photoshop</a>, <a href="http://code.google.com/p/gimp-dds/" target="_blank">GIMP</a> )
- It appears that SketchUp by defaults exports .dae files with 'lambert' shading, whereas Blender exports them with 'phong'.
I think changing 'lambert' to 'phong' was the last fix I had to make before the textures started to show. The shading method can be found in the .dae file
and it is the child element of library_effects/effect/profile_COMMON/technique/. Maybe a dev can confirm this bug?
- After exporting .dae from SketchUp it has to be edited. Library_images/image/init_from must be changed to the name of the texture file,
eg. <init_from>box.dds</init_from>
I will post more detailed walkthrough later today and maybe we can check if the instructions in ns2 wiki need to be updated?
I hope any of this helped.
edit: I think normal maps can also be added by editing the .dae file. I'll try that out. If it works I think I'll switch to SketchUp. :D
I've now tested a few files and noticed one had 'blinn' instead of 'lambert', i also just realised you have to have a material file for every texture, not one material file per model, at least that's what it seems to ask for, i was only testing a simple box and texture before, all with the same name, so i didn't know until i moved onto more complex models with more than one texture.
I still don't know much about blender but when i followed a quick tutorial on texturing and exported the collada there was no 'library_images' tag to edit, also the model didn't even show up in the viewer untextured?
A tutorial on how to get all this working without much trouble would be great, thanks again!
Awesome, you could also expand upon <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Building_Models" target="_blank">the wiki.</a> It has nicer format options for a walktrough/tutorial
Agreed, I have to think about doing that. Below is what I've got so far. I didn't include instructions for setting up the Builder because
they were already covered pretty nicely in the wiki.
Edit: The white CODE format boxes made my eyes bleed, so I changed them to quotes, sorry folks!
For anyone who is interested, here are the files that I used to make the test box model: <a href="http://koti.mbnet.fi/tazu/pub/ns2/ns2_models.zip" target="_blank">ns2_models.zip</a>
<!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->Importing models with custom textures using Builder<!--sizec--></span><!--/sizec-->
For the purpose of this tutorial I built a simple six sided box named "box".
For your own model you can just substitute "box" with your model's name.
These are the files that we need to build the model. Put them in directory
[source_dir]/modelsrc/props/[your_map_name]/, where [source_dir] is the source
directory that you specified in Builder's settings.
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->[model_name].model_compile (needed to build model, see part 3)
[model_name].material (specified model's material, see part 3)
[model_name].dds (texture for the model, see part 1)
[model_name].dae (the model itself, see part 2)<!--QuoteEnd--></div><!--QuoteEEnd-->
<b>Tools used in this tutorial:</b>
- GIMP 2.6.11 with DDS Plugin (http://www.gimp.org/) (http://code.google.com/p/gimp-dds/)
- Google SketchUp 8.0.4811
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->1. Create a custom texture in GIMP<!--sizec--></span><!--/sizec-->
NS2 uses DDS (DirectDraw Surface) file format for storing game textures.
One way to convert your textures to .dds format is to save them as either
.psd or .tga and throw them into Builder's source directory. Builder should
then take care of the conversion automatically and place the files in correct
directories. You might opt for this option if you are using photoshop
to create your textures. In this tutorial I use the .dds plugin to export my
textures directly from GIMP as .dds.
A few requirements to note:
- The image should be saved as DXT5 RGBA 8bit Interpolated Alpha. In GIMP this is done by selecting in the save dialog:
<i> * Format: RGBA8</i>
<i> * Compression: BC3/DXT5</i>
- In GIMP, when saving the image as .dds select "Generate mipmaps"
- Texture dimensions must be in power of 2 (64, 128, 256, 512, etc) For example 64x128 and 512x512 are
proper dimension for texture. (not completely sure about this one, but better safe than sorry)
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->2. Create a custom model in SketchUp<!--sizec--></span><!--/sizec-->
In SketchUp, after you have created your model the first thing to do is to
assign materials to it. This is done simply by using the Paint Bucket tool (B).
In my case I just selected the whole box and clicked a material in the Select
tab of the Materials window. After you have assigned material(s) to your
object you can switch to Material window's Edit tab, check "Use texture image"
and choose a texture image. SketchUp doesn't seem to support loading .dds files
so you have to convert your image to .png or some other format SketchUp can read.
<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->3. Build the model<!--sizec--></span><!--/sizec-->
See <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Getting_Started_-_Setting_up_the_Spark_Builder" target="_blank">The NS2 wiki</a> for instructions
on how to configure Builder for building game assets if you haven't.
The .dae file you exported from SketchUp should contain lines like these:
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><library_images>
<image id="ID5">
<init_from>box.dds</init_from>
</image>
</library_images>
<library_effects>
<effect id="ID4">
<profile_COMMON>
<newparam sid="ID6">
<surface type="2D">
<init_from>ID5</init_from>
</surface>
</newparam>
<newparam sid="ID7">
<sampler2D>
<source>ID6</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<diffuse>
<texture texture="ID7" texcoord="UVSET0" />
</diffuse>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<input offset="1" semantic="TEXCOORD" source="#ID11" />
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" /><!--QuoteEnd--></div><!--QuoteEEnd-->
Note: if you have trouble getting textures to show up on your model after build, try to change the shading tag in your .dae file
to 'phong':
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->...
<technique sid="COMMON">
<phong>
<diffuse>
<texture texture="ID7" texcoord="UVSET0" />
</diffuse>
</phong>
...<!--QuoteEnd--></div><!--QuoteEEnd-->
.model_compile and .material files should look like this
<b>box.model_compile</b>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><model>
<geometry "box.dae" />
<materials_path "models/props/test" />
<scale 1.0 />
</model><!--QuoteEnd--></div><!--QuoteEEnd-->
<b>box.material</b>
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><material>
<maps>
<map type="texture" value="models/props/test/box.dds" />
</maps>
<properties>
<property type="surface" value="metal" />
</properties>
</material><!--QuoteEnd--></div><!--QuoteEEnd-->
<b><!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo-->4. Adding normal maps<!--sizec--></span><!--/sizec--></b>
For normal maps, following changes must be made to the .dae file (changes highlighted in bold):
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><library_images>
<image id="ID5">
<init_from>box.dds</init_from>
</image>
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><b> <image id="Normal_ID_1">
<init_from>box_normal.dds</init_from>
</image></b><!--colorc--></span><!--/colorc-->
</library_images><!--QuoteEnd--></div><!--QuoteEEnd-->
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><library_effects>
<effect id="ID4">
<profile_COMMON>
<newparam sid="ID6">
<surface type="2D">
<init_from>ID5</init_from>
</surface>
</newparam>
<newparam sid="ID7">
<sampler2D>
<source>ID6</source>
</sampler2D>
</newparam>
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><b> <newparam sid="Normal_ID_2">
<surface type="2D">
<init_from>Normal_ID_1</init_from>
</surface>
</newparam>
<newparam sid="Normal_ID_3">
<sampler2D>
<source>Normal_ID_2</source>
</sampler2D>
</newparam></b><!--colorc--></span><!--/colorc-->
<technique sid="COMMON">
<phong>
<diffuse>
<texture texture="ID7" texcoord="UVSET0" />
</diffuse>
</phong>
<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><b> <extra>
<technique profile="FCOLLADA">
<bump>
<texture texture="Normal_ID_3" texcoord="UVSET0"/>
</bump>
</technique>
</extra></b><!--colorc--></span><!--/colorc-->
</technique>
</profile_COMMON>
</effect>
</library_effects><!--QuoteEnd--></div><!--QuoteEEnd-->
If your model has same uv coordinates for both diffuse and normal maps, then
you can just reuse those coordinates. In the example we have lines like this:
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><texture texture="ID7" texcoord="UVSET0" />
...
<texture texture="Normal_ID_3" texcoord="UVSET0"/><!--QuoteEnd--></div><!--QuoteEEnd-->
Where "UVSET0" refers to the UV coordinates specified elsewhere in the .dae file.
Sources:
<a href="http://www.unknownworlds.com/forums/index.php?showtopic=108304" target="_blank">http://www.unknownworlds.com/forums/index....howtopic=108304</a>
<a href="http://www.unknownworlds.com/ns2/wiki/index.php/Importing_Custom_Textures" target="_blank">http://www.unknownworlds.com/ns2/wiki/inde...Custom_Textures</a>
<a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Building_Textures" target="_blank">http://www.unknownworlds.com/ns2/wiki/inde...ilding_Textures</a>
edit: cleaning up this mess..
I don't know much about SketchUp and how it handles UV Mapping. Perhaps you can UV map your models in for example Blender (there are tutorials for that)?
<!--quoteo(post=1856966:date=Jun 28 2011, 04:15 PM:name=Magneto)--><div class='quotetop'>QUOTE (Magneto @ Jun 28 2011, 04:15 PM) <a href="index.php?act=findpost&pid=1856966"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Another thing, how do you stop the lighting making all the model surfaces look curved, is it something to do with specular and normal textures?<!--QuoteEnd--></div><!--QuoteEEnd-->
Beats me. My box also has some lighting related issues... First of all, no matter how high radius the point light has, it still makes sharp edged shadows.
Secondly there are these jagged edges.
<img src="http://koti.mbnet.fi/tazu/pub/ns2/img/box3.png" border="0" class="linked-image" />
Beats me. My box also has some lighting related issues... First of all, no matter how high radius the point light has, it still makes sharp edged shadows.
Secondly there are these jagged edges.
<img src="http://koti.mbnet.fi/tazu/pub/ns2/img/box3.png" border="0" class="linked-image" /><!--QuoteEnd--></div><!--QuoteEEnd-->
I wonder if that colladamax.dle works for 3DS Max 2010 (or 2011, I can't remember which I have). It would save me a lot of headaches. Now I just need to sort out what's going wrong with my builder that means it can't compile valid DAEs.
<img src="http://i53.tinypic.com/qqsciw.jpg" border="0" class="linked-image" />
This welder was inspired by the one from the Alien movies
<img src="http://www.yourprops.com/norm-4c79b05c163b4-Aliens%20(1986).jpeg" border="0" class="linked-image" />
Some detail could still be added to it and it looks so box like so I want to make some of the edges curvy and smooth looking but I dont know how as I am new to sketchup and I am still learning.
Feedback is welcomed.
-EDIT-
Did some minor changes on it.
<img src="http://i56.tinypic.com/s5zbcg.jpg" border="0" class="linked-image" />
So any news on what the devs are up to, like any fixes or improvements coming?
I think the model part is working ok with sketchup, blender though may be another issue as i've had no luck using that.
I think the main fix id like to see is the builder recognising incorrect shading tags so we don't have to edit, at the moment we have to change 'blinn' or
'lambert' to 'phong' to get textures working.
<!--quoteo(post=1856860:date=Jun 28 2011, 09:35 AM:name=perso)--><div class='quotetop'>QUOTE (perso @ Jun 28 2011, 09:35 AM) <a href="index.php?act=findpost&pid=1856860"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- It appears that SketchUp by defaults exports .dae files with 'lambert' shading, whereas Blender exports them with 'phong'.
I think changing 'lambert' to 'phong' was the last fix I had to make before the textures started to show. The shading method can be found in the .dae file
and it is the child element of library_effects/effect/profile_COMMON/technique/. Maybe a dev can confirm this bug?<!--QuoteEnd--></div><!--QuoteEEnd-->
Will there be a fix for the different shading tags used?
I know you were mainly interested in the model side of things but without working textures the models are useless anyway.
Now what I really would like to see in the future would be more accurate error messages. Maybe there could some kind of validation step in the build process that would warn the user if there were some errors in the model file or textures. For example, it could warn of missing alpha channel etc.
Also would it be possible in the future to add some sort of scripting support to the builder? One could for example automate generation of overview or to copy for example self exported dds files to materials directories.
Then again these are only suggestions in case you're going to make updates to the builder. :)
BTW. how about sticky Brian's model importing guide? <a href="http://www.unknownworlds.com/ns2/news/2011/7/ns2_custom_model_importing_guide" target="_blank">http://www.unknownworlds.com/ns2/news/2011...importing_guide</a>
I just remembered I have yet to watch it and had a hard time finding it because it's missing from the news archive. I will add link to ns2 wiki later if it's not already there.
Now what I really would like to see in the future would be more accurate error messages. Maybe there could some kind of validation step in the build process that would warn the user if there were some errors in the model file or textures. For example, it could warn of missing alpha channel etc.
Also would it be possible in the future to add some sort of scripting support to the builder? One could for example automate generation of overview or to copy for example self exported dds files to materials directories.
Then again these are only suggestions in case you're going to make updates to the builder. :)
BTW. how about sticky Brian's model importing guide? <a href="http://www.unknownworlds.com/ns2/news/2011/7/ns2_custom_model_importing_guide" target="_blank">http://www.unknownworlds.com/ns2/news/2011...importing_guide</a>
I just remembered I have yet to watch it and had a hard time finding it because it's missing from the news archive. I will add link to ns2 wiki later if it's not already there.<!--QuoteEnd--></div><!--QuoteEEnd-->
Just search Unknownworlds on youtube and you can find it in their channel's upload.