Commit Graph

1492 Commits

Author SHA1 Message Date
Martin Poirier
7f90973344 Fix a problem that has been bugging me for a while. Tracking axis by default are different for Lamp and Camera than for the rest. For the constraint, it wasn't using the correct ones for them, so obviously, it didn't track correctly by default.
Fixed by checking the object type and changing the up and track axis accordingly.

Also added some comments in the DNA file (recompiling makedna because of comments is fun!)
2004-01-01 19:21:06 +00:00
Martin Poirier
4b6bc29bf2 Some random small stuff packed in one commit:
- Moved a couple of undo_push_mesh after the action has been confirmed (mainly bevel, merge and mirror)

- Split mirror in two functions, interface and functionality

- Simplified the code of the merge function
2003-12-31 22:44:26 +00:00
Ton Roosendaal
ab36eaa947 - removed Quicktime warning from buttons. Thanks for the fix Maarten! 2003-12-31 16:51:28 +00:00
Maarten Gribnau
f351708967 Fixes the freeze on Mac OSX when a Quicktime Settings window for Compression was brought up. Blender swallowed every event, not giving Quicktime a change to receive update events and mouse clicks. 2003-12-31 15:47:09 +00:00
Ton Roosendaal
84780ae764 - fixed reported bug in doing correct redraws for multiple 3d windows, and
using vertex select. Was just caused by being to cheapskate with cpu
  cycles... but I don't give up on that!
2003-12-31 15:45:04 +00:00
Ton Roosendaal
3eee89e393 - added extra check for valid Material pointer array in Mesh. Someone
reported crash with a popular Python script that apparantly doesnt
  initialize a Mesh good (setting totcol, but not creating pointer array)
  When no Material array is present, 'totcol' is set at zero now.
2003-12-31 15:27:31 +00:00
Ton Roosendaal
10c0f4ae9f - bug fix #828
Blender crashed when assigning background image to 3d window, when no
  buttons window was visible. This caused by copying code from old location
  with still using some variables of the 'button space' struct.

  Solved by creating these variables in View3d 'space' as well, and using
  these instead. Could also remove old coder /* comment */ that there was
  a unknown bug in the code there. :)
2003-12-31 13:48:45 +00:00
Chris Want
9bc012f97c A fix for the missing pad1 bug: henceforth, world->pad1 shall be known as
world->gameEngine (a la tuhopuu).
2003-12-31 04:00:26 +00:00
Ton Roosendaal
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
Ton Roosendaal
6c80064ab7 - fixed switching contexts... the previous commit about this was too
rigurous. Now it only switches context when selecting a new object
  type, also "invisble", when shading buttons are not drawn.

  What I committed changed context always when pressing the 'shading
  context' icon button. This was annoying when you were editing textures
  or radiosity, world, etc. In such cases it should just draw the old
  settings.
2003-12-30 16:00:38 +00:00
Ton Roosendaal
7d7fd069fc - fix for area light versus oren-nayer shading.
oren-nayer was of course of not built for area-lights... so probably
  Cessen will kill me for this hack. Nice challenge for him to come with
  better solution. Visually it works & looks fine.
2003-12-30 00:04:22 +00:00
Ton Roosendaal
cf9ce09074 - forgot to clip negative values coming from arealight formula.
- excluded 'dist' factor calculus from arealamps, which caused too much
  distance sensitivity
2003-12-29 21:32:03 +00:00
Ton Roosendaal
b269f6f466 - since the Object Transform panel in 3d window has sufficient space,
made all buttons display 3 digits after dot, instead of 2.
2003-12-29 20:12:21 +00:00
Ton Roosendaal
5004432333 - fixed crashing texture plugin, caused by not checking the tex->nor
pointer.
  Now variables are localized, this is not always set anymore.
2003-12-29 20:05:15 +00:00
Ton Roosendaal
3ce1dc9065 Area lights and more...
- New lamp type added "Area". This uses the radiosity formula (Stoke) to
  calculate the amount of energy which is received from a plane. Result
  is very nice local light, which nicely spreads out.
- Area lamps have a 'gamma' option to control the light spread
- Area lamp builtin sizes: square, rect, cube & box. Only first 2 are
  implemented. Set a type, and define area size
- Button area size won't affect the amount of energy. But scaling the lamp
  in 3d window will do. This is to cover the case when you scale an entire
  scene, the light then will remain identical
  If you just want to change area lamp size, use buttons when you dont want
  to make the scene too bright or too dark
- Since area lights realistically are sensitive for distance (quadratic), the
  effect it has is quickly too much, or too less. For this the "Dist" value
  in Lamp can be used. Set it at Dist=10 to have reasonable light on distance
  10 Blender units (assumed you didnt scale lamp object).
- I tried square sized specularity, but this looked totally weird. Not
  committed
- Plan is to extend area light with 3d dimensions, boxes and cubes.
- Note that area light is one-sided, towards negative Z. I need to design
  a nice drawing method for it.

Area Shadow

- Since there are a lot of variables associated with soft shadow, they now
  only are available for Area lights. Allowing spot & normal lamp to have
  soft shadow is possible though, but will require a reorganisation of the
  Lamp buttons. Is a point of research & feedback still.
- Apart from area size, you now can individually set amount of samples in
  X and Y direction (for area lamp type 'Rect'). For box type area lamp,
  this will become 3 dimensions
- Area shadows have four options:
  "Clip circle" : only uses a circular shape of samples, gives smoother
  results
  "Dither" : use a 2x2 dither mask
  "Jitter" : applys a pseudo-random offset to samples
  "Umbra" : extra emphasis on area that's fully in shadow.

Raytrace speedup

- improved filling in faces in Octree. Large faces occupied too many nodes
- added a coherence check; rays fired sequentially that begin and end in
  same octree nodes, and that don't intersect, are quickly rejected
- rendering shadow scenes benefits from this 20-40%. My statue test monkey
  file now renders in 19 seconds (was 30).

Plus:

- adjusted specular max to 511, and made sure Blinn spec has again this
  incredible small spec size
- for UI rounded theme: the color "button" displayed RGB color too dark
- fixed countall() function, to also include Subsurf totals
- removed setting the 'near' clipping for pressing dot-key numpad
- when you press the buttons-window icon for 'Shading Context' the context
  automaticilly switches as with F5 hotkey

Please be warned that this is not a release... settings in files might not
work as it did, nor guaranteed to work when we do a release. :)
2003-12-29 16:52:51 +00:00
Martin Poirier
65aeef11e1 Alex Mole's patch for END and HOME
http://www.blender.org/pipermail/bf-committers/2003-December/004691.html

Makes HOME and END keys work in text space and text
edit boxes.

I've tested it for some time now and I haven't had any problem or spotted any irregularities of some sort.

One think though. It doesn't update the panning of the text window if the cursor gets out of the screen. I guess someone (more familiar with the code) could look into this.

Really nifty when coding scripts.
2003-12-28 21:28:35 +00:00
Martin Poirier
9aed5cb7f0 Bugfix for bug #760
http://projects.blender.org/tracker/index.php?func=detail&aid=760&group_id=9&atid=125

When using numerical input with scaling, axis that did not have any input scaled to 0 (it defaults to 1 now). Fix inspired by Koryo's patch (it was easier to recode it than to apply the patch and then run through the code to see if he didn't forget anything).

Also fixed some other stuff (the variables didn't reset correctly at some point).
2003-12-28 21:16:11 +00:00
Martin Poirier
50448cdb1a Function without a return (warning)
This function just calls another function which returns a success value, so I'm just passing that value directly as a return value.

Slap me with a trout if I wasn't suppose to fix this.
2003-12-28 20:24:32 +00:00
Martin Poirier
2eed0e54ef bjornmose's UV mapping patch
two new options to uv auto calculation:
"from window to shere", "from window to cylinder".
the differences to sphere/cylinder mapping as is:
1. the around settings of the 3D view sets the projection center
2. the origin of the polar/spherical coordinate system always points out of the screen.
   so the rotation of the view affects mapping.
3. in the cylinder case the radius of the projection cylinder is read by a popup button.

Basicly what you need to do is rotate the viewport until the cylinder/sphere is aligned with the depth (Z axis) of the view, as if you where looking through the mesh from one end to another (makes more sense in the case of a cylinder), and choose the From window to cylinder/sphere mapping option.
2003-12-28 19:59:06 +00:00
Robert Wenzlaff
d2f725ef86 Another bad flag. Mea Culpa. 2003-12-27 17:29:25 +00:00
Robert Wenzlaff
c5925664a2 Accidently committed local flags. Bad coder. 2003-12-27 16:52:51 +00:00
Robert Wenzlaff
c476658348 More cursor port bugs. 2003-12-26 23:01:47 +00:00
Robert Wenzlaff
3f7cc9b217 Bugfix: Error in cursor port, only showed up under cygwin. 2003-12-26 22:41:51 +00:00
Roel Spruit
ce041f555c added Robert's cursor stuff to the msvc 6.0 project files 2003-12-26 20:29:11 +00:00
Robert Wenzlaff
85ae21d5dd Commit of cursor framework. Cursors now defined in source/blender/src/cursors.c and
source/blender/include/BIF_cursors.h.  Allows large cursors on Win32 and X11.
See cursors.c for documentatioin on how to use.
2003-12-26 20:12:42 +00:00
Ton Roosendaal
da0e131b16 - improved filling in faces in octree, resulting in less nodes and
branches. Especially larger faces give result. Rendering times go down
  with an average of 10%. My reference testfile went down from 30.4 to
  27.9 seconds.
2003-12-24 19:05:38 +00:00
Kent Mein
e9a6c2d996 Dan Sinclair's patch to add --version or -v to blender's command line options.
Kent
2003-12-24 16:44:24 +00:00
Ton Roosendaal
a7bed78040 - fixed bug in shaded view mode (SHIFT+Z) when it tried to calculate
reflection normals... NULL pointer reference.
  (thanks Desoto!)
2003-12-24 16:18:13 +00:00
Ton Roosendaal
b3911687ee - only cosmetic stuff; result of going over the output of mipspro cc
compile round. Wrong prototypes, unused variables, zealot const usage,
  and in action.c fixed insane & unreadable function call syntax.
2003-12-24 11:44:57 +00:00
Ton Roosendaal
8fbff1a3b7 - Fresnel V4.0
Based on feedback (thnx phase!) I found a big disadvantage of the 'real'
fresnel formula. It doesnt degrade to 0.0, causing 2-3 times too many
rays being fired compared to the previous one. So; a lot slower.

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

- Fixed bug in raytrace: the first renderpass didn't use fresnel for mirror.
- Fixed bug in previewrender, now it closer matches how fresnel renders
2003-12-23 22:31:48 +00:00
Martin Poirier
4d8fce8568 Fixed bevel width preview drawing which draws the correctly with higher recursion level (it was incorrect for anything higher than 2).
Also commented out a couple of unused variables that were shouting warnings (and we all love the lack of warning and the couple of extra free bytes) :)
2003-12-23 19:03:30 +00:00
Ton Roosendaal
454166026a - another fresnel improvement. :)
At last irc meeting, eeshlo pointed to an error in the code. It didn't
  use the IOR value correctly. This has been solved. So how it works now:
  - the IOR button value influences (very subtle) the fresnel effect.
    Only for realism diehards.
  - the Fresnel value (slider) now denotes the power in the function
    rf + (1-rf) * (1-c)^5
    where rf= rf = ((ior-1)/(ior+1))^2
    and c the dot-product ray/normal.
  - so, set the slider at '5' and you have real fresnel. Lower values
    for interesting artistic effects.

- put back the forgotten code for gaussian corrected sampling during
  antialising render. Normally, each sub-pixel sample in Blender counts
  equally, and together make up the pixel color.
  With 'Gauss' option set (F10 menu) each sub-pixel sample creates a small
  weighted mask with variable size, which (can) affect neighbouring pixels
  as well. The result is smoother edges, less sensitive for gamma, and
  well suited to reduce motion-aliasing (when things move extreme slow).
  This is result of *long* period of research in NeoGeo days, and based on
  every scientific sampling/reconstructing theory we could find. Plus a
  little bit of our selves. :)

- I should write once how blender constructs Jitter tables for sub-sampling.
  this is a very nice method, and superior to normal block filter or random
  jittering... time!
2003-12-22 22:27:51 +00:00
Ton Roosendaal
3df84b755f - fixes for the stubs, to make sure blenderplayer compiles.
error was caused by moving render calls to render module... but some
  are still called in blender kernel...
2003-12-21 23:38:41 +00:00
Ton Roosendaal
6d6dee7ba8 - globals were defined double... showed up thanks to warning of irix
compiler!
2003-12-21 22:57:02 +00:00
Roel Spruit
80622fca55 updated msvc projectfiles: added texture.c and removed some others.. 2003-12-21 22:43:10 +00:00
Ton Roosendaal
d012036c1f - moved render.h struct back to beginning of file... 2003-12-21 22:38:29 +00:00
Ton Roosendaal
761fd601ea - brought back to render.h includes... ifdef SGI and Windows... 2003-12-21 22:31:03 +00:00
Ton Roosendaal
26df64a691 - removed render.h from this file. 2003-12-21 22:23:20 +00:00
Ton Roosendaal
ec99255c27 Phew, a lot of work, and no new features...
Main target was to make the inner rendering loop using no globals anymore.
This is essential for proper usage while raytracing, it caused a lot of
hacks in the raycode as well, which even didn't work correctly for all
situations (textures especially).

Done this by creating a new local struct RenderInput, which replaces usage
of the global struct Render R. The latter now only is used to denote
image size, viewmatrix, and the like.

Making the inner render loops using no globals caused 1000s of vars to
be changed... but the result definitely is much nicer code, which enables
making 'real' shaders in a next stage.
It also enabled me to remove the hacks from ray.c

Then i went to the task of removing redundant code. Especially the calculus
of texture coords took place (identical) in three locations.
Most obvious is the change in the unified render part, which is much less
code now; it uses the same rendering routines as normal render now.
(Note; not for halos yet!)

I also removed 6 files called 'shadowbuffer' something. This was experimen-
tal stuff from NaN days. And again saved a lot of double used code.

Finally I went over the blenkernel and blender/src calls to render stuff.
Here the same local data is used now, resulting in less dependency.
I also moved render-texture to the render module, this was still in Kernel.
(new file: texture.c)

So! After this commit I will check on the autofiles, to try to fix that.
MSVC people have to do it themselves.
This commit will need quite some testing help, but I'm around!
2003-12-21 21:52:51 +00:00
Alexander Ewering
16eec383fd Fixed the call to CalcNormFloat to use neweve[]->co.
Goofster: The difference between you and Ton reporting the problem was
that he actually took the time to analyze the warning and pin down the
problem, while your "hahaha, your code has a warning!" didn't really
help me a lot in the first place.
2003-12-20 13:46:50 +00:00
Ton Roosendaal
0060be6603 More render stuff:
- added 'Mapping to" channel "RayMirror", to control mirror with texture
- fixed bug in using mirror-rgb as texture channel... this is cumbersome
  because it is abused by Envmap in a not nice way. Fixing the abuse will
  cause compatibility errors, which can be fixed when we up release # to
  2.32.

- added "Translucency", which is nothing else than allowing another
  shading pass for the backside of a face (with normal inverted). This
  is interesting for all kinds of situations where you want light from
  behind to 'shine through'. Also works to reduce dark areas in
  unlighted parts of rendering transparent faces. Light from behind on
  transparent red window should make it glowing some, right?!
- added texture channel for this as well

- Reorganized Material Panels to reveil some consistancy where buttons
  can be found. Not perfect yet, but at least all options for Shaders and
  options for Mirror & Transparency now are together.
  This gives some space in Shader Panel for nice expansion.
2003-12-19 15:23:12 +00:00
Matt Ebb
2cac5e0dda Updated the Mac OS X blender file icon with standard background and xype's nice shiney blender logo 2003-12-19 12:07:24 +00:00
Jacques Guignot
0468a787d7 Bug fixes (sigh...) 2003-12-18 21:45:15 +00:00
Ton Roosendaal
cb20f1cdb4 another trace commit
- implemented tracing of transparency for shadows. This is a material
  option, in the new RayTrace panel.
  it only traces color and alpha, not shading. So the results of some
  transparant colored unlit faces can look odd. I will look onto that.
- changed fresnel formula (got hint from eeshlo!). this simplifies the UI,
  now only one button needed. The fresnel value "should" be identical as
  the refraction index, but that is booooring! So i added a special fresnel
  refraction slider for both mirroring and transparency. By setting all 3
  sliders equal, you get 'realism'.
- fresnel for transparancy works for Ztra rendering too. Same for transpa-
  rent shadow. But then you need to set 'ray' on in F10 menu.
- uploaded new monkey_glass blend in download.blender.org/demo/test/

Next stage: killing the globals from render, and implement "translucency"
which is effectively allowing faces being lit from behind, as paper or
cloth.
2003-12-18 21:34:48 +00:00
Martin Poirier
d1122ae917 Yay! Bevel is back in business. Thanks to intrr for pointing out the problem (flag check missing). 2003-12-18 01:37:50 +00:00
Jacques Guignot
4b813c5c81 Modification of the function getCurvecurval suggested by Jiba. This function can take an integer argument (the position of the curve) or a string (the name of the curve)
Updated documentation in doc/Ipo.py
2003-12-17 14:15:14 +00:00
Martin Poirier
ed67092601 Nathanael Law's fix to make numerical input more compatible with axis constraints.
I thought this was a nice addition, so I'm commiting it.

To Ton for easier changelog creation: When constraining to an axis, numerical input is limited (and will switch automaticly) to that axis.

Original e-mail
-------------------------------
I was playing with the axis constraints for grab and scale transforms
and I thought that the behavior was slightly illogical.  Without axis
constraints, I think everything is great, but once a constraint is used
some irregularities show up.  (Note, this is not a bug, it's more of a
possible improvement)

When you enter grab or scale mode, then constrain the transformation to
a
particular axis, then enter numeric entry mode by hitting a number or
'n', there is no reason for you to try and edit the numeric value of a
non-constrained axis which is the current behavior.

E.g. You grab an object and want to move it along the z-axis, so you
enter grab mode and either hit 'z' or the middle mouse button and you
move the mouse to get an idea of how it looks.  You decide that you
want to use a value of +4.2 with numeric entry; now you have to enter
the following sequence: 'g', 'z', 'move mouse', 'tab', 'tab', '4.2',
'enter'.  However, you're already constrained to the z-axis, so you
should not have to enter 'tab', 'tab'.

The included patch changes the behavior of grab and scale transforms so
that if you are constrained to an axis, and enter numeric entry mode
via
'n' or by hitting a number, you will immediately begin editing the
appropriate axis, and will not have to hit 'tab'.

This may not seem like a big improvement (because it's not), but I feel
that it improves the workflow of a commonly used task slightly and does
not negatively impact any other aspects of the program.

I welcome feedback on this idea.

--
 - Nathanael Law <njlaw@xyrodian.com>
2003-12-17 04:27:29 +00:00
Martin Poirier
8c570d4bb4 Fix for the bevel wrapping face detection algorithm. Still some case where quad will wrap. From the test I did, this seems to happen most of the time with MAJORLY non-coplanar faces. Still trying to find a final fix that would work all the time. 2003-12-17 04:16:32 +00:00
Ton Roosendaal
064297009c - shadeless rendering fixed!
error was due to new localized render result code... and of course only
  shading and tracing was tested :)
2003-12-16 16:07:46 +00:00
Ton Roosendaal
97d4dbc9c3 Another commit for raytracing, now with glass refraction & fresnel!
Changelog:

- enable refraction with button "Ray Transp" in Material buttons.
- set "Angular Index" value for amount of refraction.
- use the "Alpha" value to define transparency.
- remember to set a higher "Depth" too... glass can bounce quite some
  more than expected.
- for correct refraction, 3D models MUST have normals pointing in the
  right direction (consistently pointing outside).
- refraction 'sees' the thickness of glass based on what you model. So
  make for realistic glass both sides of a surface.

- I needed to do some rewriting for correct mirroring/refraction,
  especially to prevent specularity being blended away.
  Solved this with localizing shading results in the rendercore.c.
  Now specularity correctly is added, and reduces the 'mirror' value.
- Localizing more parts of the render code is being planned. The old
  render heavily relies on struct Render and struct Osa to store globals.
  For scanline render no problem, but recursive raytracing dislikes that.

- done test with gamma-corrected summation of colors during tracing, is
  commented out still. But this will give more balanced reflections. Now
  dark reflections that are reflected in a bright surface seem incorrect.

- Introduced 'Fresnel' effect for Mirror and Transparency. This
  influences the amount of mirror/transparency based at viewing angle.
  Next to a new Fresnel slider, also a 'falloff' button has been added to
  define the way it spreads.
- Fresnel also works for Ztransp rendering

- created new Panel for Raytrace options
  I have to evaluate still where it all should be logically located.
- material preview shows fake reflection and fake refraction as well.
2003-12-16 14:12:01 +00:00