Commit Graph

3814 Commits

Author SHA1 Message Date
c2526dc922 More AO fun to play with:
- AO energy slider to control amount
- option "Use sky color" for colored AO. The horizon color will define
  bottom diffuse color, the zenith works on top
- option "Use sky texture" will do a full sky render to define AO color

Please note that AO energy and color only is found when a ray does not
intersect. So for interior scenes make sure 'Dist' value is sufficient
low.

New also is:

- World "Map input" allows "Ang Map" (Angular mapping) which can be used
for 360 degree spherical maps, aka as Light Probes. Check samples here:
http://www.debevec.org/Probes/
Note that Blender doesn't support HDRI images yet, but option "Use sky tex"
already gives intersting results with such images

- World sky rendering with Image Textures now correctly filters and uses
antialiasing. Also noticable for raytrace mirror reflections

- World preview render for sky type "Real" now gives correct view as
defined by current used camera.

I tried to speed up AO tracing with coherence systems, none of it really
worked yet... time to tackle octree itself i guess!
2004-04-12 14:53:17 +00:00
69f2ff45cb bug fix 1064
Credits go to blendix! Well done!

Reported were errors in using procedural textures on "Map input" UV type.
It was due to un-initialized uv[2] members, which were actually still
used by texture.c for some coord flip magic.
2004-04-07 12:55:45 +00:00
d1c9c5c319 bugfix #1119
When using MotionBlur, the rendered coordinates were not correctly
adjusted, causing visual artifacts using the new AO, but it was also
visible for normal ray-shadow, which didn't become anti-aliased in
Mblur render.

Solved it with 2 globals now, to pass on blur offset to renderloop.
Leave it that way... the entire method used to jitter/AA/blur stuff
needs revision.
2004-04-06 11:21:44 +00:00
2a90de0348 Eeshlo AO patch, revised
- Ambient Occlusion is a more sophisticated ambient trick, which takes
  nearby faces into account by firing a hemisphere of shadow-rays
  around. AKA 'dirt shader'.
- Eeshlo made it a Lamp type, which doesn't fit well. I've moved the
  settings to the World menu, and let the Material->ambient value control
  the amount it contributes
- currently, the AO value is added/subtracted/mixed with the 'diffuse'
  factor while shading, before it is multiplied with Material color

Buttons are in new Panel 'Amb Occ" in F8 menu. Note:

- "Dist:" by shortening the length of rays you get subtler effects and it
  renders faster too
- "DistF:" the attennuation factor gives control over how the 'shadow'
  spreads out.

Further it's just raytracing, so tends to be slooooow.... :)
Here same tricks as for other raytraced scenes apply, especially try to
keep the environment as small as possible (exclude faces from Octree by
giving them no Material Traceable).

I still have to think over a couple of aspects, will await feedback on it:
- AO color? Now it just adds 'white'
- other sampling patterns? I tried dithering, which was so-so
- method of controlling final 'samples' in F10? Might be useful for other
  oversampling too (area light) to have it reacting to a percentage or so..
2004-04-05 21:04:13 +00:00
22a62a285c - bug fix #1086
using backbuffer, and having an odd number of lines in image, skipped the
  last one to fill in backbuffer...
  An oldie!
2004-04-03 17:11:14 +00:00
0ae03d1626 Eesho's patch for new noise textures!
Basically this provides three new things:

1. Choice of a list of noise-base functions, which can be used by the
   current Clouds, Marble, Wood textures as well.
2. Three new texture types: Musgrave, Voronoi and DistortedNoise
3. Python access to noise functions (not for render!)

All of this together makes Blender's builtin procedural textures a LOT
more powerful. Here again, a full webpage should be made to show off all
possibilities, and explain some of the more scientific names for settings.

A good read on Musgrave textures can be found here:
http://www.ypoart.com/Downloads/Musgrave.htm
About Voronoi:
http://www.ypoart.com/Downloads/Worley.htm
I can't find official DistortedNoise docs easily... maybe its something
Eeshlo created himself.

I've spent some time to change the patch Eeshlo provided. Worth noting:
- created main texture "Musgrave" with 5 sub choices (instead of 5 new
  main textures)
- added for all new textures the option to scale (zoom in out)
- added patch in do_versions to initialize variables

I hope the Python team will check on the Noise.c API. And include in docs!
2004-04-03 13:59:27 +00:00
e5749a632e - disabled 'ray shadow' option from UI and render for Hemi lights.
reason is that raytrace code doesnt like shadow on backfacing faces
  at all. the hemi light is omni-directional, and would need a shadow
  calculation to mimic this as well. the new 'Ambient Occlusion' patch
  will make that possible.
2004-04-01 13:27:24 +00:00
16e90d56d2 - replaced AUTOSPACE define with {ME_,CU_,MB_}AUTOSPACE,
different objects shouldn't share flags this way (still sharing of
  other mesh flags in renderer... ickity pickity, but I'm not fixing now)
 - removed some unnecessary uses of DNA_mesh_types.h
2004-03-14 16:59:48 +00:00
70a4ead0ae SCons updates
* Blender static now links. By default this option is disabled on all
  platforms. Simply set the option in config.opts to 'true'.
* Added the following flags to config.opts:
  - HOST_CC.    This is the C compiler for the host platform. This value is the
                same as TARGET_CC when not cross compiling.
  - HOST_CXX.   This is the C++ compiler for the host platform. This value is
                the same as TARGET_CXX when not cross compiling.
  - TARGET_CC.  This is the C compiler for the target platform.
  - TARGET_CXX. This is the C++ compiler for the target platform.
  - TARGET_AR.  This is the linker command for linking libraries.
  - PATH        This is the standard search path
  All SConscript files have been updated to reflect these changes. Now it's
  possible to change only the root SConstruct file, and all compiler specific
  variables are passed automatically to all SConscript files. Of course, this
  does not apply to makesdna because there the host and target platform is
  different from all other libraries.
  To pass a variable that applies to all platforms, all we now have to do is
  set the correct value in library_env


Note: as usual, to get the latest options in the config.opts file, first
      remove your version.
2004-02-29 21:40:48 +00:00
9330e553e8 SCons updates
* libraries are now generated in [BUILD_DIR]/lib
* passed the user_options to all libraries now.
  This means I could remove a couple of Export/Import lines.
* Changed the order in source/blender/src/SConscript and
  source/gameengine/SConscript.
  All libraries are now sorted alphabetically. This has no impact on the build
  process.
2004-02-15 19:25:32 +00:00
a1c7a5b043 - removed error() call from initrender, for when no backbuf found.
this function needs the UI active, doesnt work with renderwindow.
2004-01-30 18:07:26 +00:00
56926b00ac - fix after testing with regression files; the boundary on a sphere, on the
edge where shaded is unshaded, the shadow routine didn't work correctly.
  Had to put back an old dot-product check to fix.
2004-01-29 22:28:04 +00:00
162d5cdc91 fix for bug #933, specularity was clipped too soon, especially evident
when using low spec hardness value (1 or 2).
2004-01-29 17:33:38 +00:00
c225bf1240 On request of broken, monkeyboi and others the rendering engine menu is back again.
The menu button was also moved to the render panel, this required some changes to the placement of the other buttons.
I hope this is no problem...
2004-01-27 05:46:12 +00:00
7021c88b4d - Port fix for Backbuffer/Optimize hang (caused by short pointer hack)
from tuhopuu.
2004-01-25 16:25:55 +00:00
9c6662e4e0 - when not F10->"Ray" option is set, materials with "Ray Transp" will
render solid now (no alpha).
- This gives nicer previews, but also makes envmaps look better, since
  environment maps are rendered without raytracing
- I decided not to raytrace envmaps mainly because of speed... if you use
  environment maps you want something quick... otherwise just use ray_mir
  material here!
2004-01-23 22:33:33 +00:00
f844d011a2 - added clipping value for spothalo rendering. Unified render doesn't like
alpha>1.0, the 'threshold' calculation in vanillaRenderPipe.c then works
  wrong... not sure if this should be fixed there.
- for now, the spothalo render function itself clips.
- again; thanks to horrible intrr test scene! :P
2004-01-22 12:14:21 +00:00
acdcc29990 - fix for specularity calculus. Because of new area lamps and new ray-shadow
some tests where moved around, causing specularity being calculared when
  light actually shines behind a face.
  Thanks inttr for the (horrible!) test scene that showed it. :)
2004-01-22 11:15:28 +00:00
0a25a54569 - fix for bug #903
this was an error as reported more, with horizontal lines in raytraced
  renderings. It appeared to be an Osa struct being not reset to zero
  for normals... only happens when using bumpmapping.
2004-01-21 20:52:31 +00:00
ede644969b - Made dispfact for new mtex default to 0.2.
- Fine tunes scaleing of Nor channel to better match intensity chan.
	- removed last debug printf.
2004-01-18 17:17:44 +00:00
cfe180805b - ray shadow now also does the options:
- Lamp only shadow (use 'energy' to control amount that gets subtracted)
  - Material only shadow (remember, is an alpha trick)
- demo files for this have been included in testing suite, will be
  upgraded soon.
2004-01-17 16:01:51 +00:00
dab319cfe1 - updated stringlenght for animated texture images in Texture. It used
only the define FILE_MAXFILE, which should be added with FILE_MAXDIR.
- one day these defines should be made more clear, uh!
2004-01-17 13:54:21 +00:00
52e5a15bab - Separates displace from Var slider. Added Disp Slider to
control how the intensity channel affects displacement.  Nor
	  slider still controls how Nor channel affects displacement.

	- Scaled Nor displacement to make Nor slider more usable.

	- Removed Data scale from displacement routines.  Made
	  sliders unusable for objects scaled in editmode.  Displacement
	  now relative to unit sized object.  Displace still tracks
	  with object scale, so scale out of editmode if you want a
	  large object with deep displacement.
2004-01-15 04:06:24 +00:00
5190faf513 - fix for speedup raytracing, which gave errors in very simple scenes
(1 lamp, shadow). The 'coherence' check gets reset now for each new
  pixel rendered, which remains efficient for oversampling.
- small cleanups in code, prototype added, less globals.
2004-01-14 20:13:41 +00:00
3e84e66078 fix for tracker report on crashing border render in unified render.
it is related to the fix for 2.31, wich disabled hackish feature of
 inserting the previous render outside border. i forgot the unified has
 this code entirely duplicated, something to get rid of one day...
2004-01-14 14:30:59 +00:00
0d6533a48f fix for bug that caused transparant shadow change how a texture
rendered itself. this happened when transparent shadow ray hit a face
 with same material as where ray started.

 is this understandable? i guess not! :P
 the actual fix is just a few lines, to store material locally before
 going to trace transp shadow.
2004-01-13 22:49:11 +00:00
fac8a7027d - fix for cubemap, rendered without render face available.
currently only for preview render and displaylist. It then uses the
  provided texture coordinate itself...
  Solution is not perfect... disadvantage of not having globals! then
  you have to fix all mess! :)
2004-01-11 22:15:24 +00:00
63f1e17fe5 - tex->nor was not reset to zero for lamp texture. this caused weird thing
to happen when you use lamp textures with material textures.
  Bug provided by aphex, thanks!
2004-01-11 20:58:12 +00:00
bbe7d8d08e - Better fake for displace preview. 2004-01-11 00:39:17 +00:00
3406d3a939 - Displacement now allows use of either Var or Nor slider. Nor uses
texture's Nor channel, Var uses intensity channel.
2004-01-10 23:00:52 +00:00
b5071f367d Improved method to calculate normals for procedural textures such as
Marble, wood, clouds. Instead of the retarded (but faster :) old method
it now derives the normal based on displacement of a 'nabla' vector;
sampling the texture additionally with three little offsets in x, y and z.

Code provided by Eeshlo, and gratefully accepted!
2004-01-10 12:41:47 +00:00
aba8ca4440 From Eeshlo: fixed bug with dupliverted lamps not exporting. Also now it
skips envmaps, octree and radiosity when yafray is enabled.
2004-01-09 08:31:23 +00:00
71597eb061 - Corrected scale factor to be independant of object
rotation.  (Still not right, but better).
2004-01-08 14:19:25 +00:00
f0821decff Left over work from localizing renderdata!
- when quads get split before render, the vertexcolors and texture face
  (UV) info has to be corrected as well. This happens runtime during
  render, no new data is created. The code was in previous versions, but
  with raytrace and other new features it needed a rewrite
- this now also should work for the new smart split code from robert!
2004-01-07 21:44:09 +00:00
f2f514d1d4 Fix for cube map error subsurf.
- cubemap relied on pointer to MFace, which is only available for Mesh
  when directly converted to renderfaces.
  It then checked the 'puno' flag where also bits were set to indicate
  the optimal projection for a face (XY, XZ or YZ).
- I found out the renderface also has a puno flag, so the mface pointer
  in a renderface is redundant. Is removed now
- added code in texture cubemap call, which checks on a projection flag
  in 'puno'. If not set, it uses the orco's to calculate one.
- this means, that cubemap now also works for other objects than meshes,
  provided they have an orco block while render.
- if no orco block available, it uses the 'global' projection to find which
  of the cube sides map.

I couldnt find other errors with subsurf & orco though...
2004-01-07 20:29:21 +00:00
d54699bb45 - Added UV mapping to displacement. 2004-01-07 14:31:58 +00:00
e4d0d9cc44 - decided to use a new variable for the new exposure option, instead of
re-using old one. New one = 'exp'.
- at first I used the old 'exposure' value, and just mapped it to 0. this
  causes a problem with upward compatibility, old blenders then render a
  black picture. is too confusing!
- warning; exposure values saved with commit of last week will get lost.
2004-01-06 20:25:50 +00:00
deafae4286 - displacement 'map to' channel now has three values, to allow to negate
the effect as well.
2004-01-05 23:33:22 +00:00
cea53c6473 - previewrender with mapping type "Cube" didnt show correctly.
added fake 'face normal' for this case
2004-01-05 21:18:47 +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
a017282b62 Tweaks to get yafray stuff working with Makefiles
Kent
2004-01-05 17:42:07 +00:00
3cf499e044 update scons files to build with yafray support 2004-01-05 15:33:32 +00:00
092c6fd1bb Yafray export code moved to source/blender/yafray to keep blender/src pure C
code. Now all the cpp code is in intern under yafray and the api include
file is just plain C

Also changed old include in initrender.c and updated Makefiles.am and configure.ac
so the new dirs are taken into account.
2004-01-05 14:53:56 +00:00
22bfc207f3 -First port of Displacement mapping from tuhopuu. Image textures not working
yet (R.vn and R.vlr no longer exist, and were needed to get the image mapped
right).  Works esp. well with Subsurfs. Sensitive to vertex normal issues
in Simple and Mesh modes.

-Also porting Simple Subdivide.  Subdivides mesh at rendertime w/o changing
shape, for smooth displace and Radiosity.

-Removed an unused var from KnifeSubdivide.
2004-01-05 08:44:49 +00:00
57a7dfe5a5 - Revert to NaN makefiles 2004-01-05 00:06:11 +00:00
eff07b8329 Basic initial yafray integration by Eeshlo.
Materials are exported the best we can do by now. It will look almost as in
blender except for the missing procedural textures and some minor issues.
You have to tweak normal modulation amount to get the desired result cause
is not the same in yafray.

We added a panel in render space to adjust some yafray settings (GI and so)

Also we export transparency and reflection using new raytracing settings,
but that will be changed and improved soon.

Remember that you have to set YFexport path in user defaults and yafray must
be on path (version 0.0.6)

We added the "yafray" button to activate all this stuff in the render window.
Panel and settings are only shown when checked.

So now when activated the code calls yafray export instead of the internal
renderer and finally the resulting image is loaded back into render window's
buffer. So animation is also possible and results can be saved using blender
usual scheme.
2004-01-04 22:10:36 +00:00
dbce416607 - oren nayar call didnt return float value... but still worked on my
system, and gcc refuses to see it as warning. weirdos!
  this caused previewrender to show black for oren nayar.
2004-01-04 21:32:50 +00:00
d3e1fc8870 SCons build system files added.
You'll need SCons (www.scons.org) to build.
Platforms currently working:
* Linux (me)
  - options for quicktime, openal and international disabled
  - uses the system libs and include files for building - no option to build
    with the precompiled libraries yet.
* Windows (jesterKing)
  - builds with quicktime (optional)
  - builds with openal (optional)
  - builds with international support (optional)
  - Use the DOS box to build
  - builds with precompiled libraries
* Irix (Hos)
  - Uses default Irix compiler
  - Not all optimization levels correct yet
  - options for quicktime, openal and international disabled
  - builds with precompiled libraries
* Cygwin (me)
  - has a problem in the linking stage
  - uses free build tools (gcc)
  - options for quicktime, openal and international disabled
  - uses the system libs and include files for building - no option to build
    with the precompiled libraries yet.
* MacOS (sgefant)
  - builds with quicktime (optional)
  - options for openal and international disabled
  - builds a nice bundle
  - builds with precompiled libraries

Thanks to IanWill for a bugfix in the Linux build.
Note: This is a work in progress. A lot still has to be done - for example the
      optional parts are only to be enabled by directly setting 'true' or
      'false' in the SConstruct file. This needs to be moved to a user config
      file. Also, the .o/.obj files are stored in the source tree. This needs
      to be fixed as well.
      The game engine is not yet built.
2004-01-04 21:11:59 +00:00
03fe244b58 - changed calculus for area light to use double precision. Using float
already gave noise with area size of 0.1.
  Limited buttons to minimum value of 0.01 for area light. For people
  who want smaller they can scale it down in 3d, effectively reducing
  the energy then as well.
2004-01-04 13:27:18 +00:00
d8b21b01c3 Added improved exposure calculation
- based at 1.0-exp(-color) trick in Yafray. But to guarantee backwards
  compatibility, and some more control, Stefano Selleri hacked a useful
  formula for it.
- We now have 2 values to set:
  - "exp": the exponential correction value (0-1)
  - "range": the light range that maps on color 1.0 (0-5)
- Using exp(x) (is e^x) we can much better prevent overflows from render,
  which are currently hard-clipped in Blender. Setting a small 'exp' value
  wil efficiently smooth out high energy and map that back to a color for
  display.
- total formula:
  newcol= linfac*(1.0-exp(col*logfac))
    col, newcol are colors
  linfac= 1.0 + 1.0/((2.0*wrld.exp +0.5)^10)
  logfac= log( (linfac-1.0)/linfac )/wrld.range
    wrld.exp and wrld.range are the button values
- default setting: exp=0.0 and range=1.0 give results extremely close to
  previous rendering.
- graph: http://www.selleri.org/Blender/buffer/Image1.png  for 'exp' setting
  ranging from 0-1, and with 'range'=2

Thanks Stefano for the help!
2003-12-30 18:03:37 +00:00