|
|
Been playing around with a *real* (ducks to avoid the flames) ray tracer
recently. ASAP is used to model and simulate physically correct optics.
The dudes who design LEDs use this, as do the people designing lights for
cars, camera lens systems etc, it seems like it's pretty much the industry
standard based on the list of customers they say they have.
It's actually quite similar to POV in the way it works. You set up your
scene with a script (more about that in a bit). Light sources can be any
object or surface, you set the distribution of rays and angles, wavelengths
and powers. You give all the surfaces "interface" properties, and bits
inside get media. Sounding familiar? But then instead of any cameras you
just analyse the rays hitting a certain surface (or group of surfaces) using
a number of the hundreds of tools built in.
The default "max_trace_level" is 4096 :-) Apparently when designing optical
systems that rely heavily on total internal reflection (eg optical fibres
etc) this needs to be increased...
It won't give you any pretty pictures like POV does, but it will give you
nice plots of brightness over a surface after light has come from a helical
filament and gone through 8 lenses :-)
Anyway, the scripting language is what lets it down. It really is the most
annoying language I have ever had to use. There are just so many illogical
constraints that seem totally pointless. For example, you can use the @
sign to repeat entries, so 4@0 gives you four 0's in a row, or 6@-3 gives
you six -3's. The clever bit is you can do -4@1, which will give you four
1's but alternating the sign, so you get 1,-1,1,-1. Now, you'd think
that -4@-1 would give you -1,1,-1,1 ... but no, apparently that's just not
possible.
Add to that you can't have an if/endif without an else, lots of things have
to be in certain positions, there's lot of rules about where you *must* have
whitespace, and of course where you *mustn't* have whitespace (eg 2+3 * 4 is
illegal), it just drives me mad since I am used to C++ and SDL.
Oh and the referencing system. Suppose you have defined two objects and you
want to do something with them... Well, you have two choices, reference them
absolutely by number, or relatively. ie you can only say "merge the 2nd and
5th item created" or "merge the item above and the one two items above
that".
I'm beginning to love SDL even more...
Post a reply to this message
|
|
|
|
> So I take it this thing doesn't use the RGB colour model then? ;-)
It uses individual wavelengths, it's up to you if you just use 1 or 1000 of
them in the model. But all properties and things are dependant on
wavelength so it works as expected.
> Does it handle polarisation too?
In some limited way, yes, but apparently the next version (with they have a
beta version of) allows full-blown polarisation simulation (which is why we
are interested - as you can imagine simulating an LCD needs a pretty good
polarisation model...)
Post a reply to this message
|
|
|
|
scott wrote:
>> So I take it this thing doesn't use the RGB colour model then? ;-)
>
> It uses individual wavelengths, it's up to you if you just use 1 or 1000
> of them in the model. But all properties and things are dependant on
> wavelength so it works as expected.
Is the bandwidth hard-coded or adjustable? (E.g., could you try to use
it for microwaves if you wanted.)
>> Does it handle polarisation too?
>
> In some limited way, yes, but apparently the next version (with they
> have a beta version of) allows full-blown polarisation simulation (which
> is why we are interested - as you can imagine simulating an LCD needs a
> pretty good polarisation model...)
LOL! Yeah, I can imagine...
Post a reply to this message
|
|
|
|
> Is the bandwidth hard-coded or adjustable? (E.g., could you try to use it
> for microwaves if you wanted.)
It's not hard-coded, just that all the pre-defined materials only have data
for roughly visible wavelengths. In theory there is nothing stopping you
specifying the material properties for other wavelengths and then using
those in the simulation...
Post a reply to this message
|
|