Reply
Reply
 
Thread Tools Display Modes
fearian's Avatar
Old (#1)
So I've been spending the weekend getting to grips with the material editor and I'm finding it mind boggling how many expressions there are and all the cool things I can do with it.

Naturally I have some questions

For starters, how would I go about making a texture mirror repeat across an axis? eg:



Also, How would you create a parameter to control the intensity of a normal map?
Finally, what does a LERP actually do? What on earth is Linear Enterpo..lation..?


Also, I think it would be nice to have a general material editor thread* to liven up the forum a bit, so I'd love to hear any cool tips or setup's you guys found out!

*Rename thread, 'How u node dem mats'
Offline , dedicated polycounter, 1,610 Posts, Join Date Oct 2008, Location UK Send a message via Skype™ to fearian  
   Reply With Quote

Xendance's Avatar
Old (#2)
To increase normal maps' strength via a parameter, create a 3-vector parameter and then plug it into multiply node. Also plug the normal map into the multiply node. Then in the parameter (or edit the instance of the material) type numbers 2, 2, 0.5 (for example) into the RGB values. That should intensify it.

LERP I think is just used to blend two textures together based on the alpha input.
Offline , triangle, 377 Posts, Join Date May 2010,  
   Reply With Quote

moose's Avatar
Old (#3)
for your mirroring, will the texture tile?

Within the texture properties (double click your texture), you can set it to CLAMP (edge pixels repeat for infinity), WRAP (default tiling), or MIRROR, which will flip the texture on every tile. You can set this on X and Y individually, so you can wrap Y and mirror X if need be.

If you just want to flip it in the material itself, and only want to flip X, multiply a Texture Coordinate node by a 2 vector constant, and plug the multiply into the UV of the texture. Remember R = X, G = Y, if you put -1 in the R(x) slot, it should flip it.

Linerar interpolate (LERP) nodes blend two textures based on an alpha. If you put a red color in A, and a blue color in B, you can blend between those two colors based on the value of the alpha slot. a single vector constant in the alpha set to .5 should look kinda purply i'd assume, and 1 & 0 would toggle between the values hooked into A and B.

The alpha slot must be one dimensional, ie, it needs to either be a single vector constant, or a channel of an image - masked either by using a Component Mask node, or dragging a channel into the alpha.
Offline , card carrying polycounter, 2,300 Posts, Join Date Oct 2004, Location Cary, NC Send a message via ICQ to moose Send a message via AIM to moose Send a message via MSN to moose  
   Reply With Quote

divi's Avatar
Old (#4)
Quote:
Originally Posted by moose View Post
for your mirroring, will the texture tile?

Within the texture properties (double click your texture), you can set it to CLAMP (edge pixels repeat for infinity), WRAP (default tiling), or MIRROR, which will flip the texture on every tile. You can set this on X and Y individually, so you can wrap Y and mirror X if need be.
ooh nice, didnt even think to it like that.

messed around a bit to do it in the material itself but if he only wants to use the texture mirrored doing it in the properties is certainly preferable.



by changing the values in the constant2 vector with 1,1 the x and y tiling can be changed.
Offline , polycounter, 866 Posts, Join Date Jan 2009,  
   Reply With Quote

haiddasalami's Avatar
Old (#5)
This will become your friend or atleast I've been consulting it a lot. Now that I've been learning HLSL it's actually great to understand what the hell a dot product is, light vectors, eye vectors, matrixes and how to use them. Still more to learn, and been recently reading a lot of whitepapers on how games approach their shading.

Whoops missed the link :P

http://udn.epicgames.com/Three/MaterialsCompendium.html
WebGL Project - In a state of constant flux so might be down when you check it. Pretty old now.
Junior Technical Artist at Digital Extremes.
Offline , dedicated polycounter, 1,859 Posts, Join Date Nov 2009, Location Toronto  
   Reply With Quote

r_fletch_r's Avatar
Old (#6)
haiddasalami: how're you finding all the 'funky' math? (im still getting over mikes hat from the last lecture)
Offline , veteran polycounter, 2,970 Posts, Join Date Feb 2010, Location Ireland  
   Reply With Quote

haiddasalami's Avatar
Old (#7)
Quote:
Originally Posted by r_fletch_r View Post
haiddasalami: how're you finding all the 'funky' math? (im still getting over mikes hat from the last lecture)
I was watching it on the bus and my friend kept commenting on his hat Liking it so far but definitely had to go back and review it. Which reminds me, there's probably a new class up. His hat better be twice as awesome
WebGL Project - In a state of constant flux so might be down when you check it. Pretty old now.
Junior Technical Artist at Digital Extremes.
Offline , dedicated polycounter, 1,859 Posts, Join Date Nov 2009, Location Toronto  
   Reply With Quote

moose's Avatar
Old (#8)
OT but, Divi: You can make the texture you using as a mask there in the material editor itself, no need to extra textures! Its a little more complex than adding a texture, but allows you do get clean masks without using a texture. The Append Vector stuff isn't really necessary, but I added it just to show it produces the same result

Offline , card carrying polycounter, 2,300 Posts, Join Date Oct 2004, Location Cary, NC Send a message via ICQ to moose Send a message via AIM to moose Send a message via MSN to moose  
   Reply With Quote

JordanW's Avatar
Old (#9)
this may also help learn materials:

http://udn.epicgames.com/Three/MaterialsTutorial.html
Jordan Walker
ART BLOG
CGHUB
Twitter
Offline , dedicated polycounter, 1,437 Posts, Join Date Oct 2004, Location Cary, NC Send a message via ICQ to JordanW  
   Reply With Quote

divi's Avatar
Old (#10)
ah, yes tried that at first too, but forgot the ceil and thus gave me very obvious errors in the center. thanks for sharing that, will keep it in mind for future stuff
Offline , polycounter, 866 Posts, Join Date Jan 2009,  
   Reply With Quote

ImSlightlyBored's Avatar
Old (#11)
Quote:
Originally Posted by moose View Post
OT but, Divi: You can make the texture you using as a mask there in the material editor itself, no need to extra textures! Its a little more complex than adding a texture, but allows you do get clean masks without using a texture. The Append Vector stuff isn't really necessary, but I added it just to show it produces the same result
to expand on this just use

custom float2
return round(gradient.xy);

where gradient is your gradient(s) for example texcoord node. If you were doing 3 gradients make it float 3 etc etc.

this just keeps it real tidy

edit: stupid me, didn't see that you also want to move it. oh well, maybe that will be helpful anyway. You can move it with a little pre-work on your gradients before round, and then saturate the entire result to get rid of nasty results.
Attached Images
File Type: jpg word.jpg (44.6 KB, 14 views)

Last edited by ImSlightlyBored; 07-27-2010 at 05:28 AM..
VFX Artist
2011 Reel
Offline , polygon, 679 Posts, Join Date Aug 2007, Location London, UK  
   Reply With Quote

JordanW's Avatar
Old (#12)
keep in mind Custom node isn't a good idea for production use, it prevents code side optimization of the material down stream from the node. Having said that it's a great prototyping/own time tool
Jordan Walker
ART BLOG
CGHUB
Twitter
Offline , dedicated polycounter, 1,437 Posts, Join Date Oct 2004, Location Cary, NC Send a message via ICQ to JordanW  
   Reply With Quote

Brice Vandemoortele's Avatar
Old (#13)
FYI: lerp(A,B, C) is basically

A * (1-C) + B * C
(which is pretty much alpha blending made into a function, where the background is A, the texture is B and its alpha is C)

a more advanced version is smoothstep(), which gives a non-linear interpolation (lerp sands for linear interpolation) where the slope at 0 and 1 is 0:

float smoothstep (float edge0, float edge1, float x)
{
x = saturate((x - edge0) / (edge1 - edge0));
return x*x*(3-2*x);
}

http://en.wikipedia.org/wiki/Smoothstep
Offline , triangle, 309 Posts, Join Date Jan 2005, Location Belgium Send a message via Skype™ to Brice Vandemoortele  
   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

Forum Jump

Copyright 1998-2012 A. Risch