Commit Graph

395 Commits

Author SHA1 Message Date
17fdca3372 Made preview render only use non-threaded tile processor, got reports
of crashes, and noticed here theres something not well functioning
with ghost & threads, probably. Will test that tomorrow more.
2006-01-31 23:25:53 +00:00
5e3170fafd Three features;
- Live scanline updates while rendering
Using a timer system, each second now the tiles that are being processed
are checked if they could use display.
To make this work pretty, I had to use the threaded 'tile processor' for
a single thread too, but that's now proven to be stable.

Also note that these updates draw per layer, including ztransp progress
separately from solid render.

- Recode of ztransp OSA
Until now (since blender 1.0) the ztransp part was fully rendered and
added on top of the solid part with alpha-over. This adding was done before
the solid part applied sub-pixel sample filtering, causing the ztransp
layer to be always too blurry.

Now the ztransp layer uses same sub=pixel filter, resulting in the same
AA level (and filter results) as the solid part. Quite noticable with hair
renders.

- Vector buffer support & preliminary vector-blur Node
Using the "Render Layer" panel "Vector" pass button, the motion vectors
per pixel are calculated and stored. Accessible via the Compositor.

The vector-blur node is horrible btw! It just uses the length of the
vector to apply a filter like with current (z)blur. I'm committing it anyway,
I'll experiment with it further, and who knows some surprise code shows up!
2006-01-31 21:49:05 +00:00
8e9222ec21 More simple fixes to cleanup warnings and what not:
extern/bullet/BulletDynamics/ConstraintSolver/SimpleConstraintSolver.h
        added newline at end of file.
 intern/boolop/intern/BOP_Face2Face.cpp
        fixed indentation and had nested declarations of a varible i used
                for multiple for loops, changed it to just one declaration.
 source/blender/blenkernel/bad_level_call_stubs/stubs.c
        added prototypes and a couple other fixes.
 source/blender/include/BDR_drawobject.h
 source/blender/include/BSE_node.h
 source/blender/include/butspace.h
 source/blender/render/extern/include/RE_shader_ext.h
        added struct definitions
 source/blender/src/editmesh_mods.c
 source/gameengine/Ketsji/KX_BlenderMaterial.cpp
 source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
 source/gameengine/Ketsji/KX_RaySensor.cpp
        removed unused variables;
 source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
        changed format of case statements to avoid warnings in gcc.

Kent
2006-01-30 19:59:33 +00:00
6b7c992920 Bugfix: missing faces on edge of image
Yesterdays commit slightly extended clipping area for window, to ensure
no empty borders get rendered. Unfortunately it reveiled a case in code
that was never handled; clipping code was throwing away good faces. Old
bug... but apparently never showed up?
2006-01-30 16:23:14 +00:00
e193648595 Created threadsafe MEM_malloc versions in BLI_threads.h, now in use
for compositing code.

Officially malloc/calloc/free is threadsafe, but our secure malloc system
requires all memory blocks to be stored in a single list, so when two
threads write in this list you get conflicts.
2006-01-30 11:09:50 +00:00
b01b574656 When using Duplicated Objects (like vertex dupli) the original isn't
rendered anymore, to prevent overlapping situations. This worked before.

Note; group dupli stuff will test later. :)
2006-01-29 23:45:11 +00:00
6dd3fd2a26 Two issues solved in render recode;
- the sub-pixel masks for applying correct filters (gauss and friends)
  accidentally were y-flipped, causing bad looking results.

- zbuffer was clipping extremely narrow, causing border pixels to miss
  samples, and reveiling alpha that way (was in old render a prob too)
2006-01-29 23:01:33 +00:00
282fbcc763 Previous fix was in wrong part of code... not alpha adding was wrong, but
there was an error in the zbuffer code!

This should fix combinations of using Ztransp and Solid faces.
2006-01-29 18:04:15 +00:00
a4f05a17c3 Accidentally mixed up addAlphaUnder and addAlphaOver in merging solid and
ztransp layers, for OSA renders. :)
2006-01-29 17:40:06 +00:00
2f8708da02 Three-in-one commit:
- Compositor now is threaded
Enable it with the Scene buttons "Threads". This will handle over nodes to
individual threads to be calculated. However, if nodes depend on others
they have to wait. The current system only threads per entire node, not for
calculating results in parts.

I've reshuffled the node execution code to evaluate 'changed' events, and
prepare the entire tree to become simply parsed for open jobs with a call
to   node = getExecutableNode()
By default, even without 'thread' option active, all node execution is
done within a separate thread.

Also fixed issues in yesterdays commit for 'event based' calculations, it
didn't do animated images, or execute (on rendering) the correct nodes
when you don't have Render-Result nodes included.

- Added generic Thread support in blenlib/ module
The renderer and the node system now both use same code for controlling the
threads. This has been moved to a new C file in blenlib/intern/threads.c.
Check this c file for an extensive doc and example how to use it.

The current implementation for Compositing allows unlimited amount of
threads. For rendering it is still tied to two threads, although it is
pretty easy to extend to 4 already. People with giant amounts of cpus can
poke me once for tests. :)

- Bugfix in creating group nodes
Group node definitions demand a clear separation of 'internal sockets' and
'external sockets'. The first are sockets being linked internally, the latter
are sockets exposed as sockets for the group itself.
When sockets were linked both internal and external, Blender crashed. It is
solved now by removing the external link(s).
2006-01-29 11:36:33 +00:00
36e993a06f Two missing declarations in this include file. 2006-01-28 20:23:53 +00:00
9ce8944a05 Wow! bugfix in bf-blender again!
Simon C. gave me a nice crash.blend, in zbuffered transparent render.
Was a malloc that should become calloc... :)
2006-01-28 19:05:49 +00:00
45c7b2c5c2 Orange: made Compositing more interactive. It now has an event based
system tracking changes in nodes, making sure only these nodes and
the ones that depend, are executed.

Further the 'time cursor' now counts down to indicate which node is being
done.

Also: you now can disable the "use nodes" button in the header, edit all
changes, and when you press that button again it nicely executes the
changes.

Still on the todo:
- make compositing threaded
- find a way to nicely exit compositing on input events... so the UI
  keeps being responsive
- idea; a 'percentage' menu in header to enforce calculations on smaller
  images temporally
2006-01-28 15:21:04 +00:00
80bd3a1e98 Orange: fix for threaded rendering. Discovered that for some reason the
threads didn't seem to free allocated memory... while rendering an long
sequence, the 'virtual memory' size grew with about 20 meg per frame.
This appeared to be not related to using malloc in threads (works
properly), but just because threads were not closed properly.

I assumed that the call to SDL_CreateThread() also closes the thread
when finished... but that seems to be not the case. By using a call to
SDL_WaitThread() after the thread was finished the memory heap is stable
again.

This is something I've seen not documented anywhere... the SDL man
pages are horrible sparse; Take for example the official page:

http://manuals.thexdershome.com/SDL-1.2.5/html/sdlcreatethread.html
2006-01-28 10:30:16 +00:00
bb2e2b9ec8 Orange: previous commit for render-layers didn't update the case for
3d window preview-render.
2006-01-28 08:27:29 +00:00
4a52c6ac6f Orange; more render & compo stuff!
-> Rendering in RenderLayers

It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.

Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
  front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)

Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.

Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.

-> New Blur options

The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.

Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg

BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
1cde5efa3d Orange:
- Missing free in AVI writing
- time counter for animation render wasn't reset to zero on successive
  renders.
2006-01-25 16:47:20 +00:00
9da8961513 Orange: new pipeline separated calculus for window matrix from converting
data to renderdata. However, if a camera has a lens-ipo, this has to be
calculated correctly each time.

Actually, render system suffers like Blender itself from a weak time
system... which still is polluted by confusing globals. Should all work
now, but definitely needs attention later.
2006-01-25 15:09:17 +00:00
7d715c0693 Forgot to pass on current frame number to compositor, when render anims! 2006-01-25 12:25:10 +00:00
b969857767 Orange fix: jitter mask for OSA was off with half a pixel...
There seems to be a wrong offset for non-osa too, will look into that now.
2006-01-24 23:02:02 +00:00
f0dae325c3 Orange: enabled compositing in render pipeline.
- New Node "Composite" is output node that puts composited result back
  in render pipeline.
- This then also displays in the render window while editing
- But, only with Scene buttons option "Do Compositor" set
- Then, just press F12 or render anims to see the magic!

For clarity, the former 'Output" node is renamed to "Viewer".
2006-01-24 21:50:23 +00:00
3909f1d4a3 Prevent a mod by 0, should fix preview render crashes 2006-01-24 17:17:44 +00:00
9eadefee11 Scons changes needed to get it compile, works here! :) 2006-01-23 22:44:44 +00:00
042d612df2 Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:

Render:
- Full cleanup of render code, removing *all* globals and bad level calls
  all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
  default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
  tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.

Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
  easier use of movies in Blender

PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
  code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)

3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
  (pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
  rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!

Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
  with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
  done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
  window. (yes, output nodes to render-result, and to files, is on the list!)

The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
  system should be built from scratch. I can't really understand this code...
  I expect it is not much needed, especially with advanced layer/passes
  control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
  recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
  effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
  to check first the option to render to a Image window, so Blender can become
  a true single-window application. :)
  For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again

OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
Chris Want
cc2a332907 Optimization -frerun-cse-after-loop (included with -O2) was
causing render to crash on cygwin with gcc 3.4.4. Changed
declaration of shadepixel() argument "int facenr" to volatile.
Can anybody recommend a more elegant solution?
2006-01-12 18:34:07 +00:00
d4f48f43ef Orange: Ortho camera now gives correct z values for buffers too. 2006-01-11 23:15:48 +00:00
0665f0d647 Orange;
Until now, the zbuffer was written straight from the internal zbuffer,
which has values that are inverse-proportional (like 1.0/z) which makes
it very hard to use it for postprocess, like zblur or other composit effects
that require Z.

Based on info from ILM, the values stored for Z in exr files is the
actual distance from a camera. I think that's about time to migrate to that
convention!

By default now, after render, the z values are converted to floats. This
saves in exr files now, but not in the Iris Z files. That latter was a
blender-only anyway, so might be not a real hassle to drop. :)

You can see the difference in the image window, but notice the range now
is linear mapped from camera clipstart to clipend.

Note; I just discover that ortho Z values need a different correction...
2006-01-11 22:36:31 +00:00
b92fa41516 Orange: more float buffer support;
- Image textures use float colors now, when present. Works for mipmap too,
  and for AO skycolor (probes)
- Backbuffer option uses float buffers too. Note that rendering OSA will
  resample the backbuffer, filtering it... will need to be solved with the
  new composit stage
- LMB sampling in image window now shows float color too

+ bugfix in imbuf, filtering for float buffers had an error.
2006-01-11 18:39:19 +00:00
a0a3597b8b Orange:
Accidentally didn't disable the tests I did for 'translucent raytrace',
a cheapskate SSS method;

http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg

It slowed down render too much, was default on... but invisible! It needed
the F10 buttons "rt" to be huge (600-1000)
2006-01-10 19:23:11 +00:00
014aa7261e Orange branch: OpenEXR finally in Blender!
Credits go to Gernot Ziegler, who originally coded EXR support, and to
Austin  Benesh for bringing it further. Kent Mein provided a lot of code
for integrating float buffers in Blender imbuf and ImBuf API cleanup,
and provided Make and Scons and static linking.

At this moment; the EXR libraries are a *dependency*, so you cannot get
the Orange branch compiled without having OpenEXR installed. Get the
(precompiled or sources) stuff from www.openexr.com. Current default is
that the headers and lib resides in /user/local/

Several changes/additions/fixes were added:

- EXR code only supported 'half' format (16 bits per channel). I've added
  float writing, but for reading it I need tomorrow. :)
- Quite some clumsy copying of data happened in EXR code.
- cleaned up the api calls already a bit, preparing for more advanced
  support
- Zbuffers were saved 16 bits, now 32 bits
- automatic adding of .exr extensions went wrong

Imbuf:

- added proper imbuf->flags and imbuf->mall support for float buffers, it
  was created for *each* imbuf. :)
- found bugs for float buffers in scaling and flipping. Code there will
  need more checks still
- imbuf also needs to be verified to behave properly when no 32 bits
  rect exists (for saving for example)

TODO:

- support internal float images for textures, backbuf, AO probes, and
  display in Image window

Hope this commit won't screwup syncing with bf-blender... :/
2006-01-09 00:40:35 +00:00
f47899fc0f Orange; merger with bf-blender.
(Merging is *not* fun work, especially not with bugfixes in main branch
for code that got cleaned up in the other! Poor Hos... :)
2006-01-03 21:43:31 +00:00
750b9df26a Bugfix #3673
Threadsafe patch for environment maps type "Load" missed to include a
call, so still crashed. Only for non-debug builds though, so not reported
earlier.

From my cvs log 7 months ago:

"Added threadsafe patch from Martin.
Now envmaps of type "Load" should not give errors. I assume Martin tested!"

 :)
2006-01-03 20:06:08 +00:00
a085a41bc5 Bug #3681 The never ending bump mapping saga!
With the fix over a month ago, which added correct texture space vectors for
the bump, gave results so crispy that normals could invert after normalize.
This only when the normal "fac" slider was > 1.0.

The normals from imagetextures now get clipped to prevent it to result in
flipping normals. Will do more tests though...

Also note that the real good way would be have the tangent vectors for the
actual render normal available to perturb for bump, thats another story.
2006-01-03 19:49:38 +00:00
c1a4e42a75 Orange; another node update for reviewing.
Material Nodes now have input sockets, to override the actual Material
settings. If socket has no input, you can also edit Material settings here.
(Color picker, number slider).

Of course a load of options will become available here, first bugfixing!
(Oh, and enable fix thread render)
2006-01-02 17:40:03 +00:00
763695c0e8 Orange; made Node types Texture and Geometry integrated in render. Means
the coordinate outputs now have correct dx/dy vectors for Image AA, and
texture delivers correct intensity, rgb, alpha and normal.

Note; we need a "Vector Mapping" node, to do 2d/3d mapping, like in the
Material "Map In" panel.
2006-01-02 15:32:17 +00:00
ea7538dca6 Orange: more noodle updates!
**** NEW: Group Nodes

Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.

This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)

So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.

Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).

What works now:

- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.

- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.

- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.

- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.

What needs to be done:

- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.


**** NEW: Socket Visibility control

Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.

A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).

Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.

To be done:
- a way to hide individual sockets, like with a RMB click on it.

**** NEW: Nodes now render!

This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.

What needs to be done:

- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc

Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.

Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.

OK... that's it mostly. Now test!
2006-01-02 13:06:05 +00:00
9710d4c84c Orange <-> bf-blender conflict, with 2.40 saved files the version-patch to
initialize the (soon obsolete) material layers was skipped, causing it all
to be rendered black.
2006-01-01 16:37:21 +00:00
9df1460777 Christmas coding work!
********* Node editor work:

- To enable Nodes for Materials, you have to set the "Use Nodes"
  button, in the new Material buttons "Nodes" Panel or in header
  of the Node editor. Doing this will disable Material-Layers.

- Nodes now execute materials ("shaders"), but still only using the
  previewrender code.

- Nodes have (optional) previews for rendered images.

- Node headers allow to hide buttons and/or preview image

- Nodes can be dragged larger/smaller (right-bottom corner)

- Nodes can be hidden (minimized) with hotkey H

- CTRL+click on an Input Socket gives a popup with default values.

- Changing Material/Texture or Mix node will adjust Node title.

- Click-drag outside of a Node changes cursor to "Knife' and allows to
  draw a rect where to cut Links.

- Added new node types RGBtoBW, Texture, In/Output, ColorRamp

- Material Nodes have options to ouput diffuse or specular, or to use
  a negative normal. The input socket 'Normal' will force the material
  to use that normal, otherwise it uses the normal from the Material
  that has the node tree.

- When drawing a link between two not-matching sockets, Blender inserts
  a converting node (now only for value/rgb combos)

- When drawing a link to an input socket that's already in use, the
  old link will either disappear or flip to another unused socket.

- A click on a Material Node will activate it, and show all its settings
  in the Material Buttons. Active Material Nodes draw the material icon
  in red.

- A click on any node will show its options in the Node Panel in the
  Material buttons.

- Multiple Output Nodes can be used, to sample contents of a tree, but
  only one Output is the real one, which is indicated in a different
  color and red material icon.

- Added ThemeColors for node types

- ALT+C will convert existing Material-Layers to Node... this currently
  only adds the material/mix nodes and connects them. Dunno if this is
  worth a lot of coding work to make perfect?

- Press C to call another "Solve order", which will show all possible
  cyclic conflicts (if there are).

- Technical: nodes now use "Type" structs which define the
  structure of nodes and in/output sockets. The Type structs store all
  fixed info, callbacks, and allow to reconstruct saved Nodes to match
  what is required by Blender.

- Defining (new) nodes now is as simple as filling in a fixed
  Type struct, plus code some callbacks. A doc will be made!

- Node preview images are by default float

********* Icon drawing:

- Cleanup of how old icons were implemented in new system, making
  them 16x16 too, correctly centered *and* scaled.

- Made drawing Icons use float coordinates

- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
  icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)

- Skipped scaling and imbuf copying when icons are OK size


********* Preview render:

- Huge cleanup of code....

- renaming BIF_xxx calls that only were used internally

- BIF_previewrender() now accepts an argument for rendering method,
  so it supports icons, buttonwindow previewrender and node editor

- Only a single BIF_preview_changed() call now exists, supporting all
  signals as needed for buttos and node editor


********* More stuff:

- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
  argument for GL_FLOAT rects

- Made the ColorBand become a built-in button for interface.c
  Was a load of cleanup work in buttons_shading.c...

- removed a load of unneeded glBlendFunc() calls

- Fixed bug in calculating text length for buttons (ancient!)
2005-12-28 15:42:51 +00:00
72d805f17d Orange: monday merger with bf-blender (loadsa bugfixes).
ALso: a bit tidying up in editaction.c and python Object.c
2005-12-19 18:56:08 +00:00
92e1e16429 Bugfix #3608
More bump issues... Env made very nice examples, but all of it quite nasty
to solve.
Three improvements I found nevertheless:

- bug in mipmap code for bump gave errors in one derivate, causing aliasing
- when Image texture option "Clip" was used, the imagetexture function
  returned wrong value, causing the caller to create own normal based on
  color (zero!).
- Mipmapped bump now also interpolates the samples (never did this...)
2005-12-19 14:00:32 +00:00
60b22c1e71 #3598
Uninitialized 'alpha' flag in Image texture could cause render errors.
Didn't show in OSX though... (stupid system here inits stack to zero).
But, Ken Hughes found this, so all credits are for him!
2005-12-19 11:30:52 +00:00
d48c9c416d #3592
Normal rendering; adding gamma corrected halo could cause NaN's because
of a negative sqrt().
2005-12-19 10:31:32 +00:00
128b187db1 Orange: New option "Shadow Bias", to extend the boundary between shadow or
no shadow a little bit. Uses same threshold function as the "Bias" button.
(That latter still works, and will use an automatic bias value based on the
geometry, to prevent terminator errors in raytracing).

Anyhoo, with this manual bias you can get rid of terminator problems for
weird diffuse shaders now as well (like tangent or fresnel).

Committed a few more files than needed, that's just code cleanup.
2005-12-17 14:05:40 +00:00
4f235db6e6 Tuesday merger of Orange branch with bf-blender 2005-12-13 20:32:39 +00:00
b284a95222 Bugfix #3552
Another ancient bug in unified render... the lamphalo wasn't filled in
correctly over sky, especially when the background had halos (or stars).

Only shows when using filters other than box though.
2005-12-13 13:17:29 +00:00
e0dc311fc2 With the introduction of fixed edge arrays in Mesh, the options to render
wire frame became very limited... the information of faces (vertex colors
and UV reside there) got lost.
Solved it nicely with creating a large index table, and use bsearch() to
get quickly the matching information.

Then I noticed the render code needed fixes too for wire, no proper UV's
were calculated over the wire edge.
2005-12-13 12:41:17 +00:00
bf412134d4 Bugfix #3556
Unified render didn't treat the alpha for raytraced transparent correct...
unified is based on layering with alpha, so it cannot support alpha in
raytraced transparent correctly.

I'm going to kill unified one day... its giving me headaches. :)
2005-12-12 21:16:24 +00:00
7daa8d0bca Sunday merger of orange branch with bf-blender 2005-12-11 23:04:27 +00:00
d7bee8c117 Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
   enables to control the entire animation system of the Group.

Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
   to override NLA/action of any Grouped Object.

For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.

Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.

Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.

-> Recoded entire duplicator system

The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.

By centralizing the code for duplicating, more options can be easier added.
Features to note:

- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too

Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.

-> Library System

- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.

-> Fixes

- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
  causing unnecessary slowdown on reading.

Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
ccb285006c Bugfix #3526
Division with zero caused wrong pixels to be rendered with Ortho camera.
2005-12-09 17:22:50 +00:00