|
|
On 22-5-2018 16:31, clipka wrote:
> Am 22.05.2018 um 12:57 schrieb Thomas de Groot:
>
>> Ok. So it this particular case, the parser was slower (29s. vs 4sec).
>
> Hm... that's actually quite the difference.
>
> Does the scene in question perhaps rely heavily on macros defined in
> another file? Then the disabled macro caching might be a fitting
> explanation.
>
>
> Also, care to share the scene?
>
From the Land of Cheese:
Where the longer parse time comes from is in the while loop distributing
the cubes. This loop resides in a separate inc file. and looks like this:
//==========================================================
#local R1 = seed(1929);
#local R2 = seed(9732);
#local R3 = seed(6493);
#local N1 = 4000;
#local I = 0;
#while (I <= N1)
#local Start = VRand_In_Obj(RocksBox, R1);
#local Norm = <0, 0, 0>;
#local RockPos = trace(Landscape, Start, -y, Norm);
#declare Visible = IsObjectVisible(RockPos)
#if (Visible)
#if (vdot(Norm, y)>0.8 & RockPos.y<50.0*(0.8+rand(R1)*0.4) &
RockF(RockPos.x,RockPos.y,RockPos.z)<0.5+rand(R1)*0.1 & RockPos.y>0 )
object {Rock
//scale (RockPos.y+(1/RockPos.y))*RRand(0.9, 1.1, R2)
scale RockPos.y*RRand(0.9, 1.1, R2)
rotate RRand(-180, 180, R3)
translate RockPos
}
#if (mod(I, N1/10) = 0)
#debug concat(" Rocks: ", str(I,5,0), "\n")
#end
#local I = I + 1;
#end //slope & altitude
#end //Visible
#end
//==========================================================
Otherwise, parse time is about equal between versions when the loop is
disabled.
--
Thomas
Post a reply to this message
|
|