Commit Graph

556 Commits

Author SHA1 Message Date
5376df2689 Fixed all gcc 4 warnings in blenkernel. Found 2 potentially harmful
unintialized variables in the verse code, verse_session.c:451 and
verse_object_node.c:339, those are properly initialized now.
2006-10-26 23:34:44 +00:00
11b4d14ab6 Missing initialization of 'shadow alpha' in new materials. Caused by not
copying this file from my laptop I used to code it... :)
2006-10-14 13:50:11 +00:00
8640615ac6 Bug #4616
Node Editor: selecting Material buttons in header crashed, when no buttons
window was opened. Code didn't check for proper window it was called from.

Also: autoname "Cyan" was spelled dutch! :)
2006-07-05 11:33:09 +00:00
2670797e8a Plumiferos report:
The new Material "LightGroups" only worked with lamps in visible layers.
Now also lamps from the group that are not visible are included for
rendering, ensuring that a lightgroup always works on that material,
disregarding layer settings (unless lamp is type 'layer lamp').
2006-06-26 17:50:48 +00:00
f7d38ee181 Bugfix #4370
Silly: when using vector blur on a curve or text object, without having a
material assigned to it, the default material didn't get initialized OK
for vector blur, causing random streaks.
2006-06-20 15:44:25 +00:00
4506e65902 More preview fixes, after irc reports:
- Ztransp looked weird in Node previews, only showing the backfacing pixels
- previous change in preview.blend accidentally set camera clipping too low
  for correct display of lamp preview
- refresh issue solved in preview when using Node shaders with ray-mirror
2006-06-20 14:32:42 +00:00
b159b27329 Bugfix 4346
Node Shaders: the code checking for all required texture coordinates did
not test Groups inside a tree, so textures didn't render properly always.
2006-06-17 12:26:28 +00:00
3356c4ba2f The new "transmissivity" option for ray-transparent now can be controlled.
By default it is disabled (depth 0.0), so rendering is as usual.

The meaning of "depth" and "falloff" will be extensively shown in the
release log pages. Coming soon!

(Patch provided by Ed Halley)
2006-06-16 13:11:21 +00:00
6d98cce4a6 Blend method fixes by Fred van Essen.
Also renames "Lightness" to "Value".
2006-06-05 09:55:39 +00:00
9ab30b4acb Patch from Fred van Essen: six new blending modes.
http://mediawiki.blender.org/index.php/BlenderDev/BlendingModes

Functional in Node editor and Material Ramps.
2006-06-03 13:26:39 +00:00
3be0c804ae Bugfix #3725
When you disable a texture channel using Displacement in a Material, the
initialize code and renderconvert code still though this was active.
2006-04-10 10:14:26 +00:00
6f62023850 - Added option 'convert to premul' to AlphaOver node in Compositor
- Fixed mix mode "Overlay", it was missing a multiplication with 2 :)
- small bugix in Matts nodes commit, wrong pointers transfered to coltobw()
2006-02-17 15:44:46 +00:00
1c7187f4fc Added blending type "Overlay" to options for Mix node & ramp shaders.
The description is here; it blends nicely bright parts.
http://www.pegtop.net/delphi/articles/blendmodes/overlay.htm
2006-02-14 18:41:34 +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
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
4bc4eac1e5 Orange; tweaks for further integrating node editing in UI
- Previews inside groups now get updated too
- Activating nodes inside of groups updates UI and preview render correctly
- Entering/leaving groups updates UI and previewrender
- Material Node: now draws socket name next to colorpicker for inputs
2006-01-03 11:34:28 +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
8d35213990 More node goodies!
First note; this is a WIP project, some commits might change things that
make formerly saved situations not to work identically... like now!

------ New Material integration ------

Until now, the Node system worked on top of the 'current' Material, just
like how the Material Layers worked. That's quite confusing in practice,
especially to see what Material is a Node, or what is the "base material"

Best solution is to completely separate the two. This has been implemented
as follows now;

- The confusing "Input" node has been removed.
- When choosing a Material in Blender, you can define this Material to be
  either 'normal' (default) or be the root of a Node tree.
- If a Material is a Node tree, you have to add Nodes in the tree to see
  something happen. An empty Node tree doesn't do anything (black).
- If a Material is a Node Tree, the 'data browse' menus show it with an
  'N' mark before the name. The 'data block' buttons display it with the
  suffix 'NT' (instead of 'MA').
- In a Node Tree, any Material can be inserted, including itself. Only in
  that case the Material is being used itself for shading.

UI changes:

Added a new Panel "Links", which shows:
- where the Material is linked to (Object, Mesh, etc)
- if the Material is a NodeTree or not
- the actual active Material in the Tree

The "Node" Panel itself now only shows buttons from the other nodes, when
they are active.

Further the Material Nodes themselves allow browsing and renaming or adding
new Materials now too.

Second half of today's work was cleaning up selection when the Nodes
overlap... it was possible to drag links from invisible sockets, or click
headers for invisible nodes, etc. This because the mouse input code was
not checking for visibility yet.
Works now even for buttons. :)
2005-12-29 18:08:01 +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
80eb4d3b9e Big commit in orange: Interface icons for materials, textures
world and lamp. Also for images in pupmenus.
Also preparation for work on using preview images in imagebrowser.

-- Andrea
2005-12-21 22:21:43 +00:00
c492729b3a New feature: "Stress" texture input channel
(As usual movies disappears after while)

Face example showing stress values on a blend. White is stretch, black
is squeeze
http://www.blender.org/bf/0001_0014.avi

Quick test with softbody stretch
http://www.blender.org/bf/0001_0100.avi

Based on the difference of the "Orco" (original undeformed coordinate)
and the actual render coordinate, a stress value is computed to make
textures react to stretching or wrinking skin.

The texture coordinate is neutral (0) on relaxed state. -1 is squeezed
to zero, +1 is stretched to infinity.
Note that scaling (object itself or parent) also will result in
stress values.

The reason for the huge commit is a cleanup in allocating memory for
the vertices. These were growing too large with new options, so now it
allocates the optional coordinates dynamically.
Saves about 20 MB memory per 1M vertices already. But best of all is that
I now can add much more fun... so tangents, here we come!
2005-12-08 22:05:42 +00:00
dd1f6c649a Orange bramch:
New diffuse shader, "Fresnel", which using existing fresnel formula.
Since it hilights edges (away from lamp), nice to fill darker parts with
the new layering system.

Weird stuff though;
http://www.blender.org/bf/0001_0040.avi
(Movie disappears in a couple of days!)

Note; for ray-shadow you need to use the Bias, to prevent 'terminator'
problems. I made that option default now.
2005-12-04 20:43:41 +00:00
aa939b8599 Orange branch feature; Material Layering
(WIP, don't bugs for this in tracker yet please!)

- New Panel "Layers" in Material buttons, allows to add unlimited amount
  of materials on top of each other.
- Every Layer is actually just another Material, which gets rendered/shaded
  (including texture), and then added on top of previous layer with an
  operation like Mix, Add, Mult, etc.
- Layers render fully independent, so bumpmaps are not passed on to next
  layers.
- Per Layer you can set if it influences Diffuse, Specular or Alpha
- If a Material returns alpha (like from texture), the alpha value is
  used for adding the layers too.
- New texture "Map To" channel allows to have a texture work on a Layer
- Each layer, including basis Material, can be turned on/off individually

Notes:

- at this moment, the full shading pass happens for each layer, including
  shadow, AO and raytraced mirror or transparency...
- I had to remove old hacks from preview render, which corrected reflected
  normals for preview texturing.
- still needs loadsa testing!
2005-12-04 14:32:21 +00:00
a494a76e9e Finishing touch for hair strand shadows;
- raytracing code now uses cylinder-line intersect for strands. It used
  to intersect with the screen-aligned strand quads, giving too many
  misses for tracing.
  Note; mirror for hair is still not well supported!

- added in Materials a choice for whether a material is Traceable for
  raytracing or whether it is part of Shadow buffers. This way you can
  exclude hair strands from raytracing, but still get shadowbuffers for it.
2005-11-27 12:19:12 +00:00
9bf198bbca Finished hair strand render project (well, for release), also with a good
doc;

http://www.blender3d.org/cms/Hair_Strand_Rendering.722.0.html

- added width control for strands
- made tangent (anisotropic) render an option
  (so you can render strands more solid, like metal/wood)

Also:
- ALT+A anim playback with static particles made cursor flashing
2005-11-12 16:22:10 +00:00
03e1ec988b - Added "anisotropic" rendering for static particle hair strands.
This means the diffuse and specular shaders don't use the normal
  for hair (which is actually undefined, a hair is micro cylinder) but
  it uses the tangent vector (vector in direction of hair).

For Diffuse, it computes a fake normal now, representing the optimal
hair normal pointing towards the light. All current builtin shaders
work with this, including ramps.

For Specular, it uses another formula to remap dot products for all
lines that now use the tangent vector instead of the normal:

dot = vector * tangent
dot = sqrt(1.0 - dot*dot)

Gives better results than using the 'fake' normal for diffuse. Officially
(according the papers) this could be used for diffuse too, but then hair
becomes very flat. Now you can control the flatness easily with ramps or
using Oren-Nayer for example.

Example image (disappears in some weeks)
http://www.blender.org/bf/rt9.jpg

- Added new texture channel "Strand" to apply textures on hairs over the
  length of hair (1 dimensional). Orco now gives 1 fixed coordinate for
  the entire hair, based on where it starts.
  Note; UV doesn't work yet. Nor vertexcolor.

http://www.blender.org/bf/rt10.jpg
2005-09-29 13:19:07 +00:00
1295ed872c Regression file teapot.blend didn't render... this due to a hack removal of
a month ago (trying to cope with vertexcolor 'paint' and 'light'.)
Forgot to add the correct check for calculaing UV texture coords, needed to
have vertexcolor 'paint' working.
2005-07-25 09:19:23 +00:00
8301d7ad00 Bug fix #2762
Quite harmless, but was lazy code...
When you choosed "Vertex Color Paint" material, the init_render_material()
also set the "Vertex color Light" option, because that flag was checked on
during render to detect vertex colors.
Now it has proper checks in render code.
2005-07-11 11:01:06 +00:00
28a1e8277b Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs

A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;

- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes

Armatures;

Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!

Important to note is;

1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.

- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.

TODO NOW;

- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.

TODO LATER;

We now can do loadsa new nifty features as well; like:

- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...


Bugfixes;

- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change

-Ton-
2005-07-03 17:35:38 +00:00
Alexander Ewering
08169d7fba The overlapping curves/material indices problem got a bit out of control.
- For avoiding the 'overlapping character problem' in Text objects, I had
   changed the sorting code for filling nurbs to use nu->charidx (a new
   variable incremented with each new character) instead of nu->mat_nr
   (which used to work for material indices inside a 2D Curve).

 - This broke material indices in normal 2D Curves completely, thus:

 - nu->charidx is now not only used for seperating
   characters in text objects for filling, but also for normal 2D curves
   when they contain material indices. In fact, charidx is just set to
   the material index.

 - There's compatibility code in readfile.c that sets nu->charidx to nu->mat_nr
   when reading curves from files that are not text objects

 - So, the big conclusion: Instead of using material indices for creating
   'filling groups', filldisplist() now uses nu->charidx, which is set
   appropriately when reading old files and assigning/deleting material
   indices in curves.

 - This is all pretty obscure and hard to explain. If I haven't been clear,
   ask.

 - If it breaks anything, complain!
2005-06-25 22:51:51 +00:00
425f295604 Patch submitted by Jorge Bernal (lordloki) and Jonathan Merritt.
This will add Minneart diffuse and WardIso specular to our shader menu.
Minneart gives nice control over darkness/brightness areas, the wardIso
over 'plastic' style sharp or fuzzy specular.

Webpage is being made with nice samples. Will be in release log.

Jorge: one change is in the do_versions, you inserted it on wrong location.
2005-04-17 17:43:07 +00:00
1bbc60f63e Bug #2444
Jkey, for showing spare render page, didn't work when using ztransp
material, or buttons F5 open or shaded view.... quite strange eh!
Caused by init-render-material setting R.flag to use Ztransp render.
Globals causing havock yes...
2005-03-23 12:47:23 +00:00
8fbaca0878 Removed include render.h
It *should* be there, but its a bad-level-include. The bad_level_calls.h
makes it compiling nice, but that wasnt the purpose.
Error is in the winstuff.h in render.h most likely
2004-12-27 20:58:40 +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
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
81702927a8 Bufix for #1940
With material slider "Ray Mir" set non zero, but with toggle "Ray Mirror"
off, Blender accidentally entered a part of raytracing code, screwing up
the alpha value of the result.
2004-12-03 10:16:29 +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
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
44a74dbf29 - added editmesh_[de]select_by_material function
- added mesh_set_smooth_flag, mesh_delete_material_index function
 - isolated some globals
 - got rid of reliance on meshdata in buttons_editing.c and material.c
2004-03-20 23:59:57 +00:00
aedf456938 - split the data structures that actually constitute a mesh
(MVert,MFace,etc) off into DNA_meshdata_types.h, to isolate areas
    of source that actually edit mesh *data* vs. areas that just edit
    mesh object information.
2004-03-20 22:55:42 +00:00
66525b1b6f - another fix for incorrect Osa vectors during tracing... I've now solved
it by precalculating all needed Osa vectors when rendering glass, this
  because it is unpredictable what is exactly going to be needed after.
- a hint that this should be done better is in the code... will mostly
  improve sharpness and a bit rendertime though
(thanks bugmaster intrr!)
2004-01-23 21:58:19 +00:00
5aad4bfceb - fix for raytrace render; when you render ray_transp material, it didn't
recalculate the O.dxno and O.dyno for each pixel. This causes scanline
  errors (stripes) when in same scanline something else is called that
  calculates O.dxno/dyno...
2004-01-23 18:29:14 +00:00
1170f5f6ed Displacement map
- changed code to make use of actual textures, not the hackish
  'externtex', which is only for tools
- added a 'displacement' vector in ShadeInput, and moved calculation of
  displacement vector to texture.c itself. So it works with stencil, but
  also for options as 'add', 'mult' and 'sub'.
- for RGB textures it uses the brightness value of color for displace
- for stucci, and plugin textures returning a normal, it uses that

- Also: wrote call in end of preparing renderfaces, to split non-flat
  quad faces in triangles. gives a lot fewer errors in displace textures,
  but also raytracing irregular subsurfs goes better now.

- texture mapping that works for displace: orco, sticky, global, obj, normal.
  UV not yet. Reflection-displace? uhh! :)
2004-01-05 20:25:07 +00:00
8fbff1a3b7 - Fresnel V4.0
Based on feedback (thnx phase!) I found a big disadvantage of the 'real'
fresnel formula. It doesnt degrade to 0.0, causing 2-3 times too many
rays being fired compared to the previous one. So; a lot slower.

Now committed is a hybrid which allows (close to) real, and nice artistic
freedom, *and* it really goes to 0.0 and 1.0, assisting nicely in optimal
render times.
A real doc how it works (with pics) will be made before real release.

- Fixed bug in raytrace: the first renderpass didn't use fresnel for mirror.
- Fixed bug in previewrender, now it closer matches how fresnel renders
2003-12-23 22:31:48 +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
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
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
90541541c3 Added all necessary BPY_extern.h include files to the .c files.
Updated the Make environment to point to the correct location. The include
paths were still pointing to source/blender/bpython/include while it should be
source/blender/python.
I did not encounter the build problems because I'm always working with the
autoconf build environment.
2003-11-23 14:28:46 +00:00
Chris Want
e7d3e24a0e Got rid of many #include "BPY_extern.h"
Homework from Michel: do grep BPY source/blender/src/*
and see if there is anything that needs fixing.
2003-11-22 20:21:59 +00:00