Commit Graph

103 Commits

Author SHA1 Message Date
3a8c6c81d8 Subsurface scattering:
Documentation on the settings, known limitations and implementation
info can be found here:
http://www.blender.org/development/current-projects/changes-since-243/subsurface-scattering/
2007-05-03 21:37:52 +00:00
064bcdbb31 Bugfix #5827
Preview render in buttons was not refreshed when changes in a material
happened, without preview visible. (like editbuttons, active mat index).

Now on re-entering material buttons, a re-render happens in these cases.
2007-01-26 15:34:32 +00:00
253432bfc7 The Big Image refactor!
Please read:
http://www.blender3d.org/cms/Imaging.834.0.html

Or in short:

- adding MultiLayer Image support
- recoded entire Image API
- better integration of movie/sequence Images

Was a whole load of work... went down for a week to do this. So, will need
a lot of testing! Will be in irc all evening.
2006-12-20 17:57:56 +00:00
c2edcd4879 Siggraph show commit!
- pending commit for OSX intel systems, with intel graphics. These now call
  an extra swapbuffers after glFlush(). Code is ifdeffed, and doesnt affect
  other systems.

- show-off commit: option to have transparent nodes over the composite
  result. Only draws Image for active Viewer Node now, and image doesnt
  translate nor zoom (which isnt bad though).
  Set in themes the alpha color of "node backdrop" to make nodes
  transparent.
2006-07-31 19:23:42 +00:00
d82ec08331 Bugfix #4625
Using the 3d window preview render, fluidsim objects gave drawing errors.
Was caused by missing object recalc signals after creating the render
database (happens on different resolutions for fluidsim).

Note to self: the separation between 'render' and 'display' is still a
weak part in the Derived/Displist code...
2006-07-06 10:10:41 +00:00
bb9cafc257 Bugfix #4557
Report noted the slow icon renders for menus, which indeed is an issue,
especially when texture images need to be loaded (not to mention that
will eat up loads of memory).

Added a flag in scene to disable loading of images, makes it 50 times
faster, at least :)
2006-07-02 18:26:20 +00:00
9ecffb4314 Campbell report:
Not clearing the value for 'parts rendered' caused 3d previewrender to
sometimes fail doing updates (when an escape happens during converting
render data).
2006-06-28 12:53:57 +00:00
46d3f1efb3 Found one more case for drawing GL_FLOAT in preview render system.
Removed that for ATI issues too...
2006-06-25 10:11:53 +00:00
7a95aad832 Bugfix #4397
3D Window preview render accidentally called Yafray. That's a not working
feature yet. Could work for external renders though, but that's for
another time i think. :)
2006-06-22 09:35:09 +00:00
0deed7d1d7 Switched the glaDrawPixelsSafe to glaDrawPixelsSafe_to32 in drawing the
previews in buttons and 3d window.

Drawing in frontbuffer a GL_FLOAT rect seems to be instable for ATIs still.
2006-06-20 20:05:10 +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
81a7271351 Preview render fixes:
- previous preview.blend rendered OSA, is too slow, especially for raytrace.
  now made it an extra option for buttons preview. (icons render without).
- made monkey one level subsurf lower for speed
- in previewblend, made the tiled cube environment entirely closed, so a
  mirror reflection will show nicer.
2006-06-20 09:31:54 +00:00
e384f4d6f6 Fix #4358
Was on the todo as well; previews in Shader Nodes didn't get cleared on
re-renders, noticable when you switch preview type (i.e. sphere -> cube).
2006-06-19 17:29:44 +00:00
ba5880aa73 === preview icons ===
- changed preview type of halo materials
- halo materials are also shown with alpha=255 like in preview window
2006-06-15 11:23:51 +00:00
6deb0cf41a Small fixes in 3d window preview render, discovered while making regression
files for it :)

- on load, the rendering was done twice
- changing area size didn't correct the render
2006-06-15 09:44:52 +00:00
c0c7c4ba14 Fixes for preview render in buttons:
- restored type choice compatiblity (plane, sphere, cube)  with 2.41   release (sorry, will break saved files with CVS... my fault, should
  have known.)

- removed lamp choices (lights now are different per preview, no fixed
  choices).

- added checkered plane behind the plane preview. nicer for halos.
2006-06-14 18:04:26 +00:00
5b756f7b8a * preview.blend fixes
The preview.blend now shows raytracing/transparency, and also turns on and off
the fake shadow based on the 'shadbuf' setting.

Also included an updated preview.blend file to accomodate this.
2006-06-09 15:55:27 +00:00
5468351d6e Texture button preview:
- now draws intensity value correct (black/white was inversed)
- added option to show texture alpha too
2006-04-01 14:08:57 +00:00
7930c40051 Made the most critical variables in render pipeline "volatile", especially
the ones that get changed within threads, to communicate with the main
thread.

(Part of the long quest to get threaded render safe, especially in Linux)
2006-02-24 10:20:31 +00:00
9ef9d66a26 - Preview render (buttons) was executing the 'data ipos', causing inserting
keys with IKEY in buttons to not work.

- Crash in opengl while rendering was caused by the fact that scanline
  updates are drawn in the main thread, whilst the actual render thread
  then can already be doing different stuff.
  Especially with many layers & passes it's getting confusing easily :)

  Convention now is that scanline render updates only happen while the
  thread is looping over scanlines. As soon as it reached the last, no
  drawing happens, not even to update the last segment.
  This isnt a problen, since any finished tile is drawn again entirely.
2006-02-15 09:35:01 +00:00
ff7f544dec Preview rendering improvement;
Until now, on each mouse/key event preview render restarted with first tile.
It now rememers where it was, and continues rendering.
Also tried to get threaded preview working, but its more work than I can
spend right now. Back to bugs :)
2006-02-13 19:27:16 +00:00
ed4cc927a7 Couple of features/fixes:
- Compositor now frees memory of buffers internally used in groups
  immediately. This wasn't part of the event-based cache anyway

- New option: "Free Texture Images" (in render Output panel). This
  frees after each render of each scene all images and mipmaps as
  used by textures. As reference it prints total amount of MB freed.

- Render stage 'creating speed vectors' had no ESC checking yet

- Made drawing scanline updates during render draw 1 scanline less...
  dunno, still hunting for weird opengl crashes.

- 3D preview render didn't properly skip sequence or composit render.
2006-02-11 23:17:41 +00:00
5e3d30c276 Feature:
- Appending Images now re-assigns relative paths, to match with the file
  as currently being used

Bugfix:
- Memory error in creating preview render rects... gave no issues here,
  but i guess that's not saying anything! Hope its more stable now. :)
2006-02-09 19:47:53 +00:00
839b338be3 New:
- ZTransp render now also delivers Z values and Speed vectors in passes
  Note that speed vectors accumulate within a pixel to store the minimum,
  so rendering ztransp on top of a non-moving plane won't give speed...
  Best results you get is by rendering it in a separate layer.

  The Z value stored is the closest visible transparent face in the pixel.

Fixes:

- Render to 'spare page' has been enabled again. Because of the strict
  separation of Render and UI, but especially because a 'render result' now
  can consist of unlimited images, I've not made this a Render feature.
  Instead, the render-window itself stores the 'spare' image... I also
  had to change the convention for it a bit.

  Now, instead of having two "render buffers" (which was a render feature),
  the RenderWindow will store each previous frame on a re-render. This
  storing will only start after you've pressed 'Jkey' once, but then always
  will happen for as long the rendered image is same size as previously.
  For clarity, I've also renamed the window title, to 'previous frame'.

- RenderWindow shows alpha again on Akey

- Display of the Zvalues in ImageWindow has been tweaked. White now denotes
  closest, and the color range goes from camera clip-sta to clip-end.

- Bugfix: on splitting/merging/duplicating windows, the 3D Previewrender was
  not always freed correctly, potentially causing crashes or memory leaks.
2006-02-08 16:51:09 +00:00
f45546a1d3 iImage based Vector Blur
After a couple of experiments with variable blur filters, I tried
a more interesting, and who knows... original approach. :)

First watch results here:
http://www.blender.org/bf/rt0001_0030.avi
http://www.blender.org/bf/hand0001_0060.avi

These are the steps in producing such results:

- In preprocess, the speed vectors to previous and next frame are
  calculated. Speed vectors are screen-aligned and in pixel size.
- while rendering, these vectors get calculated per sample, and
  accumulated in the vector buffer checking for "minimum speed".
  (on start the vector buffer is initialized on max speed).

- After render:
- The entire image, all pixels, then is converted to quad polygons.
- Also the z value of the pixels is assigned to the polygons
- The vertices for the quads use averaged speed vectors (of the 4
  corner faces), using a 'minimum but non-zero' speed rule.

  This minimal speed trick works very well to prevent 'tearing' apart
  when multiple faces move in different directions in a pixel, or to
  be able to separate moving pixels clearly from non-moving ones

- So, now we have a sort of 'mask' of quad polygons. The previous steps
  guaranteed that this mask doesn't have antialias color info, and has
  speed vectors that ensure individual parts to move nicely without
  tearing effects. The Z allows multiple layers of moving masks.

- Then, in temporal buffer, faces get tagged if they move or not
- These tags then go to an anti-alias routine, which assigns alpha
  values to edge faces, based on the method we used in past to antialias
  bitmaps (still in our code, check the antialias.c in imbuf!)

- finally, the tag buffer is used to tag which z values of the original
  image have to be included (to allow blur go behind stuff).

- OK, now we're ready for accumulating! In a loop, all faces then get
  drawn (with zbuffer) with increasing influence of their speed vectors.
  The resulting image then is accumulated on top of the original with a
  decreasing weighting value.

It sounds all quite complex... but the speed is still encouraging. Above
images have 64 mblur steps, which takes about 1-3 seconds per frame.

Usage notes:

- Make sure the render-layer has passes 'Vector' and 'Z' on.
- add in Compositor the VectorBlur node, and connect the image, Z and
  speed to the inputs.
- The node allows to set amount of steps (10 steps = 10 forward, 10 back).
  and to set a maximum speed in pixels... to prevent extreme moving things
  to blur too wide.
2006-02-06 22:11:50 +00:00
ed81ff405f Fix: buttons previewrender was re-rendering on scrolling a lot, this due
to rounding noise when trying to detect if previewsize changed. Made it
use a threshold now.

Fix: SHIFT+P in editmode is still push/pull, outside editmode it'll do
the preview render. (Note; editmode changes are not updated anyway!)
2006-01-30 19:39:05 +00:00
2d12365f7c Previewrender (buttons) now supports Lamp, Texture and Sky previews
again. One exception I didn't solve yet... for the Stucci texture.

In a next commit I will add the preview.blend, so people can play with it!

The rules for preview.blend are pretty primitive still... might become
a bit more advanced later. Here's what it uses now:

- If Object has name starting with 'p' it will get the to-be-previewed
  Material or Lamp assigned
- If Object has name starting with 't' its Material gets the texture
  assigned for Texture previews

The layer codes for current preview options are in DNA_material_types.h;

#define MA_SPHERE		0
#define MA_CUBE			1
#define MA_FLAT			2
#define MA_MONKEY		3
#define MA_SPHERE_A		4
#define MA_TEXTURE		5
#define MA_LAMP			6
#define MA_SKY			7

(SPHERE_A is sphere with alpha for icons)
2006-01-29 13:10:20 +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
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
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
ec01a66a6b Orange: Node previews now draw standard backdrop to show alpha better. 2006-01-04 12:41:13 +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
4650f7f8a9 Fake commit; just forgot to add this to the log;
A group node; named "Backlight"

http://www.blender.org/bf/g1.jpg
http://www.blender.org/bf/g2.jpg

And how it looks rendered:

http://www.blender.org/bf/g3.jpg (no Nodes)
http://www.blender.org/bf/g4.jpg (with Nodes)
2006-01-02 13:08:23 +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
d921d6be6f Orange: daily noodle updates;
- Texture Node: now displays 'intensity values' in node too, and has input,
  and shows in buttons when activated in Node editor. (no browsing buttons
  yet...)

- New: "Normal Node". This uses a new UI button, which allows to quickly
  input a normal vector, based on spherical coordinates.
  The Normal Node has optional vector input, and delivers a dot product
  then. This can be used as a blending factor between nodes, or for fake
  extra light in a certain direction.

- New: "Geometry Node". This actually replaces the Input node. It offers
  all coordinates (vectors) as being the starting point for shading and
  for textures. Note: for preview render this doesn't give much different
  results yet... this is the start for real render support!

- http://www.blender.org/bf/rt5.jpg
  The two new nodes in action

- Bugfix: the "Block" button (which delivers popups) did not return a
  correct event when nothing happened (mouse moved out), which could
  cause mouse clicks to be passed on to the queue.
2005-12-30 11:25:15 +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
17210112a1 Orange: Warning cleanup for Icons commit, missing declarations of some
calls caused icon hashing not to work too. Runs smooth here :)
2005-12-21 23:39:20 +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
485dd1d376 Orange; WIP commit for inclusion of "Tangent" vector in rendering.
This first implementation only supports it for Meshes with UV maps, and
only tangents in V direction.

Tangent diffuse:
http://www.blender.org/bf/0001_0080.avi
Tangent spec, diffuse, and bump:
http://www.blender.org/bf/20001_0080.avi

NOTE: since UV coordinates are still very badly subsurfed, this won't work
well for subsurf meshes... on the todo.

On the todo;
- generate tangents for meshes without UV (with some options)
- use tangents from Curve/Surface
- add the Ashkimin shader from tracker

-----

Important bugfix; curves didn't render anymore since yesterday. :)
2005-12-09 15:14:32 +00:00
d024452ebf Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.

Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
  groups.
- In Object buttons, a new (should become first) Panel was added, showing
  not only Object "ID button" and Parent, but also the Groups the Object
  Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
  temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group

But, the real power of groups is in the following features:

-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).

-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).

-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)

-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).

-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!

In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +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
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
8d940dfafe Random() issues with rendering...
- AO and soft shadow AreaLight tables were generated without fixed seed,
  causing animations to give unwanted amounts of noise.
- Made sure these tables now are calculated before render, with fixed seed
- Then found out the BLI_rand() has very bad seeding... it showed up as
  patterns. After some experimenting, found a nice method using noise.c
  hash tables. For compatibility with old code, named it BLI_srandom() to
  use this next to the BLI_srand(). This follows libc rand() and random()
  naming convention.
- Then of course threading should work... so made a BLI_thread_rand version
  of the calls. Now supports up to 16 threads, comments added in .h and .c

Result is stable animation render with AO and soft shadow. But, please
test and feedback!
2005-08-25 13:11:04 +00:00
b03a20d272 - got rid of silly #define ..._BIT, #define ... (1<<..._BIT) stuff
- switched almost all uiDefBut(..., TOG|BIT|..) to use UiDefButBit and the
   name of the actual bit define instead of just a magic constant, this makes
   searching the code much nicer. most of the credit here goes to LetterRip
   who did almost all of the conversions, I mostly just checked them over.
2005-08-03 18:48:22 +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
8e92ee8684 - remove all obsolete inclusions of BLI_winstuff.h (due to recent changes)
NOTE: BLI_winstuff.h was meant to be a wrapper around windows.h to handle
undefining various crap that windows.h defines. Platform specific headers
should only have to be included in a few places. This reduces the number
of inclusions of BLI_winstuff.h to 16 which is a much more reasonable
number (than the 144 or whatever it used to be)
2005-03-19 21:08:13 +00:00
b3bb3f06ba Some cleaning up of BLI_winstuff.h usage
- removed reference in render.h (really bad, shouldn't include a platform
   specific header so widely unless really necessary)
 - added M_PI, M_PI_2, M_SQRT, M_SQRT_2 defines to BLI_arithb.h... this is
   a better place as it is more the "standard" blender math header. left
   in winstuff.h as well for the moment for simplicity
 - other changes are patches to code so everything works ok with this
   shuffling.
2005-03-19 20:04:25 +00:00
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00