0
Completed

Equivalent to UDK Constant Bias Scale

Jonathan Lefebvre 10 years ago updated by Freya Holmér (Developer) 10 years ago 3
Hi,

I actually try to make your MatCap demo, but unfortunately I'm stuck with the node to add on the UV slot of the MatCap texture.
It seems to be an "Add" node, but SF doesn't let me connect the Add node to the UV slot.

Thankfully to a Polycount user who have a workaround, I can put the add node to the uv slot of my texture, but it is really weird don't you think ?

In fact the calculation we need for that is an equivalent to the ConstantBiasSquale.
Multiply by a value to scale and then add the bias or something like that. (I'm not really a good mathematician. ;-) I see that there will be a new remap range node in the next build.

Good night to you and good luck.

Answer

Answer
Completed
Yeah, the remap does exactly what ConstantBiasScale does, except that you type in the start/end for both the initial and the output range, which should be a bit more intuitive. Internally, the Remap Range node does the math and converts the number to a multiply and an add :)

How did your setup that didn't work look though?
Answer
Completed
Yeah, the remap does exactly what ConstantBiasScale does, except that you type in the start/end for both the initial and the output range, which should be a bit more intuitive. Internally, the Remap Range node does the math and converts the number to a multiply and an add :)

How did your setup that didn't work look though?
Like the Polycount guy said, I put the multiply in the first "add" slot and then a UV Coordinate in the second slot. Then I connect the add to the UV of the texture. I disconnect the UV coordinate node and replace by the 0.5 value.
Message from GlynnSmith on Polycount :

[...] I'd tried using the Add node to plug into the UV input of the 2D texture node, but it wasn't letting me. I'd drag it, but the connection line would disappear.

Then I got the idea of using a UV Co-ord node, which plugged in. Then I plugged the UV Co-ord into my Add node, which also worked. Then I plugged my original shader tree back into the Add node and it all worked.

TL;DR - I had to plug in a UV Co-ord node into the UV input of the 2D Texture node in order for it to let me input anything else in my shader tree.
Ah, that's probably just because it hadn't evaluated its output type yet. Texture2D expects a two-component input. If you give it a pending input, it will reject it. This should perhaps change, I'll have a look at this behaviour at some point :)