Hi! I'm trying to bias a gradient in VEX.
I've checked the bias node in a vop to see its vex code and it looks like this:
bias = vop_bias(age1, 0.5);
But when I type bias in vex, nothing magical happens… it doesn't seam to recognize bias as a function.
(I'm very new to VEX)
-Olivier
VEX bias function?
7261 14 1- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- sepu
- Member
- 419 posts
- Joined: Feb. 2012
- Offline
- sepu
- Member
- 419 posts
- Joined: Feb. 2012
- Offline
- BabaJ
- Member
- 2041 posts
- Joined: Sept. 2015
- Offline
Or make your own bias.
Help on vop_bias states how they calculate the value:
Help on vop_bias states how they calculate the value:
The Bias VOP is based on Perlin’s section in Texture & Modeling, and is currently only used in some of the older materials.
The basic process is to take:
result = amount / ( ((1/value) - 2) * (1 - amount) + 1);
Where value is the Input, and amount is the Bias.
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- mestela
- Member
- 1738 posts
- Joined: May 2006
- Offline
- jsmack
- Member
- 7771 posts
- Joined: Sept. 2011
- Offline
- anon_user_37409885
- Member
- 4189 posts
- Joined: June 2012
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
mestela: Thanks for the example but I was looking for a simple float value that I would stamp later on.
jsmack: I have no idea what you are talking about. Don't forget I'm a super noob in houdini. I just started.
fuos: Thanks! Your example sounds like what I'm looking for. I'll check it out as soon as I can.
-Olivier aka super-noob
jsmack: I have no idea what you are talking about. Don't forget I'm a super noob in houdini. I just started.
fuos: Thanks! Your example sounds like what I'm looking for. I'll check it out as soon as I can.
-Olivier aka super-noob
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- tamte
- Member
- 8555 posts
- Joined: July 2007
- Offline
- RyuKu
- Member
- 171 posts
- Joined: Oct. 2016
- Offline
Hello
I meet this recommendation by jsmack for the second time
but don't understand - how we use it?
just read it as a text document or we somehow call this info from Houdini?
is this #include - explanation/ additional information to the help docs?
i'm nervous and afraid that can't figure out something important
in this topic e.g.
for vop bias node it's written so in help docs >
result = amount / ( ((1/value) - 2) * (1 - amount) + 1);
Where value is the Input, and amount is the Bias.
in voplib >
float
vop_bias(float base, bias)
{
float val;
if (base <= 0)
val = 0;
else if (base >= 1)
val = 1;
else
val = bias / (((1.0 / base) - 2) * (1 - bias) + 1);
return val;
}
and how tamte realized from this how it should look like?
feel lost and don't understand how to take sense from it
would be great if someone can point/ explain
I meet this recommendation by jsmack for the second time
but don't understand - how we use it?
just read it as a text document or we somehow call this info from Houdini?
is this #include - explanation/ additional information to the help docs?
i'm nervous and afraid that can't figure out something important
in this topic e.g.
for vop bias node it's written so in help docs >
result = amount / ( ((1/value) - 2) * (1 - amount) + 1);
Where value is the Input, and amount is the Bias.
in voplib >
float
vop_bias(float base, bias)
{
float val;
if (base <= 0)
val = 0;
else if (base >= 1)
val = 1;
else
val = bias / (((1.0 / base) - 2) * (1 - bias) + 1);
return val;
}
and how tamte realized from this how it should look like?
feel lost and don't understand how to take sense from it
would be great if someone can point/ explain
Edited by RyuKu - Feb. 28, 2018 14:28:45
- tamte
- Member
- 8555 posts
- Joined: July 2007
- Offline
voplib.h is just a library/module containing the functions
by doingyou are including all the functions from within that library to your code
so then just simply calling the functionwould be able to find it and execute
it's like importing functions from a module in Python without a namespace:which will enable to directly call included functions
by doing
#include <voplib.h>
so then just simply calling the function
@P.y = vop_bias(@P.x, 0.25);
it's like importing functions from a module in Python without a namespace:
from somemodule import *
Edited by tamte - Feb. 28, 2018 14:49:37
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- RyuKu
- Member
- 171 posts
- Joined: Oct. 2016
- Offline
tamte
if we don't write #include <xxx.h> above the code - Houdini doesn't look inside this library (and wrangle e.g. with your example gives a mistake saying i call undefined function), and if we do - we tell him to go to the mentioned library to find information about code executing?
how do you understand you need to call this? you knew that formula's contained there? you've read it as a text document? we can write the same without #include but longer or for some functions we need to use only this way?
for Python with this code we tell to import everything from module from lib/ standard library? or you mean something else i miss? it's awfully i didn't touch it for a couple of weeks though it's so taking and maybe i tell something absolutely incorrect, but
should be written seems differently with
cause it doesn't do the same, or maybe i tell about something wrong and without needed understaning
if we don't write #include <xxx.h> above the code - Houdini doesn't look inside this library (and wrangle e.g. with your example gives a mistake saying i call undefined function), and if we do - we tell him to go to the mentioned library to find information about code executing?
how do you understand you need to call this? you knew that formula's contained there? you've read it as a text document? we can write the same without #include but longer or for some functions we need to use only this way?
for Python with this code we tell to import everything from module from lib/ standard library? or you mean something else i miss? it's awfully i didn't touch it for a couple of weeks though it's so taking and maybe i tell something absolutely incorrect, but
import random return(random.random())
from random import *
- tamte
- Member
- 8555 posts
- Joined: July 2007
- Offline
Ryu Kuas I mentioned
tamte
if we don't write #include <xxx.h> above the code - Houdini doesn't look inside this library (and wrangle e.g. with your example gives a mistake saying i call undefined function), and if we do - we tell him to go to the mentioned library to find information about code executing?
how do you understand you need to call this? you knew that formula's contained there? you've read it as a text document? we can write the same without #include but longer or for some functions we need to use only this way?
for Python with this code we tell to import everything from module from lib/ standard library? or you mean something else i miss? it's awfully i didn't touch it for a couple of weeks though it's so taking and maybe i tell something absolutely incorrect, butshould be written seems differently withimport random return(random.random())cause it doesn't do the same, or maybe i tell about something wrong and without needed understaningfrom random import *
from random import *
import random print(random.random())
from random import * print(random())
from random import random print(random())
however I would not generally recommend importing functions without namespace in Python
however VEX doesn't support namespaces, so #include imports functions to the main body and potentially causes conflicts, that's why some functions in supporting .h libraries have pretty creative names, like even all voplib are prefixed with vop_ to lessen the chance of conflicts, not very elegant
anyway, how you can find out
just do something in Attrib VOP, then RMB/VEXVOP Options/View VEX code, you'll see what's included and called
Edited by tamte - Feb. 28, 2018 19:09:56
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Quick Links