| |
| Tutorials A place to share tutorials for content creation and virtual world usage. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) | |
| Jack of a few Trades ![]() ![]() ![]() ![]()
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:
| |
| | |
| 14 Users Said Thanks : |
| |
| | #2 (permalink) |
| Jack of a few Trades ![]() ![]() ![]() ![]()
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. |
| | |
| | #4 (permalink) |
| Senior Member ![]() ![]() ![]()
gazing lovingly into the
smoking mirror
Join Date: Jul 2007 Location: Dallas, Tejas
Posts: 2,200
My Mood: SL Join Date: Feb 2006
Business: MadScience Laboratories | 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!" .
__________________ MadScience Laboratories: Theoretical and applied fetish research The MadScience Blog, unsafe for any workplace. Magnetic soundtrack shielding currently untested. |
| | |
| | #5 (permalink) |
| Jack of a few Trades ![]() ![]() ![]() ![]()
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 |
| | |
| | #6 (permalink) |
| Extendable ![]() ![]()
Lizzard
Join Date: Aug 2007
Posts: 876
SL Join Date: 2007-02-06 | woah, I first got around to trying this now. Thanks, WarKirby. This certainly makes a difference.
__________________ "The need to be observed and understood was once satisfied by God. Now we can implement the same functionality with data-mining algorithms." -Morpheus, Deus Ex |
| | |
| | #7 (permalink) |
| infp ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() *SLU Supporter* ![]() ![]() ![]()
Having Fun
Join Date: Sep 2009
Posts: 2,290
My Mood: SL Join Date: 11-12-2007
Business: La Galleria
| Thanks -- someday I want to try this.
__________________ Traditional and Contemporary American and European Prefab Homes, Dining Rooms, Kitchens, Bedrooms, and Living Rooms LA GALLERIA |
| | |
| | #8 (permalink) |
| Pedantic Geek ![]() ![]() ![]() Join Date: Oct 2010 Location: Maryland
Posts: 1,868
My Mood: SL Join Date: 1/30/2008
Business: Perception | OMG, I love you! Sorry for the necro-post.. I found the thread by Googling. |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
| |