[TUTORIAL]Baking Specular in Blender - SLUniverse Forums
Navigation » SLUniverse Forums > Development Discussion and Support > Tutorials » [TUTORIAL]Baking Specular in Blender


Tutorials A place to share tutorials for content creation and virtual world usage.

 
Reply
 
LinkBack Thread Tools Display Modes
Old 07-07-2009, 01:16 AM   #1 (permalink)
Jack of a few Trades
 
WarKirby Magojiro's Avatar
Happles!
 
Join Date: Sep 2007
Location: Glasgow, Scotland
Posts: 3,496
My Mood:
SL Join Date: 14/10/2006
Business: MagoTek Industries
[TUTORIAL]Baking Specular in Blender

This is something I've written before, but it was buried within another thread, and I've had problems finding it again when I wanted to show people. So I'm reposting it here, mostly for my convenience in linking people to it. But I hope others find it useful too. I wrote this tutorial from scratch, didn't copy it from anywhere.

This is a tutorial on how to bake specular onto a flat texture, in blender. It assumes basic knowledge of blender, so it's not for complete novices. There are other tutorials for basic things.

Specular is the white highlighting that you get when light reflects from a shiny surface. It's an effect that usually only exists in realtime rendering, as it depends on the point of view. Baking it permanantly into a texture can still have quite a striking effect, even if not technically correct. And often looks better than what the pitiful shininess option in SL can produce.

---------------------------------

When I started with blender, I was annoyed at the lack of this functionality.

Turns out, this functionality is already there. It's just so hidden and convoluted that everyone on blenderartists didn't even seem to be aware of it's existence, and gave me all sorts of other even more convoluted and useless suggestions as to how to work around this lack (of a feature that actually is there)

Anyways, It requires material nodes.. The nodes basically work kind of like layers in photoshop, only a bit less simple.

First of all, you want to create our base material. However you want it to look. Then name it "yourmaterial_base" or something similar. I find having base in the name helps. Because when you go to work with the nodes, that won't actually be the material theat's applied to the mesh, instead, it becomes a node in the actual material, which pretty much provides most of the information.

After that, you make the actual material. Just create a new blank material on the object you're working with. That will be the node material. Once you've done that, in the Links and pipeline panel, there's a button marked Nodes. It's not hard to find, but you're probably subconsciously ignored it all the time you've used blender. That creates a node material, which you now have to edit.

Editing node materials requires a special windows, though. So split off a new window somewhere in the work area, or just convert an existing one if you have one spare. Select the windoew type as Node Editor

now, this is where we start needing pictures.



On the right there, is what the node editor window looks like. Node materials are built using this odd flowchart system .Each of the floating boxes is a node. In this case, there are two. The one on the far right is the output. That's where you put the finished result of whatever node editing you're doing. The other one, marked ClLICK THIS, is a material node (not to be confused with a node material). That's an input node, which basically imports an existing material, and can pass on it;'s information to other nodes.

There's a reason why I marked it Click this. In this case, a material node is of no use to you. They're too simple. (yes, really)
So click that node once to select it, and then hit your delete key to get rid of it.

Now you need to replace it. Right click anywhere in the node editor window, and select Add > Input > Extended material

Extended material nodes are functionally almost identical to normal material nodes, they just have more options, including the one we need.

Now, the net step, is to import the base material that you're working from. On the new node you just created, click the little arrows button, next to ADD NEW. And select your material from there. It's now used as an input.

Now, this is where the magic happens. You need to take both the color and specular data from that material, and merge them into one, then feed that into the output.

This picture shows how it's done.


First of all, you can connect nodes by simply clicking and dragging from an ouput (right side of a node) to an input ( left side of a node).

In the picture above, I've added a third node, in between the material and the output. That's called a mix node. You can add one by right clicking in the node editor, and select: Add > Color > Mix

Once you create that node, change it's type from Mix, to Add, because specularity adds light. Just click the arros next to where it says mix. And set the FAC to 1.0 Lower values will make your specular slightly less bright, but I think 1.0 is a good place to start, and tone it down from there if it's too much.

Next, create connections from the Color ouput of the material, to Color1 input on the mix node. And from the Spec output, to Color2. The order of those is very important. If you switch them around, there will be no specular.

Lastly, connect the color output from the mix node, to the color input of the output node.

Now. SAVE YOUR WORK. !!!
Then make sure the node material you've just created is applied to your object, instead of the base material you originally made, and bake it ias normal.

Voila, you have specular baked into the texture. And I have sore hands from typing.
__________________
Quote:
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

-Robert A. Heinlein
WarKirby Magojiro is offline   Reply With Quote
Old 07-07-2009, 01:33 AM   #2 (permalink)
Jack of a few Trades
 
WarKirby Magojiro's Avatar
Happles!
 
Join Date: Sep 2007
Location: Glasgow, Scotland
Posts: 3,496
My Mood:
SL Join Date: 14/10/2006
Business: MagoTek Industries
And now, something I made with it. See attached.

Feel free to post stuff you've made with this technique here.
Attached Thumbnails
[TUTORIAL]Baking Specular in Blender-skull-helmet.jpg  
WarKirby Magojiro is offline   Reply With Quote
Old 07-07-2009, 12:40 PM   #3 (permalink)
Senior Member
 
Aki Shichiroji's Avatar
 
Join Date: Aug 2007
Location: Toronto
Posts: 3,644
My Mood:
SL Join Date: 7/22/2006
Business: Organica

Awards: 1
SLU Creepy Avatar Competition 2014 Participant 
Send a message via Skype™ to Aki Shichiroji
Attached Thumbnails
[TUTORIAL]Baking Specular in Blender-2009-06-13_1645-edit.png  
Aki Shichiroji is offline   Reply With Quote
Old 07-07-2009, 12:45 PM   #4 (permalink)
Senior Member
 
Rev Eponym's Avatar
gazing lovingly into the smoking mirror
 
Join Date: Jul 2007
Location: Dallas, Tejas
Posts: 2,203
My Mood:
SL Join Date: Feb 2006
Send a message via Yahoo to Rev Eponym
Seen this before in that buried link, but...

/me grabs Warkirby, pins the Croix du Blendre on his chest, and gives him a manly kiss on both cheeks.

"Merci, Monsieur!"

.
__________________
"Don't believe everything you think."
Rev Eponym is offline   Reply With Quote
Old 01-31-2010, 05:50 AM   #5 (permalink)
Jack of a few Trades
 
WarKirby Magojiro's Avatar
Happles!
 
Join Date: Sep 2007
Location: Glasgow, Scotland
Posts: 3,496
My Mood:
SL Join Date: 14/10/2006
Business: MagoTek Industries
I asked Cris to move this thread here, as I feel it will be more useful and reach the intended audience. Thank you Cristiano
WarKirby Magojiro is offline   Reply With Quote
Old 05-10-2010, 08:52 AM   #6 (permalink)
Extendable
 
Similar McMillan's Avatar
Lizzard
 
Join Date: Aug 2007
Posts: 2,060
SL Join Date: 2007-02-06
woah, I first got around to trying this now.

Thanks, WarKirby. This certainly makes a difference.
__________________
"I've always assumed I'm one of those people who knows a lot about planes, but I've never actually checked." -xkcd
Similar McMillan is offline   Reply With Quote
Old 05-14-2010, 09:34 PM   #7 (permalink)
Out of here

*SLU Supporter*
 
Pamela Galli's Avatar
Bridges Not Walls
 
Join Date: Sep 2009
Location: Waterloo
Posts: 2,895
My Mood:
SL Join Date: 11-12-2007
Business: La Galleria
Thanks -- someday I want to try this.
__________________
La Galleria
https://marketplace.secondlife.com/stores/19
Pamela Galli is offline   Reply With Quote
Old 09-22-2011, 05:48 PM   #8 (permalink)
Pedantic Geek
 
Maggiedoll Alter's Avatar
 
Join Date: Oct 2010
Location: Maryland
Posts: 3,706
SL Join Date: 1/30/2008
Business: Perception
OMG, I love you!

Sorry for the necro-post.. I found the thread by Googling.
Attached Thumbnails
[TUTORIAL]Baking Specular in Blender-pumps.jpg  
Maggiedoll Alter is offline   Reply With Quote
Old 06-04-2012, 01:03 AM   #9 (permalink)
Junior Member
 
Join Date: May 2011
Posts: 1
Thumbs up

Thank you! I've always wondered how to do this.
Lexicus is offline   Reply With Quote
Old 06-04-2012, 01:54 AM   #10 (permalink)
Had enough
 
Join Date: Mar 2008
Posts: 1,476
My Mood:
Boy, how the heck did I miss this one? I've been wanting to figure out how to do this for ages. Thanks... belatedly.
Loraan Fierrens is offline   Reply With Quote
Old 06-27-2012, 08:11 AM   #11 (permalink)
Banned
 
Join Date: Mar 2011
Location: Pennsylvania
Posts: 1,213
SL Join Date: Jan 2007
This tutorial should be stickied.
bubblesort is offline   Reply With Quote
1 User Agreed:
Old 11-27-2012, 02:24 PM   #12 (permalink)
Just call me Beth
 
Aribeth Zelin's Avatar
Singing along with old music
 
Join Date: Mar 2011
Location: Out in the mists
Posts: 8,897
My Mood:
SL Join Date: Oct 4 2009
Business: Moondrops ; Tempus Fugit; Faerycat Designs; sPunk
Client: Firestorm
Does anyone know if this will work for transparency baking as well?
__________________

Aribeth Zelin is offline   Reply With Quote
Old 09-10-2014, 11:28 PM   #13 (permalink)
Junior Member
here now.
 
Join Date: Sep 2014
Posts: 1
My Mood:
Cool Thanks!

Thanks for outlining the basics of how to do this. There is also a youtube vid ppl might want to check out:
I had comment/ question It seems that even using the spec. function uploading the mesh to SL is still a bit chalky and seems to take a lot of tweaking-are there "known settings" for making a baked texture look good?
Thanks again!
Hekadino carfield is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On




SEO by vBSEO