|
|
Just like Christoph reads radiosity I spend some at night when my daughter had
fever reading printed sources of parametric object. Can't find any speed up
yet but have some notes already:
1. I have already partially pointed first problem at
http://abx.art.pl/pov/patches/uvparam.php. In MegaPOV UV coordinates returned
for objects during intersection test were stored on intersection stack with
push_uv_entry while in 3.5 it is changed. UV coordinates are written to fields
of objects: last_u and last_v. It is correct if we assume that between
intersection test and any normal or uv calculation won't be another
intersection test. If there are plans for allowing functions to be placed as
texturing parameters and pland for allowing trace to be placed in functions
that it is wrong assumptions imo. I think storing uv coordinates between
intersection test and normal/uv calculations is more safe when performed via
intersection stack. Please clarify my opinion if I'm wrong.
2. If above wories are not worth anything than my suggestion is to connect
DBL last_u, last_v;
fields from Parametric_Struct definition to one structure
UV_VECT last;
This way all assigments to/from "last" can be optimized to use Assign_UV_Vect
which is optimized with memcpy.
3. When contained_by in parametric object is parsed then Make_BBox is called
and then Compute_Parametric_BBox(Object) is called as next. There is no need
for Make_BBox becouse it is either initialized in Create_Parametric and again
overwritten in Compute_Parametric_BBox.
4. It could be leaved for security but Parametric->Trans is always assigned
within Create_Parametric and not removed until Destroy_Parametric so no need
for all those blocks with if(Param->Trans==NULL) in whole fparam.cpp.
5. In line 222 there is a condition:
if (Depth1 == Depth2) Depth1 = 0;
Somehow I'm not sure it is correct. When ray intersects container only once
then intersection test will return all intersection between container and
camera.
6. I think it is a bug but I'm not sure. Why in lines 183-184 of fparams.cpp
both depths are divided by len ? Isn't it returned with correct value ? Or is
it done to return to scene space from object space ? The same note is
connected with isosurface object.
7. Minor issues:
Lines 178-179:
VLength(len, New_Ray.Direction);
VInverseScaleEq(New_Ray.Direction, len);
can be replaced with:
VNormalizeEq(New_Ray.Direction);
unless note 6. is wrong.
Lines 214-219:
P[X] = Ray->Initial[X];
P[Y] = Ray->Initial[Y];
P[Z] = Ray->Initial[Z];
D[X] = Ray->Direction[X];
D[Y] = Ray->Direction[Y];
D[Z] = Ray->Direction[Z];
can be replaced with:
Assign_Vector( P , Ray->Initial )
Assign_Vector( D , Ray->Direction )
Lines 453-454:
VScale(IPoint, Ray->Direction, TResult);
VAddEq(IPoint, Ray->Initial);
can be replaced with:
VAddScaled(IPoint, Ray->Initial, TResult, Ray->Direction)
I hope my notes were readable and not missed anything. Any comments ?
ABX
Post a reply to this message
|
|