Commit Graph

3806 Commits

Author SHA1 Message Date
ec99255c27 Phew, a lot of work, and no new features...
Main target was to make the inner rendering loop using no globals anymore.
This is essential for proper usage while raytracing, it caused a lot of
hacks in the raycode as well, which even didn't work correctly for all
situations (textures especially).

Done this by creating a new local struct RenderInput, which replaces usage
of the global struct Render R. The latter now only is used to denote
image size, viewmatrix, and the like.

Making the inner render loops using no globals caused 1000s of vars to
be changed... but the result definitely is much nicer code, which enables
making 'real' shaders in a next stage.
It also enabled me to remove the hacks from ray.c

Then i went to the task of removing redundant code. Especially the calculus
of texture coords took place (identical) in three locations.
Most obvious is the change in the unified render part, which is much less
code now; it uses the same rendering routines as normal render now.
(Note; not for halos yet!)

I also removed 6 files called 'shadowbuffer' something. This was experimen-
tal stuff from NaN days. And again saved a lot of double used code.

Finally I went over the blenkernel and blender/src calls to render stuff.
Here the same local data is used now, resulting in less dependency.
I also moved render-texture to the render module, this was still in Kernel.
(new file: texture.c)

So! After this commit I will check on the autofiles, to try to fix that.
MSVC people have to do it themselves.
This commit will need quite some testing help, but I'm around!
2003-12-21 21:52:51 +00:00
0060be6603 More render stuff:
- added 'Mapping to" channel "RayMirror", to control mirror with texture
- fixed bug in using mirror-rgb as texture channel... this is cumbersome
  because it is abused by Envmap in a not nice way. Fixing the abuse will
  cause compatibility errors, which can be fixed when we up release # to
  2.32.

- added "Translucency", which is nothing else than allowing another
  shading pass for the backside of a face (with normal inverted). This
  is interesting for all kinds of situations where you want light from
  behind to 'shine through'. Also works to reduce dark areas in
  unlighted parts of rendering transparent faces. Light from behind on
  transparent red window should make it glowing some, right?!
- added texture channel for this as well

- Reorganized Material Panels to reveil some consistancy where buttons
  can be found. Not perfect yet, but at least all options for Shaders and
  options for Mirror & Transparency now are together.
  This gives some space in Shader Panel for nice expansion.
2003-12-19 15:23:12 +00:00
cb20f1cdb4 another trace commit
- implemented tracing of transparency for shadows. This is a material
  option, in the new RayTrace panel.
  it only traces color and alpha, not shading. So the results of some
  transparant colored unlit faces can look odd. I will look onto that.
- changed fresnel formula (got hint from eeshlo!). this simplifies the UI,
  now only one button needed. The fresnel value "should" be identical as
  the refraction index, but that is booooring! So i added a special fresnel
  refraction slider for both mirroring and transparency. By setting all 3
  sliders equal, you get 'realism'.
- fresnel for transparancy works for Ztra rendering too. Same for transpa-
  rent shadow. But then you need to set 'ray' on in F10 menu.
- uploaded new monkey_glass blend in download.blender.org/demo/test/

Next stage: killing the globals from render, and implement "translucency"
which is effectively allowing faces being lit from behind, as paper or
cloth.
2003-12-18 21:34:48 +00:00
064297009c - shadeless rendering fixed!
error was due to new localized render result code... and of course only
  shading and tracing was tested :)
2003-12-16 16:07:46 +00:00
97d4dbc9c3 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.
2003-12-16 14:12:01 +00:00
d0159a9879 - another fix, to make sure radio colors work local during tracing...
this will be quite a lot of reconstruction, if i want to go for
  refraction, caustics, pathlights, etc... :/
2003-12-12 23:40:35 +00:00
b2357b5bc6 - fix for error caused by last commit... colors changed by textures
during raytracing were 'hanging' and showing up in the first rendered
  material.
2003-12-12 23:04:05 +00:00
55c3082c6b - fix for AA of mirroring.
It appeared that the Osa vectors for view vector, and for rendered coord
  had an opposite sign...
2003-12-12 15:03:01 +00:00
7ea1d94032 - removed call to bzero, replaced with memset
(bzero seems to be old, not supported anymore, also not for windows)
- think I fixed the error compiling in Irix, for a correct cast now
  (added parentheses around the subject for cast)
- changed call to ray_mirror, now included in the shading loop, just
  before the addition happens for specular. That way specular is added
  over mirroring. This changes the appearance quite some!
2003-12-12 11:28:33 +00:00
71770977f2 - fix for error in octree traverse code, as appeared in sample provided
by Ztonzy. Error happened when:
  - ray intersects in first node of traversal
  - next ray should intersect in same first node as well
  - no other nodes were accessed inbetween
  It's a bit hard to explain! But the reason is in the optimize code
  in top of ocread() function, where binary XOR magic speeds up. Here
  some static variables needed a reset.
2003-12-11 16:28:04 +00:00
1bfa43da53 Fixes in ray.c for linking under windows (seems lie bzero doesn't exist).
Shouldn't affect other platform if I did it correctly.
2003-12-11 04:08:49 +00:00
a18cc02374 - Xmas special: shiny mirroring bells & whistles!
This is a revision of the old NeoGeo raytracer, dusted off, improved quite
a lot, and nicely integrated in the rest of rendering pipeline.
Enable it with F10-"Ray", and set either a 'ray-shadow' lamp or give the
Material a "RayMirror" value.
It has been added for 2 reasons:
- get feedback on validity... I need artists to play around with it if it's
  actually useful. It still *is* raytracing, meaning complex scenes will
  easily become slow.
- for educational purposes. All raytracing happens in ray.c, which can be
  quite easily adjusted for other effects.

When too many disasters pop up with this, I'll make it a compile #ifdef.
But so far, it seems to do a decent job.

Demo files: http://www.blender.org/docs/ray_test.tgz
An article (tech) about how it works, and about the new octree invention
will be posted soon. :)

Note: it doesn't work with unified render yet.
2003-12-10 20:41:53 +00:00
e9d9a7282e All related to unified render:
- fixed bug in halo rendering combined with spothalo
- fixed bug in no antialiasing with sky with spothalo
- cleaned some weird usage of gamma for spothalo and sky
  (when rendering sky + spothalo, sky got gamma corrected
- removed old test code and #ifdefs for code readability

On test scenes here unified render looks much better. still some minor
issues with antialiasing... cant pin that down yet.
2003-11-12 20:43:01 +00:00
3a7dc92cd6 - bug fix: alpha wrong in unified render halos with lines or rings 2003-11-12 15:07:04 +00:00
7be1d02919 - bug fix #304
Wire rendering gave errors with parts.
  This due to the fact the lines are clipped exactly at the pixel
  centers of the image edge. For polys (triangles) that works fine, but
  in wireframe you see the lines ending at the edge.

  Solved by adjusting clipping routine for wires just a tinsy bit.
2003-11-08 16:57:23 +00:00
96403dc309 - fix bug #294
removed some code of someone in NaN who tried to fix
  prototypes... just solved by introducing a correct cmat[3][3] instead
  of using weird new matrix code.
2003-11-08 14:41:56 +00:00
c04eb56983 - removed hack in initrender code that allowed 'border render' in a
previously rendered image. it was just screwing up memory in some cases.
  for it to work quite more elaborate coding is needed.
- when selecting border in camera view (SHIFT+B) the associated render
  option is set automatic
- fixed some mallocs to become callocs in renderloop, to prevent garbish
  when border rendering
- also enables closing bug #179
2003-11-08 12:50:40 +00:00
21c2e8f74f - fixed bugreport intrr about shadeless UV texture face having wrong
brightness... it had one multiplication too many...

- found 3 month old error: the fix i committed for ESC during render
  was undone partially by a commit from guignot one week later. I already
  *thought* ESC reacted so slow... but i had fixed it, not!? :-)

  Now its still fast and instantly reacts to ESC again.
2003-11-07 19:23:13 +00:00
9be7b43c2d - fixed specularity for sun lights 2003-11-06 22:38:41 +00:00
147895715a Dynamic Face/Vert/Halo/Lamp tables:
User Info:
	Hard coded limits on the total number of face, verts, halos, and lamps
	is gone.  Blender now allocates the tables for these on an as needed
	basis.  As long as your system can come up with the memory, you won't
	run out.  As a bonus, it also uses slightly less memory on smaller scenes.

Coder info:
	This has been in tuhopuu for a while, but I don't know how hard it
	has been tested.  Since it now allocates only an initial 1024 tables
	(of 256 verts/faces/halos each), it seems like it has been put through
	it's paces. Lamps are allocated one at a time, and I start with 256.
 	I rendered 2.5M Faces/Verts/Halos. 4444 lamps. None the less, I left
	a few printf's in the realocation to hunt bugs.  I'll take them out
	just before the release freeze.

	Also, be on the lookout for other "sanity checks" that assume
	a limited number of the above items.  I think I got them all, but
	you never know.
2003-10-19 21:47:03 +00:00
7ac2731e63 Unified renderer OSA sample clipping:
User info:
	This change limits the contribution of any OSA sample to 1.0 per color
	in the Unified renderer.  Because color=1.0 gives fully saturated color,
	samples contributing more than 1.0 were overweighted in the OSA average
	causing aliasing (sometimes quite severe).

	Samples can contribute more than 1.0 because a material's spec and refl
	values are not normalized (In real world spec+refl <= 1.0).  This solves
	a large class of aliasing problems in the unified renderer.

Coder Info:
	None.
2003-10-19 21:08:44 +00:00
e889b375bd - forgot one event code in render...
- fixed the () in the && || code, typo... <blush>
2003-10-07 19:21:37 +00:00
3cf1cacd5d - Bug fixes for radio render (yes, releasing gives more reports!)
1. Rendering with material without radio flag sometimes caused scanline
   errors. The 'rad' value for rendercore loop wasn't reset in all cases
2. The color didn't truely match the color when using 'radio tool'.
   Cleaned up a few old lines in rendercore loop... accidentally one
   calculation was done double.
3. When adding new radiosity block, 'max iterations' is set at 120. this
   prevents noobies/experiment from going into radio-solving with a long
   itteration time (it exits at convergence < 0.1)
2003-09-27 09:38:09 +00:00
Alexander Ewering
8fdb574e83 Bugfix: The renderloop has a few problems concerning abortion with the ESC
key, among which is a crash related to lensflares rendering even though no
render buffer exists (after pressing ESC). Fixed this one. Be sure there
are more! :)
2003-09-24 21:21:29 +00:00
d8955d1b33 - Recursive environment map render
Multiple environments now can be rendered in one pass. Previously the other objects with environment maps didn't show up in a reflection. Like this:
http://www.blender.org/bf/dep.jpg

By default, Blender renders now this result:
http://www.blender.org/bf/dep0.jpg

For a further 'recursive ray-tracing effect' you can give each EnvMap texture a higher "Depth" value. Here is a result with depth set at '2':
http://www.blender.org/bf/dep2.jpg

Related new options:
- in (F10) DisplayButtons, environment map rendering can be turned on and off.
- in EnvMap texture buttons you can free all environment maps
- Environment map sizes are also reduced with the (F10) 'percentage' option.

Tech note: with this commit the VlakRen struct has on *ob pointer!
2003-09-23 21:05:51 +00:00
470b5c0366 So, for the platform managers to check:
- the link order for Blender has changed, the libradiosity.a has to be moved after the librender.a (obviously for a new dependency!). Check blender/source/Makefile
- there's a new file: blender/source/radiosity/intern/source/radrender.c

Here's what the new code does:

Using the core routines of the Radiosity tool, each renderface with 'emit material' and each renderface with 'radio material flag' set will be used to itterate to a global illumination solution. Per face with high energy (emit) little images are rendered (hemicubes) which makes up lookup tables to 'shoot' its energy to other faces.
In the end this energy - color - then is directly added to the pixel colors while rendering, Gouraud shaded.
Since it's done with renderfaces, it works for all primitives in Blender.

What is doesn't do yet:
- take into account textured color of faces. Currently it uses the material RGB color for filtering distributed energy.
- do some smart pre-subdividing. I don't know yet if this is useful... Right now it means that you'll have to balance the models yourself, to deliver small faces where you want a high accuracy for shadowing.
- unified render (is at my todo list)

User notes:
- per Material you want to have included in radiosity render: set the 'radio' flag. For newly added Materials it is ON by default now.
- the Ambient slider in Material controls the amount of radiosity color.
- for enabling radiosity rendering, set the F10 "Radio" button.
- the Radiosity buttons now only show the relevant radiosity rendering options. Pressing "collect meshes" will show all buttons again.
- for meshes, the faces who use Radio material always call the 'autosmooth' routine, this to make sure sharp angles (like corners in a room) do not have shared vertices. For some smooth models (like the raptor example) you might increase the standard smoothing angle from 30 to 45 degree.

Technical notes:
- I had to expand the renderface and rendervertices for it... shame on me! Faces have one pointer extra, render vertices four floats...
- The size of the hemicubes is now based at the boundbox of the entire scene (0.002 of it). This should be more reliable... to be done
- I fixed a bug in radiosity render, where sometimes backfaces where lit

In general:
I'd like everyone to play a bit with this system. It's not easy to get good results with it. A simple "hit and go" isn't there... maybe some good suggestions?
2003-08-31 20:33:46 +00:00
2e39d1f137 - a control-s character accidentally inserted here... but how? 2003-08-17 17:59:03 +00:00
0b2d2868f1 - fixed bug #448
now 'only shadow' lamps won't give light when rendering without shadows.
2003-08-17 15:57:12 +00:00
85245bfe13 - make sure shadowbuffers are tested & corrected for sizes that are
multiples of 16 pixels
2003-08-15 14:39:08 +00:00
159f53f0a0 - increased toon value 'size' to 3.14 for diff, and 1.53 for spec, as in
tuhopuu (as max for buttons)
- Sun lamps now do toon specularity too

Hemi lamps dont do any other shader than the old ones still... the
implimentation of it in Tuhopuu is disputable, will solve this for 2.29
2003-08-11 18:18:11 +00:00
d5c829e413 - added the 'no diffuse' and 'no specularity' options for Lamps, as were
in Tuhopuu
- added the Tuhopuu feature which displays material-buttons and lamp-
  buttons integrated. saves button presses that way!
2003-07-20 15:55:02 +00:00
9bf630a1f3 WARNING: with makefiles I could not get a stable blender compiled.
do a make clean in source/blender/ to be sure!

- Included the new shaders from Cessen... well, only the shader calls
  themselves. To make sure the shaders work I nicely integrated it

- MaterialButtons: layout changed a bit, but still resembles the old
  layout. The 'shader' options now are located together.

- Shaders are separated in 'diffuse' and 'specular'. You can combine them
  freely.

- diffuse Lambert: old shader
  diffuse Oren Nayar: new shader, gives sandy/silky/skinny material well
  diffuse Toon: for cartoon render

- specular Phong: new spec, traditional 70ies spec
  specular CookTorr: a reduced version of cook torrance shading, does
                     off specular peak well
  specular Blinn: new spec, same features as CookTorr, but with extra
                  'refraction' setting
  specular Toon: new spec for cartoon render

- default blender starts with settings that render compatible!

- works in shaded view and preview-render

- works in unified render

Further little changes:

- removed paranoia compile warnings from render/loader/blenlib

- and the warnings at files I worked at were removed.
2003-07-19 20:31:29 +00:00
f4f7e8ee46 - changed silly name 'shadelamplus' to shade_lamp_loop 2003-07-08 13:07:35 +00:00
bedee3227b taking care of mist intensity in the render process 2003-06-21 20:57:16 +00:00
073bed8601 - restored functionality for ESC detection during rendering which doesnt
eat up cpu time.
  in fact it was in pre-ghost blender already.

works now for all posix OS's, except for windows. now working on getting
that fixed as well. until then, rendering will be slow at win32...


cvS: ----------------------------------------------------------------------
2003-06-13 13:46:00 +00:00
Chris Want
924a849755 Support for building bf-blender under windows with gcc (huge thanks to
Florian Eggenburger).

Full instructions are in doc/README.windows-gcc.

Main differences from Florian's patch:

- the 'lib' dir should now be the same level as the 'blender' dir (rather
than being a subdir of 'blender'). This is consistent with the other
platforms that bf-blender supports (tuhopuu will also adopt this convention
hopefully soon).

- the script 'free_windows-env.mk' is no longer needed ... see the
docs about how this is overcome (again, tuhopuu will hopefully
also follow this route soon).

- the dlltool dir has it's own Makefile that builds all of the
needed stub libraries from the dll's in cvs.
2003-05-24 20:04:37 +00:00
19e892b2d9 Jeroen Lamain's edgeRender patch....
Removes floating point calculations and fixes some rounding errors
too boot.

I created a test program so you can see the differences if anyone is
interested you can grab it from
http://www.cs.umn.edu/~mein/blender/testedge.c

Kent
2003-05-21 15:55:00 +00:00
6f19051502 Slightly Modified version of Kester Maddock's Lamps patch to up the
max from 256 to 32766.

I removed the duplicate define and updated the files that needed it.

Kent
2003-05-20 17:09:55 +00:00
feda2db76a Kester Maddock's valgrind memory issue patch.
(initalizes a var to 0 before its used for the first time)
2003-05-20 15:34:23 +00:00
723b84c79c fun with quicktime:
#include <QuickTime/Movies.h> instead of #include <Movies.h> on OS X to
avoid having to specify the full path to the QT headers in the Makefiles

#undef NDEBUG on OS X to avoid errors about ID being declared twice

enable support for QuickTime in the original Makefiles on OS X
2003-05-02 13:36:56 +00:00
dfb34836bb rest of c comment translations render files 2003-04-28 11:25:42 +00:00
52f6a630ce Added rename/delete popups to the file and imageselect windows.
Redesigned the userpreference window layout. (not finished yet)

Enhanced the texteditor with; a rightmousemenu, clipboard text
support (for windows !) and the alt-m keystroke generates a 3d
text object. (up to 1000 characters)

(1, 2, 3, 4 and 7 from http://www.tncci.com/blender/feats.html)
2003-04-28 11:17:21 +00:00
71ffa47752 Add includedir for quicktime 2003-04-28 11:01:44 +00:00
706ccc0401 Added Quicktime support for OSX and Windows.
This code allows you to load Quicktime images and movies as textures
and render animations to Quicktime movies.
Note that the selected output codec is *not* saved in the blendfile.

To enable Quicktime functionality you need the SDK from Apple:
OSX: ftp://ftp.apple.com/developer/Development_Kits/QT6SDK_Mac.hqx
Win: ftp://ftp.apple.com/developer/Development_Kits/QT6SDK_Win.hqx
Add the \QTDevWin\CIncludes and \QTDevWin\Libraries directories
from this SDK to your build environment.

Enable the WITH_QUICKTIME compile flag in the following directories:
bf\blender\source\blender\imbuf
bf\blender\source\blender\src
bf\blender\source\blender\render
bf\blender\source\creator
2003-04-28 02:15:46 +00:00
1ab53ee998 first commit with hours and hours of comment translation for render code... 2003-04-27 14:05:41 +00:00
de09cf7609 Remove references to obsolete misc lib 2003-03-24 17:34:43 +00:00
702880df55 Update things to use blender_test_break() vs MISC_test_break() and
remove use of blendertimer.h
2003-03-24 16:37:08 +00:00
6e8abc4a8e Rob's patches for the slow render problem.
Kent
--
mein@cs.umn.edu
2003-01-01 17:47:20 +00:00
5e6d6710c4 renamed a var to avoid name conflicts...
In the header its just this..
-void initjit(float *jit, int num)
+void initjit(float *jitarr, int num)

its respectively renamed in jitter.c

Kent
2002-12-30 07:15:47 +00:00
f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00