|
|
Hello I know this must sound an obvious question but i have taken the optics
demo apart to ray trace a scene which reflects a directional photon beam with a
mirror. The problem is that the beam stops at the mirror. I have tried to set
the max_trace_level to higher numbers and still can't figure out why this
doesn't work.
If somebody can give me a hand i would be grateful. Thanks in advance
Paulo Neves
#version 3.7;
#include "colors.inc"
global_settings {
max_trace_level 5
photons {
count 150000
max_trace_level 9
media 500, 2
}
}
#declare CamPos = < 0, 18, 0>;
camera {
location CamPos
look_at < 0, 0, 0>
angle 35
}
light_source {CamPos, color Gray25
photons {refraction off reflection off}
media_interaction on
}
light_source {<-150, 0.5, 0>, color rgb < 1.2, 1, 1.5>
spotlight radius 0.3 falloff 0.35 point_at < 0, 0.5, 0>
photons {refraction on reflection on}
}
#macro Block(From, To)
union {
cylinder {From, To*(x+z), 0.1 scale < 1, 10*To.y, 1>
texture {
pigment {checker color Gray90, color Gray70
scale 0.1
}
finish {brilliance 0.5}
}
}
cylinder {From, To*(x+z), 0.025
translate y*To
texture {
pigment {color rgb < 1, 0.7, 0.2>}
finish {ambient 0.8}
}
}
}
#end
box {<-100,-1,-100>, < 100, 0, 100>
texture {
pigment {checker color Gray90, color rgb < 0.2, 0, 0.4>}
finish {brilliance 0.25}
}
}
box {<-7,-0.1,-3>, < 6, 1, 4> hollow
texture {pigment {color rgbf 1}}
interior {
media {
scattering {0.5, color White extinction 0}
// emission color White*0.2
method 3
intervals 1 samples 4
}
}
photons {target}
}
union {
difference {
object {Block(<-4, 0,-3>, <-4, 1.5, 3>)}
box {<-5, 0.25,-0.5>, < -3, 0.75, 0.5>}
}
cylinder {<-4, 0, 0>, <-4, 1.5, 0>, 0.1 translate z*0.15}
cylinder {<-4, 0, 0>, <-4, 1.5, 0>, 0.1 translate -z*0.15}
texture {pigment {color rgb 1}}
}
#declare MirrorTex1 =
texture {
pigment {color White}
finish {ambient 0 diffuse 0 reflection 1 ambient 1}
}
#macro PhotonTarget(Reflect, Refract, IgnorePhotons)
photons {
target
reflection Reflect
refraction Refract
collect off
}
#end
#macro Mirror(Pos, Ang, Width, Height, Tex)
box {<-0.1,-0.1,-Width/2>, < 0, Height, Width/2>
texture {Tex}
PhotonTarget(yes, yes, yes)
rotate -y*Ang
translate Pos
}
#end
object {Mirror(<-3, 0, 0>, 3*45, 2, 1, MirrorTex1)}
Post a reply to this message
|
|
|
|
Am 06.06.2012 22:47, schrieb ptsneves:
> clipka<ano### [at] anonymousorg> wrote:
>> Am 06.06.2012 12:34, schrieb ptsneves:
>>> Hello I know this must sound an obvious question but i have taken the optics
>>> demo apart to ray trace a scene which reflects a directional photon beam with a
>>> mirror. The problem is that the beam stops at the mirror. I have tried to set
>>> the max_trace_level to higher numbers and still can't figure out why this
>>> doesn't work.
>>
>> As Stephen already mentioned, this is a known bug in 3.7 RC5; the next
>> release will fix it.
>
> Yep it seems that the original code i pasted works under 3.6 and not on 3.7. Is
> there a patch i can apply instead of waiting. The difference in render time is
> quite obvious
If you're using Linux, or have a way to build 3.7 RC5 for your system,
then it should be quite simple. Change the backend/render/trace.cpp file
as follows:
At the end of the function Trace::ComputeReflection() (somewhere near
line 1290), replace the lines
Colour tmpCol;
TraceRay(nray, tmpCol, weight, ticket, false);
RGBColour tmpCol2(tmpCol);
if (finish->Irid > 0.0)
ComputeIridColour(finish, Vector3d(nray.Direction),
Vector3d(ray.Direction), normal, ipoint, tmpCol2);
colour += Colour(tmpCol2);
with
if (!ray.IsPhotonRay() && (finish->Irid > 0.0))
{
Colour tmpCol;
TraceRay(nray, tmpCol, weight, ticket, false);
RGBColour tmpCol2(tmpCol);
ComputeIridColour(finish, Vector3d(nray.Direction),
Vector3d(ray.Direction), normal, ipoint, tmpCol2);
colour += Colour(tmpCol2);
}
else
{
TraceRay(nray, colour, weight, ticket, false);
}
Then rebuild. That'll fix it.
If you can't build a modified 3.7 RC5 for your system, I'm afraid you'll
have to wait for RC6.
Post a reply to this message
|
|