Jump to content




Photo

Baking Gi And Textures For Unity3D


  • This topic is locked This topic is locked
6 replies to this topic

#1 arbalest

arbalest
  • Regular Member
  • 10 posts
  • C4D Version:12 (or older)

Posted 16 July 2012 - 06:02 AM

hey guys,

I just want to ask, I've been trying to follow a tutorial on how to bake a GI and textures and export it for Unity3D, I followed evrything the tutorial said but I'm getting weird black sometimes just gray textures, I'm using C4D R13, I switch back to 11 and got my textures correctly except maybe a reduced lighting, Is there a problem with the baking feature in R13?

and If you'd be so kind to point me to a tutorial that does realistic GI baking to export for Unity it woud be awesome. I've got an architectural visualisation project for a client, and i cant get through the baking process, not even close to fiddling with Unity yet. any help would be much appreciated cheers!

Edited by arbalest, 16 July 2012 - 06:04 AM.


#2 arbalest

arbalest
  • Regular Member
  • 10 posts
  • C4D Version:12 (or older)

Posted 18 July 2012 - 03:18 AM

aw, I reckon no one here knows what I'm talking about, cheers anyway

#3 Mezus

Mezus
  • Regular Member
  • 30 posts
  • C4D Version:13 Studio

Posted 18 July 2012 - 07:59 PM

Hi I do (ish). I have never been able to bake GI in R13. I resort to lighting my scene, and baking AO, Illumination with Shadows and then using photoshop to wang the texture back on the Colour Channel.

Interesting you say it works in R11 - can you post comparison shots and what your render settings were?

#4 Sommerlost

Sommerlost
  • Regular Member
  • 20 posts
  • C4D Version:14 Studio
  • Location: Seattle, WA

Posted 24 July 2012 - 09:13 PM

I'm having similar issues trying to write several attributes to a single file. I get a lot of blank layers and maybe a few results. Everything works fine if I'm baking a single attribute like A.O., but that is going to take forever to composite and babysit the baking that way.

I'll let you know if I find results.

#5 artzfx

artzfx
  • Regular Member
  • 73 posts
  • C4D Version:14 Studio
  • Location: Newscastle, Australia

Posted 24 July 2012 - 11:22 PM

Lightmapping from C4D to Unity does work fine providing you follow some rules. However to be honest, unless you require an extremely defined lightmap that maybe uses IES lights you are fair better to do the lightmapping inside of Unity using their inbuilt BEAST system. You achieve very nice results with it but the workflow is far easier and faster, especially if you need to tweak/change your lighting after importing your scene/models into Unity. BEAST is literally a 1 minute job to redo an existing lightmap in Unity. If you need to redo a lightmap in C4D or any other 3D app to Unity, the workflow becomes cumbersome because you need to reset your Lightmap shaders in Unity. This becomes painful if you need to lightmap many objects with multiple lightmaps. BEAST also has the advantage of easily changing how much space each model is allocated per lightmap, hence objects in the distance can be allocated small amounts of space leaving the majority of the lightmap to provide higher quality lighting for close up objects.

EDIT UPDATE: The following process (albeit tedious) used to work in R12 however I have just tested in R13 and discovered that C4D is no longer exporting multiple Materials per object to Unity again (an issue in R11 I reported to MAXON that was fixed in R12). The two UV channels are still working, however without export of more than one material per object the process fails. See my Unity post on this http://forum.unity3d.com/threads/60761-C4D-to-FBX2010.2-to-Unity-workarounds?highlight=c4d+lightmap


If you still wish to lightmap in C4D to Unity here is how (I used this process prior to BEAST being part of Unity). Use this process at the mercy of MAXON keeping FBX up to date and working (hence why I use BEAST):
1. After applying your base material (can contain bitmap of not) ensure your texture tag is placed to the left of your material in the C4D Object Manager.
2. Create a plain white material RGB = 255, 255, 255 with colour channel activated only
3. Apply this white material to all objects you wish to lightmap (leaving original base materials in place on objects).
4. Search for the "Bake Object" tag in the Customise Pallettes Manager and drag onto your menu or new pallette.
5. Select the objects you wish to bake in the Objects Manager and then click on the "Bake Object" icon to bring up the options for this tool.
6. Check "Illuminate" and "Single Texture" then set supersampling to 1 and leave pixel border as 2, then input the size of the map you want ie, 512x512
7. Click bake
8. You will now see your objects duplicated at the top of the Object list and with a new baked material containing your lightmap in the Luminance channel. Select the texture tag and baked material from each object and drag to the corresponding original object (to the right of the original material on each object). this will mean you now have two texture tags and two material per object/model. Ensure the new texture tag is also placed to the left of the baked material. This will then allow FBX to export out the two UV sets for Unity to recognise.
9. You can now deleted the baked duplicate objects. Note: It doesn't matter which objects you use or drag the texture tags and materials onto as both are identical.
10. In the material manager, select your baked lightmap material and activate the colour channel. Now copy the Luminance channel (lightmap texture) into the Colour channel and deactivate the Luminance channel. Unity/FBX doesn't recognise C4D's Luminance channel.
11. Export to FBX and save the exported file into you Unity project "Assets" folder.
12. In Unity Select your original object base Material and change the Unity shader to Legacy Sahders>Lightmapped>Diffuse
13. Now drag your lightmap into the lightmap texture slot.

Edited by artzfx, 24 July 2012 - 11:29 PM.


#6 Sommerlost

Sommerlost
  • Regular Member
  • 20 posts
  • C4D Version:14 Studio
  • Location: Seattle, WA

Posted 25 July 2012 - 01:31 PM

Thanks for posting that. I was just sitting here calling fowl on R13 myself. It seems Baking Textures is fairly broken at the moment. I can A.O. to bake, I can get some degree of GI or Indirect Illumination to bake. I can turn off GI in my render settings, use the same exact bake command and get the shadows from the GI, but I can't get any of this to render to a baked file together... I hope I'm wrong, but I doubt I am.

#7 Sommerlost

Sommerlost
  • Regular Member
  • 20 posts
  • C4D Version:14 Studio
  • Location: Seattle, WA

Posted 25 July 2012 - 01:55 PM

FYI, I just went and did a few test... thought I'd at least share the results. But yes, it's definitely mangled in R13, took the scene back to R12 and everything worked just fine. Anyhow in R13,

My Baking Preferences Render Settings Bake Results
Illumination No G.I. Shadows and Color Tint Rendered
Illumination G.I. Illumination - no Shadows or Tint
Illumination/A.O. G.I. Illumination - no Shadows or Tint - NO A.O.
Illumination/A.O. No G.I. Shadows and Color Tint Rendered - A.O. Rendered

Thanks God for keeping prior installs of Cinema on this machine.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users