|
Post by Vourllez on May 9, 2013 11:40:51 GMT -5
.:Code Center:.
Yay codes! This is basically going to explain all the "How do you make a preset glow/scroll/etc etc" questions, so pay attention. And please, make sure you actually know how to get a preset to work before you attempt to use these.
Glow First up, glowing presets and markings. There are a few different ways to get a preset to glow. One way is to add the scene_blend add code to your preset's codes. This code goes above texture_unit, so it should look like this:
material CharacterMat/BodyMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 scene_blend add texture_unit { texture CharacterBodyTex.jpg tex_address_mode wrap filtering trilinear } } } }
This code makes the entire preset glow, which isn't going to be what you're looking for if you want, say, just glowing markings.
No, for glowing markings you are going to need a much more complex code, and two different textures. First, the textures. You need one that's normal, as if you were just making a plain preset. Then you need a whole new texture, a transparent one with the appropriate colored marks where the markings should go. Save them both in your preset folder. I usually pick names for the images that are easy to remember. Example, if the main image was CharacterBodyTex.jpg then I'd name the glow image CharacterBodyGlowTex.png. You know, something like that. It's just easier. (Notice that .jpg format does not support transparency, so your glow layer needs to be a .png.)
Now, for the code. This code is basically a fill in blank here:
material CharacterMat/BodyMat { technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterBodyTex.jpg } } pass { emissive 1.0 1.0 1.0 scene_blend alpha_blend texture_unit { texture CharacterBodyGlowTex.png } } } }
I used CharacterBodyTex.jpg and CharacterBodyGlowTex.png, you just replace those with your image's names. And, provided you used this code correctly, your markings should now glow. It may be hard to notice in sunny places, so I suggest going somewhere darker. Like First Cave.
One last thing about this code. The emissive line. That is basically what color the glow is. Normally leaving it at 1.0 1.0 1.0 is alright, but if you really wanted to, you can change this. Here are a few basic colors for you:
1.0 0.0 0.0 -Red 0.0 1.0 0.0 -Green 0.0 0.0 1.0 -Blue 1.0 1.0 0.0 -Yellow 0.0 1.0 1.0 -Cyan/Bright Blue 1.0 0.0 1.0 -Pink
|
|
|
Post by Vourllez on May 9, 2013 12:02:24 GMT -5
Scroll -This works for meshes and presets, and this just makes the texture flow across the entire thing, or, if you wanted, you could restrict the flow to a certain spot, and have it be a certain color. For this example, and all examples to follow, I will be using presets. Let's get started.
Go to your material file, and open it in notepad. You'll have the basic codes, which look something like this:
material CharacterMat/EyeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.050000 0.050000 0.050000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterEyeTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/BodyMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterBodyTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/ManeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterManeTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TeethMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.050000 0.050000 0.050000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture teethTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/HeadMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterHeadTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TailMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterTailTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/WingMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterWingTex.png tex_address_mode wrap filtering trilinear } } } }
I recommend that, like this code above, you change all your image formats to .png. It's just easier to work with materials that way. Now, to get your textures to scroll, all you need to do is add the line: scroll_anim 1.0 1.0 underneath the texture names, like so:
material CharacterMat/EyeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.050000 0.050000 0.050000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterEyeTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } } material CharacterMat/BodyMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterBodyTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } } material CharacterMat/ManeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterManeTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TeethMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.050000 0.050000 0.050000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture teethTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } } material CharacterMat/HeadMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterHeadTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TailMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterTailTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } } material CharacterMat/WingMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterWingTex.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } } } }
Now, this will probably create a very weird looking preset, but might be okay on a mesh. However, you can choose to restrict the flow, and have it be any texture you want. How you ask? Well, by layering it of course! Now, if you've ever tried to make layers on an image and use it in IT, it probably didn't work all that well. However, it is possible to layer images onto presets/meshes, using the material coding.
Let's get started.
Open your material and start with the basic coding again, but with .png formats again also.
material CharacterMat/EyeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.050000 0.050000 0.050000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterEyeTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/BodyMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterBodyTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/ManeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterManeTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TeethMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.050000 0.050000 0.050000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture teethTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/HeadMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterHeadTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TailMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterTailTex.png tex_address_mode wrap filtering trilinear } } } } material CharacterMat/WingMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterWingTex.png tex_address_mode wrap filtering trilinear } } } }
Now, we'll need two textures here. 1, your preset's actual texture:
and 2, the texture that will be scrolling. Normally, one picks a gradient to be scrolling:
Get your two textures and then come back. ____________________________________________
Back? Okie. Well, I'mma have to send you away again real quick. What you need to do now, is get your preset's actual texture, and take your /eraser/ tool, to make the markings, the place where you want the scrollyness to go. :3
So go do that if you dun have it done. ____________________________________________
Back again? Okay. Now it's time to layer it in with the coding. Go to your code, and replace it with this one:
material CharacterMat/EyeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterEyeTex.png colour_op alpha_blend } texture_unit { texture CharacterEyeTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } } material CharacterMat/BodyMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterBodyTex.png colour_op alpha_blend } texture_unit { texture CharacterBodyTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } } material CharacterMat/ManeMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterManeTex.png colour_op alpha_blend } texture_unit { texture CharacterManeTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TeethMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterTeethTex.png colour_op alpha_blend } texture_unit { texture CharacterTeethTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } } material CharacterMat/HeadMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterHeadTex.png colour_op alpha_blend } texture_unit { texture CharacterHeadTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } } material CharacterMat/TailMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterTailTex.png colour_op alpha_blend } texture_unit { texture CharacterTailTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } } material CharacterMat/WingMat { receive_shadows on technique { pass { ambient 1.000000 1.000000 1.000000 1.000000 diffuse 1.000000 1.000000 1.000000 1.000000 specular 0.010000 0.010000 0.010000 1.000000 emissive 0.000000 0.000000 0.000000 1.000000 cull_hardware none cull_software none texture_unit { texture CharacterScroll.png scroll_anim 1.0 1.0 tex_address_mode wrap filtering trilinear } texture_unit { texture CharacterWingTex.png colour_op alpha_blend } texture_unit { texture CharacterWingTex.png colour_op_ex blend_current_alpha src_texture src_current tex_address_mode wrap filtering trilinear } } } }
Now you may need to do some manual editing with the image names, because you wouldn't have selected the same names as me. But once you have everything pieced together, you should end up with a pretty nice result. :3
(PREVIEW COMING SOON)
Now, the line scroll_anim 1.0 1.0 can be edited. The numbers can be changed to even negative integers. Just to create some other effects. :3 First number controls speed along X axis, second number controls speed along Y axis. To rotate, you'll need to rotate the image.
|
|
|
Post by Vourllez on May 9, 2013 12:31:51 GMT -5
This animation tutorial does NOT belong to me. Full credit goes to our loved member xRubyx. Thank yew fluff!
If you have any questions please ask below or in the help section of the froum. Thanks~
|
|