Notifications
Clear all

[Closed] is defraction scripting possible?

okay this is coming from less than a noob,i dont even script,so forgive me if its a dumb question… is it possible to affect rayracer rendering with script such that you can break the “angle of incidence” rule? in other words i want to simulate such effects as defraction grating and the “oil on water” effect. i can do an approximation with multtiple lights that are set apart in space and sum to the original light, but this is not equaly effective at all angles ov view. what would be great (note to santa) is a dialauge for setting the angle of reflection for individual lights,so i can simulate it as above but with all the lights in the same location, so the effect would be more realistic. OR even better would be if i could use the original light running through some kind of “prismatic” function and to have the variance of the angle for each frequency (to some # colors such as 100 or so ) as a variable derived from mapping(such as black= normal reflection white= max “spread”)

if script is not the way to go what can one do? and yes i know there is probably no quick easy way to get what i want,cause i dont think ive seen it yet in any renderings,not that they dont exist,im sure.

oh ya of couse the mother of all would be an accurate model of the lighting based on the quantum mechanics of the effects as an option you could just “click on” hahahah ya, right.
anyoo i thank you all in advance for any advice anyone might have on this.

12 Replies

Script is not the way to go. You would really need to write your own rendering program for this. You might be able to fake it by writing shaders for mental ray or renderman, but I dont know much about writing shaders.

Edit: by the way it’s called diffraction

okay then, perhaps there is some kind of “work around” simmilar to the light array that i described that i already use to try to achieve the diffraction(thanks for the correction,i can read a word a thousand times and still not know how to spell it) effect, but something more dynamic that would rearange the lights as the camera moves to aproximate the correct angles of reflection? i dont know… it just seems to me that this must have come up before and someone might have already put the work into an answer. perhaps i started this thread in the wrong place… i dont know. all i do know is im not satisfied with what im doing now… what i wonder, is what i need to back up and learn to tackle this (besides how to spell) any more advice on this is most welcome and thanks in advance… this is just a little over my head.

Hi buckky,

Maybe I misunderstand. There are already rendering systems that calculate refraction. Final render is one of them. Maxwell render uses an accurate model of light, and can do superb splitting of light based on physics (seriously, check out there forum)!
ok ok i hear you, not everyone has cash to splash!

http://www.winosi.onlinehome.de/Gallery_t10.htm

I know this doesn’t touch on the ‘oil on water’ but heck it’[s a good bash.

wow ya thats cool.thanks for the link. but what im looking for is the diffraction effect not refraction.although that is the closest thing ive seen so far. diffraction is the breaking of the equal angles of incidence and reflection law to cause different angles of reflection by light per frequency, in specular reflection,not light transmission. this depends upon the positions of the camera , light source and the angle of the normals of the surface, and the degree of deviation from the standard model of specular reflection. although the “prismatic” or refractive angle by frequency as shown in the links is half way there, oil on water is not a refractive effect. its happening at the suface, although it is a function of the spacing of boundaries of transparent materials with unlike refractive indexes of indicies er however you spell/say it(this being a door into the mysteries of nature because… well check it out… its just mind bending when you try to break it down…) . also the same effect happens in a diffraction grid where it is caused by the spacing of adjacent reflective and non reflective surface areas where the distances are small, such as the data surface of a cd(equally mysterious,when you break it down). although this is called often a prismatic effect ,again its not due (directly,or in all cases) to the refractive values of the matrials. thanks again for the input and link

bucky is correct, there are NO rendering systems in existence that use an accurate model of light. From physics I’m sure you remember the whole issue of the wave/particle duality of light. Rendering algorithms consider light a particle, and IGNORE the wave properties. Diffraction is one of those wave properties. I’m sure that if they knew how to efficiently implement these things, they would be doing it already…and they are much better at this than you are, bucky. So I wouldn’t get my hopes up. However, finalRender stage-1 has shaders to simulate diffraction, and I bet mental ray does too.

ya im aware thats its not possible at this time to have a true simulation of a macroscopic view of such quantum mechanical effects(for ordinary every day renderings). one big obstacle to this is the degree of accuracy to do so just does not exist(or would be insane to try)in todays cg geometry. however i cant help that think that because the end optical effect is simple (if you can skip the step of calculating what the declination of the specular angle per freq actually would be) that there is some way to force max to cough up the right result,no matter how ugly the work around.i belive that making the declination variable values come from a simple greytone map (mapped to the object surface,or in many cases the same declination value for the whole suface)could shortcut alot of this. ill have to check out the simulations you mentioned to see if the already do what i need, and im just ignorant.

but cetainly no need to simulate the actual waveform probability distributions of particle detection…oh btw, it is i believe possible to calculate thiese probabilities(the wave aspect) within a particle simulation,because this method completely resolves any “duality” while retaining both wave and particle behaviour. but that is way beond me to think about trying, nor would it be of much use i think other than for educational aids. i start to slip off topic…

so… (scratches head) ill look at what simulators may be available… and if there isnt a satisfactory one, see if i cant work out some kind of minimal requirements of a more specific natue. but ya, i might just be in over my head… what ever i do find ill share thanks for the input

I’m not sure I understood you correctly, as my english isn’t so good.

And I’m not sure what’s the “oil on water effect” is.

Are you referring to the separation of colors like for a rainbow, or a prism ? That what I was thinking diffaction was. If so, I certainly don’t know how to do it

But may be you are referring to surfaces that, while coplanar, reflect the same lights in different direction ? that is what I understand from what you write. If so, I suggest the use of normal bumps. I came to quite interesting results using them. I’ll look if I can find a demo file.

Jerome

I couldn’t find my demo, but I made a quick one

http://jerome.boulbes.free.fr/testnormalbump.avi

It’s a rotating pure white shiny cube with 3 static point lights. the cube has a red/green checker in the NormalBump slot (0.02 intensity).

Notice how different parts of the cube’s surface react differently to the lights according to the orientation of the cube with respect to the lights. Also, notice how the intensity of the reflection varies, and is inverted in the movement.

Jerome

you know the rainbow colors you see in a puddle if there is some thin layer of oil? yes…or a “rainbow” sticker that shines bright colors but you can tell they arent “in” the material like a c.o.a. sticker…ummm or crows feathers,or bettter peacocks feathers…it is a rainbow effect and it is much like a prism exept for the fact that it is not the changing of the angle of a ray or light by passing through, but as you correctly understood is its to do with the normals of the surface and has to do with specular reflection values. what i am seeking is something between thiese two examples above…

ill atempt to break it down into something that makes sense… and forgive me if my language is a bit confused, its just because i only know half of anything about what im talking about here…

one part is, yes, to split “original lights” into colors,a “rainbow” for white lights etc… by whatever means is best to acomplish the second step, be it creating new seperate lights that can be dealt with one at a time, or some other method,whatever.

then for each of the seperated colors have the difference from the specular “angle of incidence” rule for reflection be a variable you can input. by tweaking what the machine thinks the normal is or whatever… i dont know.

now… to be able to take this value from a greyscale map on the surface,and pow!

ya i know its a bit much,and perhaps im just making more noise than anythingbut…

i can get close to diffraction grating looking materials but none are quite there… if i can find a free(or cheap) way of doing this ill be happy.anyway i hope this is clear, and thanks for the input.

Page 1 / 2