Another commit for raytracing, now with glass refraction & fresnel!

Changelog:

- enable refraction with button "Ray Transp" in Material buttons.
- set "Angular Index" value for amount of refraction.
- use the "Alpha" value to define transparency.
- remember to set a higher "Depth" too... glass can bounce quite some
  more than expected.
- for correct refraction, 3D models MUST have normals pointing in the
  right direction (consistently pointing outside).
- refraction 'sees' the thickness of glass based on what you model. So
  make for realistic glass both sides of a surface.

- I needed to do some rewriting for correct mirroring/refraction,
  especially to prevent specularity being blended away.
  Solved this with localizing shading results in the rendercore.c.
  Now specularity correctly is added, and reduces the 'mirror' value.
- Localizing more parts of the render code is being planned. The old
  render heavily relies on struct Render and struct Osa to store globals.
  For scanline render no problem, but recursive raytracing dislikes that.

- done test with gamma-corrected summation of colors during tracing, is
  commented out still. But this will give more balanced reflections. Now
  dark reflections that are reflected in a bright surface seem incorrect.

- Introduced 'Fresnel' effect for Mirror and Transparency. This
  influences the amount of mirror/transparency based at viewing angle.
  Next to a new Fresnel slider, also a 'falloff' button has been added to
  define the way it spreads.
- Fresnel also works for Ztransp rendering

- created new Panel for Raytrace options
  I have to evaluate still where it all should be logically located.
- material preview shows fake reflection and fake refraction as well.
This commit is contained in:
Ton Roosendaal
2003-12-16 14:12:01 +00:00
parent 356cf79534
commit 97d4dbc9c3
12 changed files with 626 additions and 264 deletions

View File

@@ -135,6 +135,8 @@ void test_idbutton_cb(void *namev, void *arg2_unused);
#define B_COLLAMP 1102
#define B_TEXCLEARLAMP 1103
#define B_SBUFF 1104
#define B_SHADBUF 1105
#define B_SHADRAY 1106
/* *********************** */
#define B_MATBUTS 1300
@@ -152,6 +154,8 @@ void test_idbutton_cb(void *namev, void *arg2_unused);
#define B_MTEXCOPY 1211
#define B_MATLAY 1212
#define B_MATHALO 1213
#define B_MATZTRANSP 1214
#define B_MATRAYTRANSP 1215
/* *********************** */
#define B_TEXBUTS 1400