Digital Art Zone

 
     
Creating a custom Shader Mixer brick?
Posted: 12 March 2013 08:17 PM   [ Ignore ]
Active Member
Avatar
RankRank
Total Posts:  380
Joined  2007-05-27

Lately I have been finding the need for a few more bits of code than Shader Mixer provides. I’ve managed to make a few macros with Shader Builder or edit some in notepad++ to do what I want.

There is one very simple function I can’t seem to get to work as a macro in Shader Mixer.

%1% is the string input node of the macro

float isMap = 0;
if (%1% != “”)  { isMap = 1; }

then have the output result isMap 0 or 1.

This is so I can turn off displacement in Shader Mixer when no displacement map is loaded. Plugging an image string brick into %1% works for other macros.

What has me confused is that if I do something similar in a .sl it works in 3delight or if I do it in Shader Builder it works. If I export the macro from Shader Builder I get no if function, only an in and an out. I guess I need to manually edit the <evaluate> line in the macro but nothing I put in there seems to work.

Sorry this is so remedial but I only speak a few coding languages and am an novice or VERY rusty with all of them. I’m getting a handle on RSL but getting it into DS is confusing the hell out of me hehe.

Is there an easier or better way of making Shader Mixer bricks than Shader builder Macros?

 Signature 

My DAZ Products
My 3d freebies
My YouTube Page

Profile
 
 
Posted: 12 March 2013 09:30 PM   [ Ignore ]   [ # 1 ]
Addict
Avatar
RankRankRankRank
Total Posts:  4545
Joined  2007-09-13
Age of Armour - 12 March 2013 08:17 PM

Is there an easier or better way of making Shader Mixer bricks than Shader builder Macros?

I was wondering the same thing…

 Signature 

1432 old posts

My ShareCG gallery.

Just because something costs a lot, doesn’t mean it’s the best…

It just means it’s expensive.

Profile
 
 
Posted: 23 March 2013 07:53 PM   [ Ignore ]   [ # 2 ]
New Member
Total Posts:  1
Joined  2009-06-14

Hi, I don’t know if it helps but I think functions are easier than macros. There’s just one pane of code in the shader builder, and it usually needs to contain just one C-like function, which makes it easier for me to to see how things go together and probably also means there’s less that can go wrong. There’s no <evaluate> line, the function just returns what you tell it to.

Profile