Is it possible to animate vectron values in its script?

Post, discuss and share handy resources like textures, models and HDRI maps in this forum.
Forum rules
Please do not post any material that is copyrighted or restricted from public use in any way. OTOY NZ LTD and it's forum members are not liable for any copyright infringements on material in this forum. Please contact us if this is the case and we will remove the material in question.
Post Reply
foliohattu
Licensed Customer
Posts: 13
Joined: Tue Jun 23, 2020 10:21 am

im Wondering if its possible to animate vectron script values by adding a key framable slider or altering its script to say that in x number of frames the number should be x ?

Trying to think a way to animate following numbers on menger sponge boolen.
Mainly the 2.1 and 3.2

vector a = mod( p*s, 2.1 )-1.0;
s *= 3.0;
vector r = abs(1.0 - 3.2*abs(a));

Does anyone know if this is possible?
User avatar
bepeg4d
Octane Guru
Posts: 10340
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

Hi,
you can use the time parameter, please have a look at this example:

Code: Select all

 #include "octane-oslintrin.h"
shader OslGeometry(
    int Iterations = 10,
    float Power = 2.0,
    float Bailout = 20,
    output _sdf c = _SDFDEF)
{
    vector pos = P;

    float power = Power;

    float w = fmod(_wipes(), 300.0) / 300.0;

    w += time / 300.0;

    power = w * 5 + 5.0;

	vector z = P;
	float dr = 1.0;
	float r = 0.0;
	for (int i = 0; i < Iterations ; i++) {
		r = length(z);
		if (r>Bailout) break;
		
		// convert to polar coordinates
		float theta = acos(z[2]/r);
		float phi = atan2(z[1],z[0]);
		dr =  pow( r, power-1.0)*power*dr + 1.0;
		
		// scale and rotate the point
		float zr = pow( r,power);
		theta = theta*power;
		phi = phi*power;
		
		// convert back to cartesian coordinates
		z = zr*vector(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta));
		z+=pos;
	}
	c.dist = 0.5*log(r)*r/dr;
}
40ADF84C-0967-4FAA-9EF6-1C4BA542C251.jpeg
ciao Beppe
AtomicNixon
Licensed Customer
Posts: 7
Joined: Fri Jul 26, 2019 9:08 am

float w = fmod(_wipes(), 300.0) / 300.0;
Could you tell me the purpose of this line, and what the function _wipes() does, is for? Having real trouble getting this to work properly. More info on how the time variable works is very much needed. Also, any other undocumented variables we should know about?
Post Reply

Return to “Resources and Sharing”