Commit Graph

164 Commits

Author SHA1 Message Date
Sergey Sharybin
1ba78bca94 Tomato Cycles: fix regression since rev49535
Wrong sample number was reporting in viewport rendering.
2012-08-05 17:38:44 +00:00
Sergey Sharybin
7b644b8196 Tomato Cycles: fix for vector pass gives wrong result in some circumstances
Issue was caused by wrong camera motion stored in device in cases
when first render layer does not have vector pass enabled.

Solved by forcing device camera update in cases when scene's motion
changed since previous device camera update.
2012-08-05 17:24:10 +00:00
Sergey Sharybin
e7f8b52aee Tomato Cycles: minor code cleanup
Move center tile acquiring code into own function. Should be
easier for time being when we'll want to support other tile
render orders.

Also now there should be a single bucket growing from center
when multi-GPU is used. Can't test this here tho.
2012-08-04 09:13:52 +00:00
Sergey Sharybin
b5e1419e5b Tomato Cycles: internal cleanup of tile-based integrator
This commit solves couple of issues appeared with new integrator:

- Render job progress bar is now shows progress based on number of
  rendered tiles. This is the same as Blender Internal does.

  This still requires some further thoughts because for GPU it's
  better to use single tile and in this case progress bar should
  be based on number of rendered samples.

- Removes "global" sample counter from progress descriptor. There's
  no more global-being sample which makes sense.

  This counter was replaced with tile counter.

- Use proper sample number when copying render buffer to blender.
  It used to be final sample number used which lead to tiles
  appearing from complete dark to normal brightness as they're
  being rendered. Now tile would be displayed with proper
  brightness starting from the very first sample.

  Use sample counter stored in render tile descriptor and pass
  it to update / write callbacks.

This was tested on CPU and GPU CUDA rendering.

Additional change:

  OpenCL rendering now should be cancellable before it finished
  rendering all the samples (the same change as for CPU/CUDA from
  a while ago).

This part of commit wasn't actually tested, would do it later.
2012-08-03 15:18:42 +00:00
Sergey Sharybin
e135bfe41b Correction top previous commit: tiles were counted in opposite way 2012-08-03 11:13:38 +00:00
Sergey Sharybin
535a17dd18 Tomato Cycles: fix own regression in currently rendering tile status 2012-08-03 10:55:33 +00:00
Sergey Sharybin
ecab45a018 Tomato Cycles: fix wrong center coordinate when using multi-device configurations 2012-08-03 10:42:21 +00:00
Sergey Sharybin
3f5e3ae0bf Merging r49413 through r49450 from trunk into soc-2011-tomato 2012-08-01 14:14:22 +00:00
Sergey Sharybin
8dc3d4e3fd Remove "Loading byte/float" debug messages. They were added at the time
we've been looking into texture limit for Mango and it's not needed now.

Anyway, this prints didn't cover all the cases when images were loading.
2012-07-31 15:28:36 +00:00
Brecht Van Lommel
314e26c02c Fix cycles issue with wrong texture coordinates on a second render layer with
a mask layer enabled.
2012-07-31 15:05:16 +00:00
Sergey Sharybin
aec620cc28 Resolve compilation error with MSVC 2012-07-31 14:27:14 +00:00
Sergey Sharybin
60044b12da Tomato Cycles: use the same order of parts as Blender Internal 2012-07-31 13:15:53 +00:00
Sergey Sharybin
b8c3f59e92 Tomato Cycles: resolve textures limit when using CPU render
Remove limit for number of textures when using CPU rendering,
so huge scenes from Mango could be rendered properly.

Re-arranged float and bytes textures for this, so now float
textures goes before byte. This is needed to make alignment
stuff easier for variable number of textures.

Also replace code-generated CPU kernel structure's members
with an array, which makes it easier to access textures
without adding bunch of cases in switch.

Should be no functional changes when rendering with GPU
or OpenCL devices.
2012-07-30 15:26:06 +00:00
Campbell Barton
e27f56d388 svn merge ^/trunk/blender -r49244:49250 2012-07-26 13:30:37 +00:00
Lukas Toenne
fec872ef9c Added a particle index output to the Particle Info Cycles node. This is required to get consistent ID numbers for particles. The Object ID is not usable since it's a user defined value of the instanced object, which does not vary per instance. Also the random value from the object info node is not consistent over time, since it only depends on the index in the dupli list (so each emitted or dying particle shifts the value).
The particle index is always the same for a specific particle. Randomized values can be generated from this with the use of a noise texture.
2012-07-26 11:40:58 +00:00
Sergey Sharybin
62df895415 Tomato Cycles: resolve slowdown introduced by interactive samples view commit
Update samples displayign in the interface once in a whiel only
(currently once in 1 sec). This still keeps rendering interactive
enough for artists and it eliminates slowdown caused by constant
uploading sampels from GPU to host.

This also allowed to get rid of hack with storing render result
in render buffers, due to it's not so big overhead ow to create
render result when sample needs to be updated.

Tests made with different files shows that now render speed is
really close to oroginal speed from before we started hackign
into this stuff.

There still some issues with interactive update when rendering
several render layers, but that seems to be irrelivant to all
this sampels commtis, so woudl look into this as a separate
patch.
2012-07-25 14:29:14 +00:00
Sergey Sharybin
de6d480f71 Tomato Cycles: fix for memory overflow issue
This fixes memory overflow caused by creating render result every time
RenderResult is creating when updating sample and not being freed until
tile is fully rendered.

Solved in probably not best way -- RenderResult is being stored in
RenderBuffers, so it's creating only once.

This solves memory issues, but while was looking into this issue
discovered dramatic slowdown caused by samples update in some files
from mango svn.

Solving this slowdown is becoming first priority from now on.
2012-07-24 20:05:00 +00:00
Campbell Barton
c363fc3dce svn merge ^/trunk/blender -r49175:49177 2012-07-24 13:02:54 +00:00
Campbell Barton
679847bd99 add prints for texture loading (we're running into texture limit a lot so its handy to see whats actually loading from the blend files) 2012-07-24 13:01:55 +00:00
Sergey Sharybin
d9d4430a56 Tomato Cycles: code reshuffle to make data flow more obvious
Should be no functional changes
2012-07-23 22:06:43 +00:00
Sergey Sharybin
e0eed025c9 Tomato Cycles: deadlock with save buffers enabled should be resolved now 2012-07-23 20:46:27 +00:00
Sergey Sharybin
9cdf5a8553 Tomato Cycles: update buffers on every sample finished
Was requested by Mango team to improve feedback during rendering.

Known issues:
- Updating of samples are accumulative, meaning that visually samples
  would be dark in the beginning becoming brighter during progress.
- Could give some % of slowdown, so probably should be disabled in
  background mode.

Still to come: update of samples when using CUDA and OpenCL.
2012-07-23 18:45:29 +00:00
Sergey Sharybin
5652c9e107 Tomato Cycles: rendering can be cencelled before tile is fully rendered
Probably there;s a proper way to check whether rendering was requested
to cancel, but couldn't see any clearer ways to do that.
2012-07-23 13:01:30 +00:00
Campbell Barton
7200172990 svn merge ^/trunk/blender -r49063:49067 2012-07-19 13:07:33 +00:00
Campbell Barton
2557eaf0dd print names of nodes/sockets when cycles complains about only being able to connect a closure to another closure. 2012-07-19 13:04:43 +00:00
Brecht Van Lommel
26f6913516 Cycles: blended box mapping support for image texture node. This enabled by
selecting Box instead of Flat as projection, and then setting the blend value.
Blend 0.0 will not do any blending between box sides, higher values will give
a smooth transition between the sides

This is useful for mapping image texture without too obvious patterns in a
way that looks seamless, without the need for UV mapping. This works basically
the same as the mango node setup that was posted, just a bit faster:

http://mango.blender.org/production/blended_box/
2012-07-11 00:08:42 +00:00
Campbell Barton
fbc24a61c4 svn merge ^/trunk/blender -r48576:48585 2012-07-04 11:53:48 +00:00
Campbell Barton
16e6b7b867 cycles changes:
- images that can't be loaded because of the limit are printed in the console.
- textures that can't be found show up as pink (so we know somethings wrong).
2012-07-04 11:48:42 +00:00
Brecht Van Lommel
7c8f82a174 Cycles: regular rendering now works tiled, and supports save buffers to
save memory during render and cache render results.


Implementation notes:

In the render engine API it's now possible to get the render result for
one render layer only, and retrieve the expected tile size in case save
buffers is used. This is needed because EXR expects tiles with particular
size and coordinates.

The EXR temporary files are now also separated per layer, since Cycles
can't give the full render result for all render layers, and EXR doesn't
support writing parts of tiles.

In Cycles internally the handling of render buffers and multi GPU
rendering in particular changed quite a bit, and could use a bit more
refactoring to make things more consistent and simple.
2012-06-28 10:34:38 +00:00
Brecht Van Lommel
e3e75b3936 Fix #31883: cycles vectors pass rendering crash with some render layers using
it and others not.
2012-06-20 14:24:52 +00:00
Brecht Van Lommel
4ba456d175 Cycles: first step for implementation of non-progressive sampler that handles
direct and indirect lighting differently. Rather than picking one light for each
point on the path, it now loops over all lights for direct lighting. For indirect
lighting it still picks a random light each time.

It gives control over the number of AA samples, and the number of Diffuse, Glossy,
Transmission, AO, Mesh Light, Background and Lamp samples for each AA sample.

This helps tuning render performance/noise and tends to give less noise for renders
dominated by direct lighting.

This sampling mode only works on the CPU, and still needs proper tile rendering
to show progress (will follow tommorrow or so), because each AA sample can be quite
slow now and so the delay between each update wil be too long.
2012-06-13 11:44:48 +00:00
Brecht Van Lommel
5e2a9a261b Fix cycles object_flag array being allocated too big. 2012-06-13 11:25:22 +00:00
Campbell Barton
2c1abe1f58 style cleanup: assignment & indentation. 2012-06-09 18:56:12 +00:00
Campbell Barton
c6cffe98fa code cleanup: removed/renamed shadow & duplicate variable definitions. 2012-06-09 18:20:40 +00:00
Campbell Barton
43361487ba code cleanup: quiet all warnings about double promotion (either by changing the type or explicitly casting). 2012-06-09 17:45:22 +00:00
Campbell Barton
0fbb6bff27 style cleanup: block comments 2012-06-09 17:22:52 +00:00
Thomas Dinges
49a64a0ab7 Cycles / Cleanup:
* All references to old textures should now be finally removed.
2012-06-08 20:17:02 +00:00
Lukas Toenne
5e1bbde01d Particle Info node for Cycles. This can be used to access particle information in material shaders for dupli objects. For now only the particle Age and individual Lifetime (in frames) are supported, more attributes can be added when needed.
The particle data is stored in a separate texture if any of the dupli objects uses particle info nodes in shaders. To map dupli objects onto particles the store an additional particle_index value, which is different from the simple dupli object index (only visible particles, also works for particle dupli groups mode).

Some simple use cases on the code.blender.org blog:
http://code.blender.org/index.php/2012/05/particle-info-node/
2012-06-08 16:17:57 +00:00
Brecht Van Lommel
78cf502c80 Cycles: border render now works in the viewport, when looking through the
camera, same as in render. It draws objects in solid draw mode outside of
the border.
2012-06-06 23:27:43 +00:00
Brecht Van Lommel
6548f7efef Cycles: spot lamp support. 2012-06-04 17:17:10 +00:00
Brecht Van Lommel
66f4ab396f Cycles: different fix for object info random range issue. 2012-06-03 09:50:17 +00:00
Thomas Dinges
014105f35d Cycles / OSL:
* More fixes for r41599, removed clouds and distorted noise textures and ported the Noise texture to OSL. 
ToDo: Color output is still commented, needs a closer look. 

* Some more fixes (comments, uninitialized variables)
2012-06-02 21:34:25 +00:00
Thomas Dinges
298d311bd6 Cycles / Object Info Node:
* The random output had a range from -0.5 to 0.5, added an offset of 0.5 to bring it into the 0.0 / 1.0 range, which is in alignment with Shader Node Guidelines. 
Patch by Agustin Benavidez, thanks!
2012-06-02 21:04:16 +00:00
Lukas Toenne
0e9b0f6d9e Fix #31645, mix node results in crash upon render. This happens when unused mix nodes are removed from the cycles graph. In case the inputs are both unconnected it still tried to reconnect them. 2012-05-30 15:47:12 +00:00
Brecht Van Lommel
9e2f377273 Fix #31556: cycles object info random value was not properly randomized for
dupligroups.
2012-05-29 10:34:16 +00:00
Brecht Van Lommel
7f7ba3243d Fix cycles render issue with a (useless) mix node that has the same shader
plugged into both sockets.
2012-05-23 17:55:34 +00:00
Brecht Van Lommel
c3e1fce775 Cycles: add Object Info node, with outputs object location, object/material
pass index, and a random number unique to the instance of the object.

This can be useful to give some variation to a single material assigned to
multiple instances, either manually controlled through the object index, based
on the object location, or randomized for each instance. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Object_Info
2012-05-21 12:52:28 +00:00
Brecht Van Lommel
93aa83f0a3 Fix #31518: changing cycles exposure did unnecessary rerender in viewport. 2012-05-18 14:06:53 +00:00
Brecht Van Lommel
dd9c1b7fbf Cycles: OpenCL image texture support, fix an attribute node issue and refactor
feature enabling #defines a bit.
2012-05-13 12:32:44 +00:00
Brecht Van Lommel
072a882d03 Fix #31379: cycles not recognizing 16 bit tiff as float image. 2012-05-10 17:09:36 +00:00