Texture/ Lightmap Baking...
-
I posted this in the main forum, but it should probably go in here as well...
Okay, it's a bit of a kludge...
I've been messing around with texture and lightmap baking in my favourite renderer, Cheetah3D...
Then I thought, what if I re-imported the texture maps back into SketchUp? And this is the result...
Here's a video: http://uk.youtube.com/watch?v=h3Mp3eHtGLw
(The YouTube compression makes the shadow quality a little hard to see, but you get the point...)
The workflow in Cheetah is, choose your mesh, 'bake' its texture...you get a UV-unwrapped, rendered texture map of your surface with all shadows, caustics, etc on there... you then simply re-apply the unwrapped, baked texture in your material's Colour channel. Because it's UV mapped, it wraps itself perfectly back around the geometry.
Of course, It only works for flat surfaces when you re-import these maps into SU...you have to cut out the relevant portion from the baked texture map in an image editor, so you often don't end up with a particularly high res texture map (cf. floor texture (low-res) & Balcony floor texture (high-res))...
But this got me thinking... What if SU could bake & wrap its own shadows & textures? The shadows would then simply exist as part of the surface's material definition. Is this amenable to the Ruby approach? The speed increase you get in rendering animations is phenomenal: that 46-sec video on YouTube rendered in around eight minutes -- about 5-6 times faster than if you rendered it with OpenGL shadows.
And we'd get rid of the flickering shadow problem...
(I realise this won't work if the sun has to move in your animation)
-
That would be brilliant if possible!
-
-
Simple. Could a Ruby script be written that would automate the shadow map baking on a material-by-material basis?
-
Hi Tim, long time no see! Where have you been?
-
isn't that exactly what Lightup does? I am not sure, didn't find the time to work with it yet. but I believe that this is the idea behind adams plugin.
-
@gaieus said:
Hi Tim, long time no see! Where have you been?
Gaieus -- I've been translating a book on Adrian Frutiger's Typefaces (from German into English...zzzzzz). Seriously, it's taken up the last six months. And i'm still proofreading...
pp -- I think LightUp is more of real-time, semi-photoreal solution , but it looks like Podium can do this photorealistically. That's cool.
-
Tim,
Would it not be possible to do this with a normal-mapping utility, like xNormal? Export a textured and mapped 3DS from SU, bring it into xNormal, do the magic, and then re-export it to SU as a 3DS again? I found this program months ago, and I haven't had a chance or reason to try this, as no one requires animations of me. An alternative might be Crazybump.
I know these programs can bake bump maps and textures, but I'm not sure about shadows.
It looks like xNormal could be used for rendering on its own, and it's free...Windows only...I'll download it and give it a shot this afternoon.
Results: the rather confusing xNormal manual (178 pages of technical jargon and slightly strange grammar!) calls what Tim is trying to do with baked-in shadows and textures "dark mapping." However, it didn't like any model I currently could throw at it to try it out...I kept getting out of RAM errors. In any case, xNormal is only designed to generate the maps...it can't apply them to the model, so I would have had to resort to some other programs anyway if it didn't crash. The primary purpose of this utility is to create (from a high-poly model with multiple detailed maps) a normal-map (a single bitmap produced by combining textures, bumps, ambient occlusion, etc. into one file) suitable for simulating detail on a low-poly copy of that original model. I could see this being useful in a system of bringing low-poly copies of high-poly models into SketchUp without blowing up the file size, but I don't really do this often enough to struggle with it now.
-
Lewis --
I'll have to look at XNormal more closely...interesting. Although their website is a train wreck.
PP -- It looks like LightUp will do what I want...I've been in touch with Adam...it needs to calculate the lighting first, but it's real-time after that.
But my question was about doing it with SketchUp's own shadows, to speed up animations. The pre-calculation should be faster. It seems like such an obvious feature. However, if LightUp can deliver the goods with animation...
Advertisement