Commit Graph

635 Commits

Author SHA1 Message Date
de3a622095 Bugfix #3862
Wire render normals were exactly opposite to the normals for solid faces.
This caused displacement to work inverse too. Flipped them.
(Note; for shading normals are corrected to point towards viewer)
2006-04-09 17:14:55 +00:00
0ee101f9ad Bugfix #4066
Particle strands with a width set (like 10 pixels), and with extreme
bending of strands (like a very course subdivision), could create non-flat
quads. For speed reasons, the quad-to-triangle splitting was turned off
for hair, but in this case that should be done nevertheless.

Solves another Dandruff issue for furry bunnies!
2006-04-08 13:50:15 +00:00
703bbdfe11 Bugfix #4079
Rendering with 'Wire' material, and with Autosmooth set, made wire faces
get a zero'ed normal. Added exception handling code fir wire.
2006-04-08 10:02:20 +00:00
0a63b3c0ca Several minor fixes:
- Added part of Austin's msvc8 fixes (vector::erase function
  was "misused"), hopefully compiles better now.
- Ctrl-b now also bakes a selected fluidsim domain
  similar to the softbodies.
- Added surface smoothing option for domains: default is
  1, higher values result in a smoother surface (and probably
  slightly higher comupation times), while 0 means the surface
  is not modified at all.
- Added BLENDER_ELBEEMBOBJABORT environment variable in readBobj,
  if >0 quits blender when a not yet existing fluidsim
  frame should be loaded. Useful for rendering simulations
  as far as possible from the command line.
- Surface normals pointer is now set to NULL in readfile.c
- Fixed win32 error string handling, now uses a function
  to return the string from the solver.
- Fixed fluidsim particle halo scaling problem.
- Solver update
2006-03-29 07:35:54 +00:00
ee5d54c0fa Threshold for non-flat quad detection was too wide still. Causing errors
of quads filling in in octrees...
2006-03-19 20:14:16 +00:00
4bbc9df60d Added option to only render a single side of an Environment map cube,
allowing to use it for planar mirrors. Enable it with the new "Plane"
option in the Environment Map Panel.

Current default is to render the cube side that points to the positive
Z axis direction. To make it work, it uses the same image for all
other cube sides, so it will 'wrap around'.

Also made maximum resolution for environment map to be 4096x4096 now.
2006-03-19 14:26:56 +00:00
e3fb99ad70 Urgh... the commit to free texture images always also did it for preview... 2006-03-14 17:44:19 +00:00
705beae517 Made 'free texture images' default for a while... gives too many errors
for stressed artists who forget it. Will rewind later. :)
2006-03-14 13:26:33 +00:00
4a673d1d9b Autosmooth fix: if original Mesh has same amount of faces and vertices
as the one resulting from Modifiers, it uses that data to calculate
autosmooth for. This prevents weird stuff on rendering softbody for
example.
2006-03-13 18:16:23 +00:00
bad09bd2f9 And now the studio is rendering panoramas... finding out that vectorblur
also could use correction for it.
The current perspective projected blur would look in 180 degree view like
this:

http://www.blender.org/bf/p2.jpg
(circle of planes rotating around camera)

After some fight with my rusty highschool gonio I got it fixed; nice
cylindrical projected speedvectors:

http://www.blender.org/bf/p1.jpg
2006-03-11 21:46:19 +00:00
85ac48c782 With the commit last week to have curve bevels nice circular (when no
front/back is selected), the UV coordinates for curves should also be
corrected.
This commit re-uses the same code as for Nurbs, to make sure UV coordinates
wrap around nicely.

BUT! I've noticed that Daniel's commit of august in this code actually
broke this UV correction... in his craze to cleanup old code, he missed
the actual functionality. Meaning that in 2.40 and 2.41, "UV orco" texture
coordinates wrap around ugly in Nurbs Surfaces, something that was fixed
in NaN days.

Got no time for tracker now... but I'm sure it's in there! :)
2006-03-11 12:34:50 +00:00
7c23e08270 Vectorblur fix:
To be able to make good masks, it is important to separate the non moving
pixels from the moving ones. With fixes I did 2 weeks ago, a floating
point inaccuracy causes speed vectors to be not always zero perfectly...
and the masks to get badly shaped.

It was clearly visible on moving objects over a non-moving background.
Current commit includes minimal threshold to force speed to zero. Images
are nice and smooth again. :)

Bad:
http://www.blender.org/bf/vb1.jpg
Good again:
http://www.blender.org/bf/vb2.jpg
2006-03-09 22:50:36 +00:00
3ecee5f154 Complex issue in group duplicators... since they can duplicate entire
animation systems, all transforms of all duplicated group members have
to be set first, before drawing or converting for render. This because
then still deformation can be calculated.
2006-02-28 20:43:21 +00:00
9a36e9b651 Sorry for the big commit, but I've been fixing many of these
issues in parallel... So this commit contains: an update of
the solver (e.g. moving objects), integration of blender IPOs,
improved rendering (motion blur, smoothed normals) and a first particle
test. In more detail:

Solver update:
- Moving objects using a relatively simple model, and not yet fully optimized - ok
  for box falling into water, water in a moving glass might cause trouble. Simulation
  times are influenced by overall no. of triangles of the mesh, scaling meshes up a lot
  might also cause slowdowns.
- Additional obstacle settings: noslip (as before), free slip (move along wall freely)
  and part slip (mix of both).
- Obstacle settings also added for domain boundaries now, the six walls of the domain are
  obstacles after all as well
- Got rid of templates, should make compiling for e.g. macs more convenient,
  for linux there's not much difference. Finally got rid of parser (and some other code
  parts), the simulation now uses the internal API to transfer data.
- Some unnecessary file were removed, the GUI now needs 3 settings buttons...
  This should still be changed (maybe by adding a new panel for domain objects).

IPOs:
- Animated params: viscosity, time and gravity for domains. In contrast
  to normal time IPO for Blender objects, the fluidsim one scales the time
  step size - so a constant 1 has no effect, values towards 0 slow it down,
  larger ones speed the simulation up (-> longer time steps, more compuations).
  The viscosity IPO is also only a factor for the selected viscosity (again, 1=no effect).
- For objects that are enabled for fluidsim, a new IPO type shows up. Inflow
  objects can use the velocity channels to animate the inflow. Obstacles, in/outflow
  objects can be switched on (Active IPO>0) and off (<0) during the simulation.
- Movement, rotation and scaling of those 3 types is exported from the normal
  Blender channels (Loc,dLoc,etc.).

Particles:
- This is still experimental, so it might be deactivated for a
  release... It should at some point be used to model smaller splashes,
  depending on the the realworld size and the particle generation
  settings particles are generated during simulation (stored in _particles_X.gz
  files).
- These are loaded by enabling the particle field for an arbitrary object,
  which should be given a halo material. For each frame, similar to the mesh
  loading, the particle system them loads the simulated particle positions.
- For rendering, I "abused" the part->rt field - I couldnt find any use
  for it in the code and it seems to work fine. The fluidsim particles
  store their size there.

Rendering:
- The fluidims particles use scaled sizes and alpha values to give a more varied
  appearance. In convertblender.c fluidsim particle systems use the p->rt field
  to scale up the size and down the alpha of "smaller particles". Setting the
  influence fields in the fluidims settings to 0 gives equally sized particles
  with same alpha everywhere. Higher values cause larger differences.
- Smoothed normals: for unmodified fluid meshes (e.g. no subdivision) the normals
  computed by the solver are used. This is basically done by switching off the
  normal recalculation in convertblender.c (the function calc_fluidsimnormals
  handles other mesh inits instead of calc_vertexnormals).
  This could also be used to e.g. modify mesh normals in a modifier...
- Another change is that fluidsim meshes load the velocities computed
  during the simulation for image based motion blur. This is inited in
  load_fluidsimspeedvectors for the vector pass (they're loaded during the
  normal load in DerivedMesh readBobjgz). Generation and loading can be switched
  off in the settings. Vector pass currently loads the fluidism meshes 3 times,
  so this should still be optimized.

Examples:
- smoothed normals versus normals from subdividing once:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_1smoothnorms.png
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_2subdivnorms.png
- fluidsim particles, size/alpha influence 0:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_3particlesnorm.png
  size influence 1:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_4particlessize.png
  size & alpha influence 1:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_5particlesalpha.png
- the standard drop with motion blur and particles:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t2new.mpg
  (here's how it looks without
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t1old.mpg)
- another inflow animation (moving, switched on/off) with a moving obstacle
  (and strong mblur :)
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t3ipos.mpg

Things still to fix:
- rotating & scaling domains causes wrong speed vectors
- get rid of SDL code for threading, use pthreads as well?
- update wiki documentation
- cool effects for rendering would be photon maps for caustics,
  and motion blur for particles :)
2006-02-27 11:45:42 +00:00
2c1a328f58 Tweak for Speed vector calculus for Ztransp render layer; it used to mask
out moving transparent pixels by checking for alpha>0.95, now it also
checks the solid layer (if present), and if there's no solid face in a
pixel, the speed vector gets also added and used for transparent pixels.

This solves the 'ugly' hard outlines for vectorblur of moving hair.

Before:
http://www.blender.org/bf/h1.jpg
After:
http://www.blender.org/bf/h2.jpg
2006-02-23 11:16:16 +00:00
427339fd0b Adding new SpotLamps should get 'buffers' set to 1. Was in the do_version()
check, but not in adding lamps... this will fix crashing shadowbuffers.
2006-02-18 19:35:53 +00:00
55610ac7c1 We found out memory got fragmented a lot for creating speed vectors on
large scenes... this because it has to make 3 entire databases to find
the vertex-speed to previous and next frame. Even though most of the
prev/next database was freed, the parts I kept were spread all over
memory.

This commit copies from the prev/next database only the two screen aligned
speed vectors and stores that in temporal per-object structs. Even whilst
it takes more memory, it then can free the entire database, making space
for the next database to be built.
Tests reveiled it saves quite some... well, if you want to believe the
'virtual memory' total unix gives... :)
2006-02-15 19:55:29 +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
86511abe5a Reviewed octree filling times... found a way to optimize some 10% of time,
nothing radical. :)
Just remember to always try higher octree resolutions (256 or 512) or more
complex scenes. Can be 5-10 times faster.

For waiting pleasure; added a per-second header print update to tell where
octree is. Also added an ESC test in octree making.

(Commit in image.c is a faulty print for 'Not an anim').
2006-02-14 10:02:25 +00:00
f9d7f9ea45 Bugfix in Preview renders; material with lightgroups didn't get initialized
correctly.
2006-02-13 11:52:55 +00:00
9809c7807b Couple of smaller fixes:
- Improved stats drawing while rendering, it now draws - while preparing
  renderdata -  each second the amount of verts/faces.
  Also while rendering, the amount of finished and total parts are printed.

- Added ESC in loop that generated Group render data

- On deleting Render Layers, the nodes that use them are now checked and
  corrected.

- Restored drawing all scanlines in renderwindow... this wasn't the bug!
2006-02-12 21:57:56 +00:00
f4dc04ecbf Work on shadowbuffer system... right now only new filtertypes for
sampling have been activated for UI. Check the pictures here:

http://www.blender.org/bf/filters/index2.html

I also did do tests with anti-aliased shadowbuffers:

http://www.blender.org/bf/filters/index3.html

But this needs more thinking over still...
2006-02-12 20:21:08 +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
b9425b2a35 Interesting commit for artists using huge textures;
The code that generated mipmaps took a real long time to do it... on a
5k x 5k image it took here (no optim, debug compile) 32.5 sec.

Recoded the very old filtering routine, which already brought it down to
2.8 seconds. Then tested if we even need this filtering... in many cases
the images are painted or photographs, which is filtered OK already.
Without the filter, the mipmap timing went down to 0.39 second. :)

http://www.blender.org/bf/filters/index1.html

Here's an example of two 'mips' generated with or without gauss filter.
Note that aliasing in an image remains there... which can be a wanted
effect anyway.

So; added the gauss filter as option in making mipmaps. Also had to
reshuffle the buttons there in a more logical manner.
There's also disabled code in the do_versions to set 'gauss' on in older
files. Will be enabled during release time.
2006-02-10 18:57:52 +00:00
945484e92a Upgrade for Node type definitions: the min/max allowed values for input
sockets were not used yet... now they're verified on read, and written
in socket stack data on adding new nodes.
Also the buttons in Nodes use these values now. Special request from
Nathan Vegdahl who seems to be messing around with my precious nodes! :)
2006-02-10 13:57:30 +00:00
f5a22bc937 - Autosmooth now calculates smoothing based on original object-space
vertex locations, not global coordinates. This ensures consistant
  autosmoothing for each frame. Also fixes missing vectorblur for parts.

  Nice task for a dev: put autosmooth code in end of modifier stack... then
  it also shows in 3D window

- BUG FIX! I noticed the last tile rendered quite slow, and even did not
  update scanlines. Found out that the main tiles processor didn't go
  to sleep when the last tile was rendered, because it detected a free
  possible thread. This caused the main thread to go into a very tight
  loop, eating up a lot of cpu and blocking the other thread.
2006-02-08 10:57:48 +00:00
78c87abeed Wanted feature for curves: a render-time resolution. This option is
located under the 'def resolu' button. If not zero, it assigns this
resolution to a curve on render.
Also copies with ctrl+c menu.
2006-02-07 19:59:02 +00:00
59d67818e1 Orange-reported vectorblur bug: when using autosmooth, the amount of
vertices differed on previous/next frame, causing speedvector calculus
to be skipped.
Now that worked OK, where it not that non-existing speed vectors were not
initialized zero while rendering...

Also another issue showed up with autosmooth. When using exact smooth
angles (like 30 degrees) on a model that has been spinned with exactly
30 degree steps, the autosmooth gave different results on each frame...
and only when compiled in O2 (probably thats doing bad float rounding).

Solved this by just adding 0.1 to the user defined smooth angle.
2006-02-07 17:44:02 +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
1db5c23716 More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.

The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.

Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.

- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".

- Bug fixes

Added redraw event for Image window, when using compositor render.

Text objects were not rendered using background render (probably a bug
since depsgraph was added)

Dropdown buttons in Node editor were not refreshed after usage

Sometimes render window did not open, this due to wrong check for 'esc'.

Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
9facc0b20e Improved check for case when vector-blur speed table (previous frame) is of
different size as current frame. It now just skips making vectors then...
there exist solutions, but have to prove first vecblur actually works.
2006-02-03 21:02:20 +00:00
21e7a5f142 Render fix: object-duplicators now give their layer setting to the
duplicates, enabling lighting and layer-render properly.
2006-02-02 19:31:15 +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
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
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