Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest storrence

Simulating Atmospheric refraction

Recommended Posts

Guest storrence

I'm trying to use C4D to simulate atmospheric refraction. What I've done is create twenty huge square planes 24,000 miles in size. They are stacked on top of each other 1 mile apart so 20 miles vertical in total. I then created 20 identical textures and turned off everything except transparency. Then I created an xpresso script to easily set the 20 layers to a higher refraction rate. For example top plane refraction is set to .25 and bottom layer is set to 1.2. So it's a density gradient. Then I set up a spot light above the top plane and aimed it to the surface at an angle. I get basically the expected result which is for the beam to be progressively bent downwards creating a downward arc. It's not exactly the way I want and I'm wondering if it can be done a better way. I can upload the model if it helps.

One thing I'm curious about is what is the difference between doing this using planes (I'm using UVW mapping and Side:Both) or another way it can be done is create a 20 large cubes 24,000 miles in size and 1 mile in height and then remove the top plane of each cube so the refraction doesn't cancel itself out.

Would be cool if I could just do the gradient someway without creating all the separate planes but I'm guessing that is impossible.

Share this post


Link to post
Share on other sites

49 minutes ago, storrence said:

I'm using this refraction/density table but I noticed C4D has a minimum allowable refraction of .25

http://usatoday30.usatoday.com/weather/wstdatmo.htm

 I looked to the table , but it contains only density info , and density and index of refraction are not the same (water has density of 1.0 with 1.3334 index of refraction).

is this what you want to do http://area.autodesk.com/blogs/the-maya-blog/a_fast_and_simple_planetary_atmosphere ?

if not , can you provide an Image to what you want to achieve ?


3D is where your dreams come true ... or at least mine :D

Share this post


Link to post
Share on other sites
Guest storrence

Thanks but that is not what I'm trying to achieve. I know that density and refractive index don't use the same scale but they are related. When a light passes a density boundary layer or gradient it bends in the direction of greater density. This is what I'm trying to do. I have the bending working but I'm wondering if it can be improved.

To a good approximation, the quantity n-1 is proportional to the density of air. So using a table of air density, and the fact that n-1 is 2.9x10-4 at sea level (density = 1.2 kg/m3), you can get a good idea of the refractive index at different altitudes.

Reference https://www.physicsforums.com/threads/variations-in-refractive-index-of-atmosphere-with-altitude.481821/

Now I have it setup with a parallel spot light above pointing down at 45° angle with the beam passing through 20 planes about 60 miles apart from each other. I have the refraction set on each material so the first material has refractive index .25 and bottom 20th layer has 1.2. This causes the light to bend down more and more as it enters each plane. So it refracts for example 5° at each layer.

What I'm not sure about is the difference of the texture being on a plane or if it should be on a very flat large cube and I think if it's a cube then the top panel would have to be removed or I will get reverse refraction like it shows in the help. I just want the angle to continue in the same direction creating an arc out of the light beam.

Share this post


Link to post
Share on other sites
7 hours ago, storrence said:

Thanks but that is not what I'm trying to achieve. I know that density and refractive index don't use the same scale but they are related. When a light passes a density boundary layer or gradient it bends in the direction of greater density. This is what I'm trying to do. I have the bending working but I'm wondering if it can be improved.

Now I have it setup with a parallel spot light above pointing down at 45° angle with the beam passing through 20 planes about 60 miles apart from each other. I have the refraction set on each material so the first material has refractive index .25 and bottom 20th layer has 1.2. This causes the light to bend down more and more as it enters each plane. So it refracts for example 5° at each layer.

What I'm not sure about is the difference of the texture being on a plane or if it should be on a very flat large cube and I think if it's a cube then the top panel would have to be removed or I will get reverse refraction like it shows in the help. I just want the angle to continue in the same direction creating an arc out of the light beam.

you can try disable "total internal reflection " and "exit reflections " so you will not get the reversed effect , why not try  spheres ? 

and don't you have any reference Images on what you want to achieve ?

a scene file might help as well :)


3D is where your dreams come true ... or at least mine :D

Share this post


Link to post
Share on other sites
Guest storrence

This is what I'm trying to model. A medium with a density gradient. 

 

Share this post


Link to post
Share on other sites
1 hour ago, storrence said:

This is what I'm trying to model. A medium with a density gradient. 

 

after I have seen the video , 

it is completely a different story , 

when you add sugar to the water the index of refraction will increase , and will never be below 1.0 , you get index of refraction of 1.0 only in an empty space , and below 1.0 only in a very rare situations .

beside all of that , I couldn't find any tut / WIP ...etc about this in any other 3d app , if you have any , this will be helpful . 

and the normal light in c4d are not physically accurate light , so it won't change with the index of refraction , and the volumetric lights in c4d don't work with transparency / reflection , you can get a physically accurate light with another technique using only the reflectance channel in c4d , but still you can't get physically accurate volumetric lighting . 

you can cheat this effect with some techniques if you are interested in this , but you can't do it physically accurate in the physical renderer in c4d (not sure if other render engines can do it or not )


3D is where your dreams come true ... or at least mine :D

Share this post


Link to post
Share on other sites
Guest storrence

This is just an analogy of what I want to do. I my project I need to go from .25 to about 1.3
I actually have that sort working and it progressively bends the light downward but I was wondering if anyone had ideas to do it another way better.

The sugar water example duplicates the density gradient I want to recreate. It's just using a different starting and ending density but the effect is similar in that it bends the light in direction of increasing density.

So I'm trying to create a density gradient with the refraction index increase linearly. I'm doing it now with 20 layers.
Notice in that sugar bend video that the light only bends when laser is not exactly horizontal because it would not be passing any density changes.

Share this post


Link to post
Share on other sites
30 minutes ago, storrence said:

This is just an analogy of what I want to do. I my project I need to go from .25 to about 1.3
I actually have that sort working and it progressively bends the light downward but I was wondering if anyone had ideas to do it another way better.

The sugar water example duplicates the density gradient I want to recreate. It's just using a different starting and ending density but the effect is similar in that it bends the light in direction of increasing density.

So I'm trying to create a density gradient with the refraction index increase linearly. I'm doing it now with 20 layers.
Notice in that sugar bend video that the light only bends when laser is not exactly horizontal because it would not be passing any density changes.

well ... for me it seems to be a pain in the head , so I will just create 3 nulls and animate them manually , maybe with some xpresso , then use the tracer to link them and create a spline , then sweep the spline add pure luminance material , then render with "glow " post effect enabled . 

if you want to try harder to achieve this effect you are free , but IMO it doesn't worth all the work , while you can re-create it manually . 

best regards ,


3D is where your dreams come true ... or at least mine :D

Share this post


Link to post
Share on other sites
Guest storrence

My point was not to just create the look of the effect. That is easy and can be done like you suggest. I wanted to test a theory and needed to model refraction in a more accurate way. Thanks for the suggestion to try a sphere. Didn't think of that. Also I noticed you can have more than one texture pure object and then mix them together so I'm curious what that would result in if they each had different refraction levels. The density gradient effect is what I'm after.

Share this post


Link to post
Share on other sites
3 hours ago, storrence said:

My point was not to just create the look of the effect. That is easy and can be done like you suggest. I wanted to test a theory and needed to model refraction in a more accurate way. Thanks for the suggestion to try a sphere. Didn't think of that. Also I noticed you can have more than one texture pure object and then mix them together so I'm curious what that would result in if they each had different refraction levels. The density gradient effect is what I'm after.

well , mixing texture will mix colour only (and some other minor thing ) but you can't explain real-word theories inside a biased render engine , you can download arnold trail and try to do this (arnold is unbiased render engine ), good luck with what you wanna do :) 


3D is where your dreams come true ... or at least mine :D

Share this post


Link to post
Share on other sites
Guest storrence

Thanks. I've not heard of unbiased and biased render engines. Will check them out. I did notice I got different results when choosing different render engines in the settings.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

YOUTUBE CHANNEL:

ABOUT US:

C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :) Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, get your own private messenger, post status updates, manage your profile and much more. If you need to find solution to your problem or otherwise ask for help, Cafe is the right place.
×
×
  • Create New...