void Start() { settings = GetComponent<AdvectedScalesSettings> (); scales_norm = new float[settings.scaleCount,settings.scaleCount]; // init scales to something interesting for( int j = 0; j < settings.scaleCount; j++ ) { float phi = getPhi( j ); for( int i = 0; i < settings.scaleCount; i++ ) { float theta = getTheta( i ); float fixedZ = Mathf.Lerp( Mathf.Cos(CloudsBase.halfFov_horiz_rad), 1.0f, settings.fixedZProp ) / (Mathf.Sin(theta)*Mathf.Cos(phi)); float fixedR = (Mathf.Sin(13f*j/(float)settings.scaleCount)*Mathf.Sin(8f*i/(float)settings.scaleCount)*settings.fixedRNoise + 1f); scales_norm[i,j] = Mathf.Lerp( fixedZ, fixedR, settings.reInitCurvature ); } } lastPos = transform.position; lastForward = transform.forward; lastRight = transform.right; lastUp = transform.up; }
void Start() { settings = GetComponent <AdvectedScalesSettings> (); scales_norm = new float[settings.scaleCount, settings.scaleCount]; // init scales to something interesting for (int j = 0; j < settings.scaleCount; j++) { float phi = getPhi(j); for (int i = 0; i < settings.scaleCount; i++) { float theta = getTheta(i); float fixedZ = Mathf.Lerp(Mathf.Cos(CloudsBase.halfFov_horiz_rad), 1.0f, settings.fixedZProp) / (Mathf.Sin(theta) * Mathf.Cos(phi)); float fixedR = (Mathf.Sin(13f * j / (float)settings.scaleCount) * Mathf.Sin(8f * i / (float)settings.scaleCount) * settings.fixedRNoise + 1f); scales_norm[i, j] = Mathf.Lerp(fixedZ, fixedR, settings.reInitCurvature); } } lastPos = transform.position; lastForward = transform.forward; lastRight = transform.right; lastUp = transform.up; }
void Start() { settings = GetComponent <AdvectedScalesSettings> (); scales_norm = new float[settings.scaleCount]; // init scales to something interesting for (int i = 0; i < settings.scaleCount; i++) { float fixedZ = Mathf.Lerp(Mathf.Cos(CloudsBase.halfFov_horiz_rad), 1.0f, settings.fixedZProp) / Mathf.Sin(getTheta(i)); float fixedR = (Mathf.Sin(8.0f * i / (float)settings.scaleCount) * settings.fixedRNoise + 1.0f); scales_norm[i] = Mathf.Lerp(fixedZ, fixedR, settings.reInitCurvature); } lastPos = transform.position; lastForward = transform.forward; lastRight = transform.right; }
void Start() { settings = GetComponent<AdvectedScalesSettings> (); scales_norm = new float[settings.scaleCount]; // init scales to something interesting for( int i = 0; i < settings.scaleCount; i++ ) { float fixedZ = Mathf.Lerp( Mathf.Cos(CloudsBase.halfFov_horiz_rad), 1.0f, settings.fixedZProp ) / Mathf.Sin(getTheta(i)); float fixedR = (Mathf.Sin(8.0f*i/(float)settings.scaleCount)*settings.fixedRNoise + 1.0f); scales_norm[i] = Mathf.Lerp( fixedZ, fixedR, settings.reInitCurvature ); } lastPos = transform.position; lastForward = transform.forward; lastRight = transform.right; }
void Start() { settings = GetComponent <AdvectedScalesSettings> (); }
void Start() { settings = GetComponent<AdvectedScalesSettings> (); }