Procedural Texture Baking

Announcements, requests and support regarding the Blender Indigo export script
Post Reply
10 posts • Page 1 of 1
User avatar
bq1
Posts: 20
Joined: Wed Sep 13, 2006 8:59 am
Location: Leeds, UK
Contact:

Procedural Texture Baking

Post by bq1 » Wed Jan 31, 2007 12:30 pm

Hi, been away for a while, but am back indigoing! :)

I was wondering if anyone else has been doing this (baking Blender's procedural textures onto a UV-mapped image) or am I coming across something that everyone already does?

I just started messing with this today and it appears to work fine. So while it's true that you can't use Blender textures, it does seem fairly elementary to set up your material as you like and then run the "Bake Texture" script in the UV window on your unwrapped UV map, as you would normally in Blender, then moving the resultant file to the Indigo directory. There seems to be slight discrepancies between the Blender/Indigo UV maps, but they're small and probably easy to fix.

Anyone doing this or have any thoughts/advice? I'll post an image in the morning. :)

Again, sorry if this is old news - I did a forum search for 'Bake' and found nothing.

User avatar
Zom-B
1st Place 100
Posts: 4687
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

Post by Zom-B » Wed Jan 31, 2007 6:47 pm

Hey bq1...

Using backed textures for is great, but as long as Animation isn't a Indigo Playground, I strongly prefer to render some effects in Multipass mode...

A Ambient Occlusion, one Depth (for DOF) and sometimes a Global Illumination Layer and Shadow Layer.
Using them to finalize your Indigo Rendered Image gives you much more flexibility, than an "fixed" backed Texture...
polygonmanufaktur.de

User avatar
bq1
Posts: 20
Joined: Wed Sep 13, 2006 8:59 am
Location: Leeds, UK
Contact:

Post by bq1 » Wed Jan 31, 2007 8:28 pm

Thanks for your reply ZomB. Haven't really looked at the finalizing topics you mention but will do. I'm thinking more about getting 'volumetric' textures such as 3D wood and marble, etc. mapped onto complex objects, as UV mapping of such things is wrecking my head. ;).

The below is a little test I did, though I couldn't have picked a worse material. :( (slaps forehead). I should have just made a nice wood or something, but you get the idea. Notice the seams in both the Indigo and Blender UV renders and the slight discrepancy. As I said though, I'm sure this is a small thing to tweak on the map. Also, the colours/shaders would need fiddling with, but I reckon I'll be using this alot.

Image

User avatar
drBouvierLeduc
Posts: 412
Joined: Wed Oct 11, 2006 2:32 am
Location: france

Post by drBouvierLeduc » Wed Jan 31, 2007 9:51 pm

Hi,
I'm very interested by this technique, it could be quite usefull.
Never tried it myself though.
Could you post a quick tutorial with some images, please ?

User avatar
bq1
Posts: 20
Joined: Wed Sep 13, 2006 8:59 am
Location: Leeds, UK
Contact:

Post by bq1 » Wed Jan 31, 2007 10:55 pm

drBouvierLeduc wrote:Hi,
I'm very interested by this technique, it could be quite usefull.
Never tried it myself though.
Could you post a quick tutorial with some images, please ?
No worries. Just give me a little while...

User avatar
drBouvierLeduc
Posts: 412
Joined: Wed Oct 11, 2006 2:32 am
Location: france

Post by drBouvierLeduc » Wed Jan 31, 2007 11:09 pm

No worries. Just give me a little while...
gooooood !

Aardbei
Posts: 19
Joined: Sat Dec 30, 2006 9:24 pm

Post by Aardbei » Thu Feb 01, 2007 12:57 am

About the discrepancies, have you tried using Render Baking from Blender 2.43 instead of the bake script?

User avatar
bq1
Posts: 20
Joined: Wed Sep 13, 2006 8:59 am
Location: Leeds, UK
Contact:

Post by bq1 » Thu Feb 01, 2007 2:12 am

Ok, here goes. I've never written a tutorial before and I'm no expert on UV mapping, God knows! There will no doubt be mistakes and easier ways to do things, so apologies in advance. Please comment... :)

BAKING BLENDER'S PROCEDURAL TEXTURES FOR USE WITH INDIGO

Versions I used:
Blender 2.42
Indigo 0.5
Blender2Indigo Exporter 0.5beta

1. Open blender, delete the default cube and add a UV sphere ([Spacebar] -> Add -> Mesh -> UVSphere). I rotated mine around for a bit so the texture would be more interesting. (I know, texture-rotate, but I cheated...)

2. Now set up a material for it as indicated below (or whatever you like really :) ), by upping the colour to white and adding the two wood textures.

Image

3. Split your screen so you have a 3D window and UV/Image editor visible. In the 3D window switch from 'Object Mode' to 'UV Face Select', making sure your sphere is selected.

Image

4. Press 'a' in the 3D window to select all faces, then in the UV/Image Editor, create a new image (Image -> New...). I used 512x512.

5. Still in the UV/Image Editor window, select the 'Archimap UV Projection Unwrapper' script from the 'UVs' menu. I used the following options:

- Fill in holes (space efficient, slow)
- Unwrap all ... (this won't matter if you selected all the faces)
- ...then just use the defaults for the last two settings.

Image

6. Then select the 'Texture Baker' script from the 'UVs' menu in the UV/Image Editor window. Note: If you use a screen-resolution of 800x600 (like me) you'll have [Ctrl-UpArrow] to maximise that window to access the upper part of the menu. I used the following options:

- No replace
- Size: 512

Image

7. When the UV map renders (and this was an epiphany for me ;) ), press F3 to save it. I called it 'wood-tex.png'.

Image

8. Now that we have an image to work with, we can remove the procedural textures from our sphere. With the sphere selected, go to the Materials pane in the Buttons window and clear the textures out.

Image

9. Now, in the Texture pane, add a new image texture and load in the file we just 'baked'. Doesn't hurt to give the texture a meaningful name. ;).

Image

10. Back in the Materials pane, with the new texture selected, set up the mapping as follows...

Image

11. A quick Blender-render shows us our result. It's not bad, but the seams are visible.

Image

12. If you go back to 'UV Face Select' mode in the 3D window with the sphere selected, select all it's faces, then load the baked image into the UV/Image editor you can see where the problems lie, as below.

Image

13. There are probably various ways of tackling this, but just for now I'm going to move the UV map up a little bit, then do the following to each of the six UV 'areas'.

a) Select a UV point, then press [Ctrl+L] to select the other linked points in that 'area'
b) Hit to scale, then type .995 to scale it down just a teeny bit.
c) Hit [Enter] to apply the scale.

Image

14.
That's a bit better! Ok, so now let's export to Indigo in the usual way and render to see what happens. BEFORE YOU START THIS make sure that you've copied the baked image to the Indigo directory, and if you have trouble with it not rendering the texture, try converting the file to a JPG instead of PNG, remembering to change the relevant texture path in the XML. I had to do this so be prepared for it.

I ended up with the image below

Image

You can still clearly see the seams, but with tweaking I'm sure they could be overcome. Maybe scaling those 'areas' by .995 was a bit light-handed, or perhaps there's an tiny offset between Blender and Indigo?

I suppose you could also create some nice bump maps using this technique too. I'll be playing with it for a while, no doubt. :) Anyways, time for coffee.

@Aardbei:
Haven't used that, but will check it out, thanks!

User avatar
drBouvierLeduc
Posts: 412
Joined: Wed Oct 11, 2006 2:32 am
Location: france

Post by drBouvierLeduc » Thu Feb 01, 2007 2:55 am

excellent !
Thanks a lot
(You should copy this thread to the tutorials section)

User avatar
bq1
Posts: 20
Joined: Wed Sep 13, 2006 8:59 am
Location: Leeds, UK
Contact:

Post by bq1 » Thu Feb 01, 2007 3:33 am

drBouvierLeduc wrote:excellent !
Thanks a lot
(You should copy this thread to the tutorials section)
Cheers! :) Will do that.

Post Reply
10 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests