Commit Graph

310 Commits

Author SHA1 Message Date
fb40ae6413 Added option to set 'full Osa' on non raytraced scenes. This makes sure
old files still use the old fast OSA, and when you want a specific
material to have specular/shader/texture AA you can set this individual.

When rendering ray_mir or ray_transp or ray_shadow the new OSA will be
effective by default however.

Still todo; make this switch work for transparant faces and unified...
2004-07-27 22:23:45 +00:00
43c1dcdfe6 Solution for old reports, that ray_transp filtered image textures wrong.
Problem was in calculation of oversampling vectors for correct AA. With
the new AA method, this is less necessary, so the code now doesnt use
mipmapped or filtered images when it is refracted. For reflected rays it
does still use the filter though, there the error is hardly noticable.

For all tests and report .blend files it looks much better.
However, a real mathematical solution is preferable still.
2004-07-27 18:48:27 +00:00
031b39521a Fix for #1476
This is another extreme old one; from before NaN days even!
Issue is that shadowbuffers have a bias to prevent faces shadowing itself.
To make bias smarter, code was added to adjust bias based on light angle.
This correction allowed a factor of 10 times smaller bias, being in many
cases much too strong, causing frontally lighted faces becoming too dark.

New correction only halves the bias on frontal light, which looks quite
more convincing and pretty.
2004-07-27 11:29:45 +00:00
ca6c0861cf Wrong threshold for reflection rays (prevent go through backside) caused
errors in rays going extreme close along surface. Like bug #1471 shows.

Threshold removed, can't find any sample where this happens now...
2004-07-26 20:09:43 +00:00
653abbae6c Fix for #1449 (blocky shadows)
This problem appeared to be a famous one, with some fun read to be found
on the web. The solution as I commit here is described on the site:
http://www.blender3d.org/cms/Misc_improvements.355.0.html

As extra (I needed it quite some!) added requested feature to have the
renderwindow display in titlebar whether the spare page is shown (JKEY)
2004-07-26 17:12:04 +00:00
3b242ab2ea Fix in rendering AO + alphamode "Key". Sky color was set raytrace and not
properly reset when renderimg sky itself.
2004-07-23 11:06:28 +00:00
1620a9199e Adding the new blending modes, and coding nice code broke having
multiple layers of textures... silly cut/paste error. Fixed!
(check; moto9.blend in regression files)
2004-07-18 17:42:57 +00:00
4a244f274d Attempt 2 :)
Found the right +0.5 todo, now based on understanding why. Checked with
demo files in regression. But i bet intrr finds a new bug in an hour!
2004-07-17 14:18:34 +00:00
15d4fb9c85 Really bad luck with committing recently... past fix was plain wrong,
although it rendered the submitted bug file fine...
Note to self again; always also check if code even works in general! :)
Note to self 2: don't fix things ad hoc when you're not coding
2004-07-17 13:56:05 +00:00
f7a4b6f1d7 Shadow buffer render wasn't corrected yet for OSA reconstruction of long
ago... samples where offsetted half a pixel, causing banding in render.
2004-07-15 20:03:35 +00:00
9905d1c68d Rewound changes done in alpha calculus for texturemapping. This
worked OK for alpha coming from antialising (rendered) but failed to do
in other situations (alpha as blending, painted in gimp)
2004-07-14 18:18:21 +00:00
419e5a6a0b Removed VECADD and VECSUB, are in utildefine.h now 2004-07-13 20:39:32 +00:00
f32b8e6b7f added support for ortho camera (needs yafray from cvs)
When using xml export, yafray will now render the alpha channel as well when 'RGBA' button in blender is enabled (Plugin does this automatically).
In plugin code, fixed smooth shading bug for non-mesh objects.
Relative paths for textures are now recognized (plugin & xml).
Fixed problem with duplicate objects (plugin & xml).
Really old bug, sun position is now correct (plugin & xml).
World background now can also be a regular image texture (jpeg & tga), but for now always assumes spheremapping, which is not the same as Blender either. In yafray the texture is assumed to be a full 360 (panorama type) map.
convertBlenderScene.c cleanup, the identity transform 'hack' is removed.
THIS AFFECTS ALL EXTERNAL RENDERERS (Aqsis and others) WHICH RELY ON THE RENDERDATA OUTPUT, VERTICES AND LAMPCOORDINATES/VECTORS NOW NEED TO BE TRANSFORMED BACK TO WORLD COORDINATES. See yafray plugin/export code.
2004-07-12 03:20:31 +00:00
f77bc7eb7d Quite a large one this time... but now we have:
Edges in Mesh
- adds automatic when you use creases. For other situations; call the
  void make_edges(Mesh *me) in mesh.c. Of course, once in editmode the
  edges are automatically recreated.
- in F9 buttons you can add/remove edges too
- both for Mesh and DisplistMesh, so it speeds up drawing quite some in
  wireframe
- render for edges can't work... edges have no material nor tface nor col..
  so here still the faces are rendered in wire

Creases in Subsurf
- based on the code by Chris McFarlen
- main changes is that now edges are used, saving quite some data in file
- use SHIFT+E in editmode to set edges-sharpness. values go from 0-1
- in F9 buttons you can set draw-crease mode. It draws now blended from
  wire color to edge-select color (as provided in Theme)

Known issue: setting sharpness on 1 cube (subdiv 2) gives weird results
with some values... Chris, can you check?

Further; code cleanups, changing 0 in NULL when needed, no warnings, etc etc
2004-07-08 20:38:27 +00:00
5c543698c9 Three in one:
- textures: added support for new mixers (div, diff etc) to work on the
  other map-to channels too, like ref or spec
  Also it works on lamp and world textures
- brought back uncommented line of code that was removed by leon, to have
  particle motion based on textures
- recoded the glPylonOffset hack to be nice function, this for future
  testing.
2004-07-03 14:18:21 +00:00
90d4f7a3c1 Added new operators for "MapTo" panel as suggested & partially coded by
Kent Mein. So next to the mix, mult, add, sub we have now:

- Div: divides by texture color
- Screen: is like Mult, but works opposite (makes lighter)
- Diff: the difference between texture color and material
- Light: if texture is lighter it shows (per component)
- Dark: if texture is darker it shows (per component)

Next step: add this for specular and mirror, and the other channels...
I commit it now because it also fixes error in previous commit.
2004-07-02 22:29:06 +00:00
326f3c3d6a Fixed rendering of image textures with alpha... it gave ugly dark outlines.
Please note the following:

- pictures need to be saved as 'premul' sky render if you want to use it
  in Blender as texture
- but for alpha-over in sequencer it has to be 'key alpha'...

This inconsistancy needs to be solved.. for example as option for both
texture as sequencer.
2004-07-02 20:49:08 +00:00
30251dbc13 Report #1401
Division by zero in calculating render coords... only happens for
Wire material AND having face-less edges. Then the normal is zero, and
some calculations can't happen correctly.

(error in rendercore.c, other files committed was because of removed and
cleaned up enters)
2004-07-01 16:15:22 +00:00
a8ef804146 NEW: Ramp shades for diffuse and specular
http://www.blender3d.org/cms/Ramp_Shaders.348.0.html

Material color and specular now can be defined by a Colorband. The actual
color then is defined during shading based on:
- shade value (like dotproduct)
- energy value (dot product plus light)
- normal
- result of all shading (useful for adding stuff in the end)

Special request from [A]ndy! :)
2004-06-30 18:54:09 +00:00
e750478ce3 The revised patch from Leon for new particle effects.
New is that objects can have a force field, and Meshes can even deflect
(collide) particles. This is in a new sub-menu in Object buttons F7

The full instructions where on the web, Leon mailed it me and I will put
it in CMS tomorrow. For those who like to play with it now, here are demo
files:

http://download.blender.org/demo/test/

Quite some changes where in the integration though... so previous created
particle deflectors will not work. Changes to mention now are:
- gravity is renamed to 'force field'
- force field and deflector options are in Object now, not in Mesh
- the options also have its own struct, doesnt add to Object by default
- force fields are possible for all object types, but only work on center.
  So empty objects are typical for it.

Work to do:
- add draw method in 3d win to denote forcefield objects
- check on the UI (panel with different size?)
- add 'recalc' button in deflector panel
2004-06-26 18:18:11 +00:00
59433aa42e Report #1391
The work i did end of may on render normals (displacemap especially)
caused refraction code to work wrong... took a while to find out, but
just removed a couple of lines too much.
Added clear comment there what it is, and what danger of removing is!
2004-06-21 17:58:53 +00:00
e26c5a7676 Report #1376
Rayshadow didn't use lamp option 'layer' correctly. Objects not in
lamp-layer now also don't get shadows (nor light).
2004-06-21 16:07:50 +00:00
ed86852f7e New export through plugin scheme for yafray. It is working on linux and mac os x
Needs latest yafray, you can get it from cvs, but I have also binaries
for os x here:

http://www.coala.uniovi.es/~jandro/noname/downloads/yafray-0.0.6-3.pkg.zip

To use it, go to yafray panels (global settings) and uncheck the "xml" button.
That would tell the export code to avoid xml export and use the yafray plugin
instead. You'll see the render being draw while running and you can even stop it
with ESC key.

Since I'm sure problems will appear, expect updates soon.
Remember: does not work on win32
2004-06-16 18:44:12 +00:00
7f3dcd7c64 Bug 1349
Envmap render error; when no (f10) envmap option was used, it could give
a 'stripe' effect based on a non-initialized global value. Only happens
for transparant layers...
2004-06-13 17:40:25 +00:00
d2dbc96b81 bug #1340
Key alpha (render) set alph component at '1' for sky... this is an old
convention from NeoGeo days, and I have absolutely no clue whatfor...
maybe for some antique amiga iff format or so. Made it zero now.
2004-05-29 17:33:30 +00:00
59dad6aefc Recoded the methods how normals get corrected and flipped during render
conversion. Old method tried to solve it per object, detecting a flipped
matrix. Since we have displacemapping and raytracing this is too inaccurate.
Also, flipping normals should alsways result i correct flipped vertex-
normals too.

Solution is to completely recalcuate the 'puno' (vertex normal) flags in
renderHelp.c now (set_normal_flags). The face normals themselves are not
flipped until that stage.

Second major improvement involves the calculation of correct splitted
triangles, when a quad is not flat. It now creates triangles based on the
vertex normals, which have actual information on surrounding geometry, thus
resulting in much smoother results.
Without this you get errors in ray-shadow, with light shining almost
parallel to a face. But again, displacement mapping improves with it too.

Third fix is that by removing normal flipping from displace code the result
is much better now.
2004-05-29 16:14:34 +00:00
e67713c113 Removed a bzero from octree-filling, replaced with exact code what
needs cleared. Timings go down nice:

octree new     2.33a

128    0:04.2  0:07.5
256    0:06.5  0:20.0
512    0:18.0  2.06.9

Time is including initialize renderfaces etc. 100k quads.
2004-05-19 19:30:43 +00:00
1a6329533f Removed double #defines from include, added some comments in code, and
added define for future use to bring back old (fast) AA.
2004-05-18 20:00:51 +00:00
1c93da1478 Removed obsolete file 2004-05-15 18:13:42 +00:00
a4861c37be Assuming the freeze is over and we can head towards 2.34: this is the
first commit for review and improvements on OSA (anti aliasing) in
Blender.

http://www.blender3d.org/cms/Rendering_engine.320.0.html

Most relevant changes:
- full check on subpixel sample locations
- all subpixels are fully rendered (gives spec AA, procedural texture AA)
- also unified render uses it
- removed double-used code for unified render

Whether or not this will be optional (better pics, but in some cases slow)
is to further evaluate. For raytracing - for example - this cannot be simply
done, since the new sampling system made raytrace code much simpler.
2004-05-15 18:07:09 +00:00
cf2aef1df9 Secured division by extreme values with a FLT_EPSILON. This might
prevent hanging on optimized windows build. That's going to be tested
now!
2004-05-12 19:17:00 +00:00
0238900617 Bug fix for AO and Soft shadow:
When Traceable was off, and the rendered pixel outside Octree, the
intersection was going wrong. Due to the many samples taken not easy
to see, but certainly causing extra noise.
2004-05-09 21:52:23 +00:00
16c783d950 Added two more mapping types to World buttons for sky render.
"Sphere": spherical mapping for a 360 degree panorama
"Tube": cylindrical mapping for a 360 degree panorama

Both mappings by default do only the sky (upper) hemisphere. The color
below is same as regular Horiz and Zenith colors, useful for setting
an AO effect.

Sample pics:
http://www.1000skies.com/fullpanos/index.htm (commercial)
2004-05-07 18:03:40 +00:00
4c423081b2 Fix committed a while ago, revision 1.52, still set a bluroffset in a
very unexpected location, causing small offset in rendered sub-pixel,
which showed only up raytracing a very detailed object with small
faces... ugh!

(Thanks [A]ndy, sorry Desoto! :-)
2004-04-29 22:31:48 +00:00
97f2cf05f5 Fix #1207
Flag for 'only shadow' was still working when lamp type switched to
Hemi. Also 'only shadow' didnt work yet for ray_shadow Spot lamp.
2004-04-29 16:20:34 +00:00
02ba73aaad Sneaked in new feature (request samo):
The Image texture repeat options, now allow a "Checker" repeat. With
odd and even tiles set separately, and a size button to set a
'Mortar' inbetween tiles.

http://www.blender3d.org/cms/Render_engine_features.215.0.html

Also fixed bug: using 'CalcAlpha' option for image textures didn't give
antialised edges for image.
2004-04-28 18:08:34 +00:00
34a2350908 - UGH! Some optimize line in sky code screwed up sky render when it had
no texture nor blend... gave weird lines in render.
2004-04-27 17:06:02 +00:00
4f815a52f1 Error found in code that allows dynamic octrees. A lookup table was not
cleared correctly for each face, causing too many octree nodes to be
filled in.
Especially for more complex scenes this fix is quite a time saver.

Still looking at ways to speedup octree filling though.
2004-04-26 22:14:31 +00:00
4ff3a1ec10 Request from [A]ndy:
When tracing a mirror with AO, the rendering was extremely slow due to
each mirror sample (like 8 per pixel) taking a full range of AO samples.

Now it uses for mirror samples a corrected amount, which makes sure for
a single pixel still a full AO range is used.
Makes mirror+AO render 5-6 times faster, at least.
2004-04-26 21:38:36 +00:00
6d2970e406 Added Ambient channel in "Map To" Panel for materials. Is now means to
control AO and Radio with texture too.
2004-04-26 16:49:05 +00:00
44f8257436 Optimize for AO: when material ambient value is zero, no AO calculus
takes place now. Also nice to tweak & speedup environments.

(Thanks Theeth for hint!)
2004-04-26 15:07:08 +00:00
0facc2681e Solved AO smooth rendering, by introducing a "Bias" value for smoothed
rendered faces.
http://www.blender3d.org/cms/Ambient_Occlusion.231.0.html

ALso removed prints when allocating new 'face groups' etc, which wasn't
informative at all.
2004-04-26 14:17:48 +00:00
5bbd35ff05 Turned Sky render code in Blender to become fully float, it still returned
bytes for RGB.
This to allow very bright contrasted images to be used for AO as well. As
a first start also the Texture->Colors panel now allows contrast setting
up to 5.0 (was 2.0).
2004-04-24 20:27:29 +00:00
4d29aee140 New: rendering in background mode (blender -b) now prints a percentage to
indicate scanlines being in progress. For motion blur frames it works too.

Bug fix: in background render it accidentally tried to free a sound pointer
that wasn't set. (caused by own commit of three days ago).

Fix: rendering motion blur in forground prints correct sample # in info-
header again.
2004-04-24 12:02:39 +00:00
dffa667674 Raytrace now has option to change the resolution of the Octree used. It
appeared that the standard size (64x64x64) just works fine for small
scenes, like a single character in a small environment. Larger scenes and
larger environments became exponentional slower.

Disadvantage of larger octrees is longer build time, and overhead traver-
sing it though, so something to tweak based on some experimenting.
A table with test results + blender file will be in CMS soon.

New button is in F10 Render panel, in bottom. Last free spot there! O_o
Sizes supported now 64, 128, 256 or 512.
2004-04-23 21:02:58 +00:00
2e4d0e9c5a Fix for #1174
When toonshading is used, also backfacing polygons are rendered. This
causes a conflict with raytraced shadow, since backfacing polygons
always have shadow.
There was an error in the code that didnt set shadow for backfacing
polys, assuming shading would be 'zero' then as well. That's fixed.
2004-04-21 17:23:04 +00:00
f80809825e Fix for radio render.
Somewhere after 2.28c I fixed some thing in radio rendering that prevented
textures to be applied to radio energy.
Now it is a normal 'diffuse' energy again, and multiplied with actual
(textured) material color.

Small fix: the radiosity steps show up as numbers printed in time-cursor.
2004-04-21 15:44:37 +00:00
9f63f5df7e Fixed error in OSA render & using AO causing stripes.
The OSA ofset vector for current rendercoord (O.dxco) wasn't
initialised in all cases. Actually, just removed it for AO, effect is
invisible.

Bug provided by jK, not in tracker. thnx!
2004-04-19 14:40:46 +00:00
713a0ceefe Found error in Energy for AO. This didnt work correctly for 'sub' and 'add
and sub' methods.
Also reduced limit for slider. AO energy of value 50 was useless.
2004-04-18 16:18:08 +00:00
02dfa98a89 Better sampling for arealight soft shadow. Now using a distributed sample
pattern as previous commit for AO.

Previous setting, dither+jitter, has been cancelled. Now you can choose
for either nothing, dither, or for noise. With the latter giving same
nice noise as for AO.

Pics:
http://www.blender3d.org/cms/Render_engine_features.215.0.html
2004-04-17 20:01:00 +00:00