Commit Graph

310 Commits

Author SHA1 Message Date
a970419d0e If YFexport directory is not set, it will now attempt to use the temp directory.
(/tmp or $TEMP for win.)

Probably too early still, but now in plugin mode the floatbuffer will be used too,
including postprocessing.
2004-12-30 01:34:42 +00:00
0db670ce47 And a first threading fix; mist render still used a R global for storage.
caused very bad stripes in render.
2004-12-27 22:57:19 +00:00
610cec55c7 Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
  Currently only works with alternating scanlines, but gives excellent
  performance. For both normal render as unified implemented.
  Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
  getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
  OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
  with chars or shorts.
- Made normal render and unified render use same code for sky and halo
  render, giving equal (and better) results for halo render. Old render
  now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
  after render. Using PostProcess menu you will note an immediate re-
  display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options

- Render module is still not having a "nice" API, but amount of dependencies
  went down a lot. Next todo: remove abusive "previewrender" code.
  The last main global in Render (struct Render) now can be re-used for fully
  controlling a render, to allow multiple "instances" of render to open.

- Renderwindow now displays a smal bar on top with the stats, and keeps the
  stats after render too. Including "spare" page support.
  Not only easier visible that way, but also to remove the awkward code that
  was drawing stats in the Info header (extreme slow on some ATIs too)

- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
  defines.

- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
302dc94b7a Fix for #2034
It appeared that the method as used in unified render for "render all sub-
pixels" isn't very well resistant to having large amounts of faces in a
single pixel. The bug file had about 16x70x2 faces per pixel... causing
tremendous slowdown and even wrong render.

I've disabled the option (was coded by Nzc in NaN days) and made it
sampling in the main render loop. Goes much faster, error free. Only loss
is in that it doesnt use superiour subsamples for gauss anymore. Here the
normal render performs slightly better. Not a real issue though. Hard to
notice.
2004-12-19 18:18:54 +00:00
f48b4f5b4a Bugfix #2008
Combination of:
- render movie
- with border set
- and "crop" set
Crashed.

Was due to feeding movie initialize code wrong frame sizes. Another oldie!

Also found that crop+border+parts doesnt work. This now is prevented with
warning and return.
2004-12-12 18:16:35 +00:00
10d2330343 The ugly global R.flag was reset to zero, before it was calling functions
that could popup error() boxes. These dont work then, and need to be
disabled by keeping R.flag on R_RENDERING

This is a half fix for a report Rob H works on. Will wait for his test.
2004-12-11 15:48:33 +00:00
974f11379a As addition to the use of Colorband for normals;
- Stucci now accepts it too (for normals and color)
  Note; stucci doesn't return a single value, like marble or wood, that's
  still so, to disable it coloring the "Col" Map input by default.
- Magic texture now accepts Colorband
2004-12-10 18:29:16 +00:00
eae5d39899 Bug fix #1988, ray-transparency render.
Five fixes in this commit...

- the normals for nurbs surfaces still were calculated pointing wrong in some occasions
- recoded ray-transp rendering to accept normals pointing any direction; it just counts how many times it passes a "glass" layer, and flips normals appropriate then. This means rendering will go fine on models without manually setting the normals. You can also move a camera inside a 'glass' object.
- rendering of the inside part of glass now uses correct normal too... specularity happen on a solid glass inside now.
- And an inside reflected mirror ray will keep bouncing inside glass

Related to rendering localview: old convention to render localview, but with the lamps in the normal layers, has been restored.
Please note; render happens based on active window. You *only* get a localview or 'unlocked layer' render when that 3d window is active = mouse in window.
2004-12-09 12:06:37 +00:00
b6f5420e8b Bug fix #1987
Halos with texture, but only mapping to "Alpha" and not color, were
rendered black, instead of in material color.
2004-12-08 15:29:47 +00:00
0e7ac575c0 Sneak in little feature for texture editing pleasure;
- New channel for "Map to" added, "Warp"
- Use the slider next to the option to set amount of influence the texture
  will have on the coordinates of the next texture.
- Warp uses for this the same values as for Normal or Displacement mapping
- Warp remains active for all channels, until replaced (or zeroed).
2004-12-07 17:46:14 +00:00
d0cdf2bd4b More tweaks related to bump mapping quality;
While going over the code, I found out the "nabla", the size of offset
vectors for calculating derivatives of a texture, is a built in constant.
Even worse, the value was different for new noise types (musgrave etc).
So I've added a new slider for it in the procedural texture panels, which
by default is set to 0.025, the value of the old constant. Also made sure
it works with equal effect in all procedurals.

NOTE: a small Nabla will give sharper, detailed bump, but the effect also
becomes smaller, correct that in the Mapping Panel of materials.

For better & compliant control over the bumpmapping, I've also included
the Colorband output in derivatives calculus, so the bump output then
matches the color created. It's also a nice tool to finetune output of
textures for bumpmapping in general.

Bug fix; clicking on the rightmose 'item' in ColorBand didn't activate it.
Found out the ColorBand was slightly drawn off (2 pixels).
2004-12-07 14:46:48 +00:00
23b14eccec Bug fix #1978
Stencil in World didn't work with RGB textures (like what returns from
colorbands).
2004-12-06 19:14:53 +00:00
e4d428b539 Tweaked support for normalmaps to be OK.
http://www.blender3d.org/cms/Normal_Mapping.491.0.html

main changes:
- The "Map Input" in Blender for normals was negated
- Range for Z in normal map is Z (0-1) to Blue (0-255)
2004-12-06 18:05:42 +00:00
1e811c7886 Bugfix: normal mapping for textures wasn't rotated back to view space,
causing weird results on camera moves or object rotations.

Added: support for "normal maps". See for example:
http://members.shaw.ca/jimht03/normal.html

The Image panel in Texture buttons has new option "Normal Map" for it.
When this is used, normals are read straight from RGB values, and blended
with the current normal.
2004-12-05 21:49:13 +00:00
aad31875d7 Special bf-committers request; Lamp/World/Material now each have 10
channels to link texture to.

The amount of code changes seems large, but is mostly getting rind of
hardcoded values (6 and 8) for channels, replacing it with MAX_MTEX.

Further did some fixes;
- Ipo for Lamp showed too many mapping channels
- Texture MapTo buttons for lamp missed the slider to blend texture color
- Lamp texture mapping "View" only worked for Spot, now it uses lamp-
  view vector for all types. (Nice for projections!)
2004-12-04 21:49:02 +00:00
fb57058f9f Bug fix #1954
Edge render for wire in unified was total mess! Code there apparently never
even tested. Gave wrong rendering and potential crashes.
2004-12-04 12:02:19 +00:00
0d9f06cce4 Bug fix #1947
Unified render added sky with alpha=1. Found the way how to fix it, didnt
dare that yesterday. :)
Now sky is rendered with alpha=0, like normal render.

Thanks to the recent reports, a lot of old issues with unified render have
been solved. This is going to be pretty OK!
2004-12-03 17:03:35 +00:00
7a686d2d7e Bug fix #1948
When using a backbuffer with alpha, but alpha is not premulled, you can
get weird rendering results with halos or lens flare. This was caused by
optimize rule in alpha routine that assumed alpha==0 means color is zero.
Removed for the the halo case.
2004-12-03 16:44:48 +00:00
aa92e3e37f Bufix #1942
Halos with Flare option didn't render correct in Unified render, they were
added twice!
Also noticed errors in applying alpha for 'Premul' alpha in Unified. Fixed.
2004-12-02 21:18:58 +00:00
47230dbf75 Bug fix #1939
Combining panorama scene and Sequencer effect on scene (like glow) crashed.

Found two other issues;

- on click in sequencer, the image output window didn't redraw correct, but
  only when a render window was opened. Caused by missing 'activate' call
- added a pause in dragging-frame loop to make it idle friendly
2004-12-02 18:12:18 +00:00
a7e250e85c Bug fix #1937
In unified render, halos can give black/colored overflows. Found it this
happens with halos that are behind the camera clipping range. Halo clip
just had some weird code for panorama corrections...

In the provided .blend of report found 3 more glitches;

- after render particle system with Material Ipo, values for material were
  not restored correctly
- Meshes with particles didn't draw axis (draw extra) on correct location
- Same as above, axis didn't draw in selected color.
2004-12-02 14:52:40 +00:00
63d38ede15 Bug fix #1922
Gauss filtered render now supports using Part render too.
Solved by increasing part sizes with 1 pixel around, but only with gauss
set.
2004-12-01 19:46:58 +00:00
f2a265f0c5 Buf fix #1928
Bug in Unified render with Edge outline option. Appeared to be lack of
setting buffer pointers at NULL after a render. Bad one, oldie. :)
2004-12-01 16:47:26 +00:00
40f1dfe380 Bugfix #1915
In unified render, AO with option "Sky" could give black dots, caused by
an overflow due to division by zero (was clipped away in normal render).
2004-11-30 22:46:13 +00:00
45cd17b584 Ack, previous commit (4 hr ago) cancelled out recalculating lookop tables
for Gaussian filter.
2004-11-28 23:11:41 +00:00
ac9f9298fd Fix for #1902
For composting sky behind alpha, a gamma corrected alpha_under was used,
but Blender didnt make the gamma tables unless OSA was set.
Old bug!

Changed; while rendering with "Backbuf" that doesn't exist, blender still
renders, but without backfbuf now. It used to stop render and return, with
only a print in console... confusing.
2004-11-28 18:14:57 +00:00
a7630c6faa Fix for unified rendering;
Gaussian sampling/rendering now supported too!
Also corrected gamma corrected adding of colors, which gives better alpha
and blending with sky than normal render does. The latter I could check
once too...
2004-11-28 14:28:55 +00:00
20cd56e4af Bug fix #1842, "black scanlines appear in render on windows".
Thanks to Brecht & Valgrind, found 2 cases for unitialized variables in
the render code. Both were for 2D texture input (Window and Sticky) which
didn't initalize a the third coordinate. Goes fine for 2D textures, but not
for 3d ones :)
2004-11-28 10:31:18 +00:00
9dbd01e879 Report #1841
Crash in this situation;
- one blender file with more scenes
- render image
- goto another Scene with no camera and larger output size for image
- render

Render buffer has to be freed then :)
2004-11-27 18:47:51 +00:00
5bdbf9d700 - Bug fix, reported by Stefano;
- Ztransp material didn't raytrace at all (now just traces it entirely,
    remember too set the transp depth for it)
  - tramsparent material reflected wrong in mirror material, due to
    specular being added without alpha.
- Cleaned up some code to improve raytrace speed some. The old conventions
  from before the AA recode were still there, this allowed coherence for
  octree traversal. Current AA doesn't allow this anymore.
  Added is improved check for 'first hit' on shadow render, per lamp this
  now is stored
  All in all, render with ray trace improved about 10-15%.
2004-11-27 17:33:40 +00:00
970ac5aa99 Bug fix #1880
Two accumulating errors, causing 'scanline' errors too, but now based on
using different filtering values for transparent shadows.
Was another 2 cases of unused variable render as well. :)
2004-11-24 18:53:45 +00:00
2e33e173f2 Three cases of unitialized variables found.
Hopefully it fixes the black scanlines error, as reported in #1842, but
need MSVC compiler to test it. ;)
2004-11-22 15:32:57 +00:00
87048d0901 Bug fix #1838
AO option "Use sky" or "Use tex" now also take option "Use distances" into
account, so you can control shades of AO better then.
2004-11-21 22:37:06 +00:00
c7d8c44de9 In plugin mode, blender's zbuffer will now also be filled, so it can be used
with the zblur plugin for faster dof (or other seq.plugins that need the
zbuffer).
I don't think the conversion to a blender zbuffer value is quite correct,
but at least it does produce usable results for zblur without too much
differences with the blender render (at least not for the short tests that I
could do in this short time...)
2004-11-18 05:22:18 +00:00
59f08429ab Fix for bug #1791
- onlyshadow material defaulted to black when no shadow calc was used, is
  now 100% transparent
- AO 'shadows' were not included in onlyshadow material
- alpha render appeared to be wrong since 2.32... it was gamma corrected
  giving difference in OSA render with 'Gamma' on

That alpha issue i am going to tackle once, it is not well functioning, and
might be combined with new 'transmission' colors idea
2004-11-13 18:30:07 +00:00
30c8c7dbc7 User Preferences Header got scrambled on OGL anim render
turned off *render statistics* in header for OGL render
2004-11-13 00:24:39 +00:00
15f17707ca Fix (thanks goran!) for stupid || and && mixup... causing dither to underflow 2004-11-02 22:51:09 +00:00
9a5f98576a Small tweak in dithering; the noise varies around 0.0 now.
Value 'dithering' in buttons can go to '2', for extra noise. 1.0 defaults
to exact 1.0/256.0 noise.
2004-11-01 18:04:18 +00:00
6d672eee9a Last new feature before release; patch provided by Goran Kocov.
In DisplayButtons, Panel "Output", a new slider "Dither" allows to add
random noise dither to rendered output. It works on sky as well as solid
and transparent. Note however that in OSA render, the Unified Render gives
much better results, since that render nicely delivers full scanlines of
high definition color. The old render mode isn't well suited for this
postprocess.

A dither value of '1.0' will exactly add maximum of 1.0/256.0 to the
pixels.

Potential improvements for next releases;
- regular patterns
- dither per color channel
- not only add, but also subtract dither

Also note that this gives best results for print work or stills. Animating it
gives slight visible noise. Also runlength compression wont really work, and
Jpeg needs to be given higher quality too.
2004-11-01 15:21:50 +00:00
6321adf0d1 bug fix 1698
- border render + backbuf crashed (!)
- escape from border render didn't put half-rendered result in final pic
2004-10-28 21:21:24 +00:00
f7e899a194 Render with backbuffer, using border, crashed... was commit of many months
ago by self. Tsk!
2004-10-28 16:56:23 +00:00
53da078c56 Fix for #1691
Using octree resolution 512 easily could overflow fixed sized array that
holds all node branches. Had to jack that up...
2004-10-27 09:59:25 +00:00
65a878a24a Bug #1651
And another fix for only shadow render. Correct clipping for spotbundles
shining on only-shadow materials.
2004-10-16 15:55:16 +00:00
c79b3bb92c Fix for #1618
Only shadow material + spotlamp-ray-shadow didn't clip for the spotbundle
correctly.
2004-10-16 15:25:58 +00:00
0639829140 Fix for #1549
This was something users found since tracing got into blender, having
sometimes small 'dots' or bright pixels or missing reflection rays in
an image. Thanks to the very simple sample file I could disect it...
it appeared to be an incomplete check for all numerical exceptions when
you traverse the octree nodes. Very technical, but clear comments are in
the code to explain ;)
2004-10-16 11:29:09 +00:00
c47896280a Fix for #1617
Volumetric spothalo shadow clipped at z=0.0 instead of correct z= -1.0.
Just forgot that zbuffer for spot shadow uses entire signed integer range.
2004-10-14 09:40:48 +00:00
e3f97af5c8 Stoopid typo in 'full osa' caused the wrong mask value to be sent to the
raytracer. Instead of only tracing the current subpixel it did all
(or most) of them.

Solves reports on slow AO in 2.34, but also will affect ray_mir and transp
2004-08-30 17:17:08 +00:00
e9b0238d0c Major update, all implemented a bit in a hurry, and probably will need bugfixes at some point.
Extended the range of the depth and cdepth parameters as reqested by leope.
Bumpmapping should now be a bit more similar to the Blender render.

Added support for all remaining lightsources in yafray, tried to make use of
as much of the existing Blender parameters as possible.

Blender Lamp: added switch to enable rendering with shadowbuffer ('softlight' in yafray).
All other parameters are similar to the Blender settings, for yafray both the
bias parameter and the shadowbuffer size can be lower than equivalent Blender
settings, since the yafray buffer is floating point. Remember that 6 shadowmaps
are created in this case, so can use quite a bit of memory with large
buffer settings.
When 'ray shadow' is enabled for this lamp type, it is possible to set a light
radius to create a spherical arealight source ('spherelight' in yafray),
when this is 0, it is exported as a pointlight instead.

Blender Spot: as in Blender now supports 'halo' rendering.
Halo spots always use shadowbuffers, so when enabled the buttons for shadowmap
settings will appear. The 'ray shadow' button can still be used to disable
shadows cast onto other objects, independent of halo shadows.
One thing to remember, halo's don't work with empty backgrounds, something must
be behind the spotlight for it to be visible.

And finally, the photonlight:
probably the most confusing (as more things related to yafray), the photonlight
is not a real lightsource, it is only used as a source to shoot photons from.
Since indirect lighting is already supported (and looks better as well)
only caustics mode is supported.
So to be able to use this properly other lightsources must be used with it.
For the photonlighting to be 'correct' similar lightsettings as for the 'source'
light are needed.
Probably the best way to do this, when you are happy with the lighting setup
you have, and want to add caustics, copy the light you want to enable for
caustics (shift-D) and leave everything as is, then change the mode to
'Photon'.
To not waiste any photons, the photonlight behaves similar to the spotlight,
you can set the width of the beam with the 'angle' parameter. Make sure
that any object that needs to cast caustics is within that beam, make
the beam width as small as possible to tightly fit the object.
The following other parameters can be set:
-photons: the number of photons to shoot.
-search: the number of photons to search when rendering, the higher,
the blurrier the caustics.
-depth: the amount of photon bounces allowed, since the primary use is for
caustics, you probably best set this to the same level as the 'ray depth'
parameter.
-Blur: this controls the amount of caustics blur (in addition to the search
parameter), very low values will cause very sharp caustics, which when used
with a low photonnumber, probably lead to only some noisy specks being rendered.
-Use QMC: Use quasi monte carlo sampling, can lead to cleaner results, but also
can sometimes cause patterns.

Since the photonlight has no meaning to Blender, when using photonlights and
switching back to the internal render, the light doesn't do anything, and no
type button will be selected. The lightsource can still be selected, but unless
switching to yafray, no parameters can set.

Apologies to Anexus, I had no time to really do something with your code,
I'll still look at it later, to see if I can improve anything in my implementation.
2004-07-28 22:37:12 +00:00
268da28875 As requested; the Ramp shaders have same blending operators as were added
for texture blending.

Also made the popups for this blending stuff in more logical order.
2004-07-28 20:20:43 +00:00
11ec0170cf Both transparent render and Unified render now behave with old speed
again. Use raytraced material, or set the "full Osa" option if you
like slow rendering, but with nice specular/shading/texture AA.
2004-07-28 12:27:28 +00:00