Commit Graph

83 Commits

Author SHA1 Message Date
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
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
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
49021f7ec4 BPython - first step for better integration of Python in Blender:
- add a new space: Space Script
- add a new dna struct: Script
- add these two properly everywhere they are meant to

It's not a tiny commit, but most of it is ground work for what is still to be done.
Right now the benefits should be: freeing the Text Editor to be used in a window even while a script w/ gui in "on" and letting more than one currently running script w/ gui be accessible from each window

Some files are added, so some build systems (not autotools) will need updates
2003-12-14 01:18:09 +00:00
e0c13fcb44 - moved do_versions stuff for 2.30 release, to also check 2.30 files.
this is safe initialization only.
  based at report from madprof.. he had a 2.30 file without this
  data correctly initialized... but how it happens? tuhopuu files?

  anyhoo, we might think of splitting do_versions in 2 parts:
  1. do_versions initialization of old variables that changed
     like physics properties that need to be scaled or so
  2. do_init for newly created variables that are not allowed to be zero,
     this can safely be done for each file
2003-11-25 13:44:46 +00:00
Chris Want
e7d3e24a0e Got rid of many #include "BPY_extern.h"
Homework from Michel: do grep BPY source/blender/src/*
and see if there is anything that needs fixing.
2003-11-22 20:21:59 +00:00
ffd7fc9005 - fixed reported bug with constraints... somehow someone managed to save
a follow-path constraint in 2.28c without data assigned.
  this patch checks for proper data in a constraint, if not available
  it will turn the type into CONSTRAINT_TYPE_NULL
- i will forward the demo file to theeth for further check
2003-11-19 15:20:18 +00:00
27ddef2ad5 - zooming in for action window increased 5 fold.
(bug report #679). Also corrects old files for it.
2003-11-08 19:04:50 +00:00
Chris Want
ec836b3390 nla strips were not updating the reference counts of actions they
were using.
2003-11-06 17:17:52 +00:00
4efdabfbbc Constraint stuff from tuhopuu including (but probably not limited too):
Axis options for TrackTo
LockTrack
FollowPath

Auto creation of TrackTo constraint from Ctrl-T (old track still an option)

Auto creation of FollowPath when parenting to path (Normal parent still an option)

Backward compatibility stuff to convert the per object axis settings to per constraint when a Track constraint is present.

Function to convert old track to constraint (commented out)

Revamped the constraints interface with Matt's work from tuhopuu and the stuff we were discussing earlier.

--------------------
For coders:

unique_constraint_name and *new_constraint_data  moved to the kernel (constraint.c)

new Projf function in arithb gives the projection of a vector on another vector

add_new_constraint now takes a constraint type (int) parameter

add_constraint_to_object(bConstraint *con, Object *ob) to link a constraint to an object

add_constraint_to_client(bConstraint *con) to link constraint to current client (object or bone)

add_influence_key_to_constraint (bConstraint *con) to (eventually) add a keyframe to the influence IPO of a constraint
2003-10-21 13:22:07 +00:00
0321602b65 - The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
  (initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
  3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!

API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:

- void BIF_ThemeColor(ScrArea *sa, int colorid)
  sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)

- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
  sets a color with offset, no more weird COLORSHADE_LGREY stuff

- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
  like opengl, this gives you in *col the three rgb values

- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
  or the one to get 4 bytes

ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.

Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
6480956c58 - expanded internal windowmanager that it allows button panels in any
window (type)
- each SpaceData struct (not the window!) can get 'block handlers'
  assigned, basically event codes that invoke drawing button panels.
- this is saved in files, and Panels behave in any window like it does now
  in buttonswindow
- it also means that a 'space window' should leave with a matrix set for
  buttons level
- try it in view3d header menu, 'view'->'backdrop'. this opens the old
  viewbuttons
- it all works non blocking! instant updates of viewbuttons visible in
  3d window now.

Not done yet:
- checking and fixing frontbuffer drawing (select a wireframe draws over)
- temporally vertices cannot be selected, is my next project
- closing or hiding Panels...
- styling stuff... i committed for others to review as well.

Have fun. this is certainly a huge improvement over the old viewbuttons!
2003-10-15 12:26:26 +00:00
9b343a9f76 - cleared a flag in reading Panels back, could cause errors... 2003-10-14 20:13:51 +00:00
0d03929b9b Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.

- editbuts, animbuts, gamebuts, displaybuts, paintbuts,  work now
- i quite completely reorganized it, it's now nicely telling you what
  context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
  (except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore

And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.

Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
a082b8e1b0 - fixed some of the weird placement of buttons when changing window size
- home key buttonswin had error
- fixed bug: split area with tabbed panels didnt work correct
2003-10-05 20:17:37 +00:00
336afad8d6 - added little original feature to panels: TABS! :)
while dragging you can merge panels, or while dragging on a tab you
  can unmerge them.
2003-10-05 13:19:08 +00:00
842bb449c5 huge commit, sorry!
this is part 1 of the UI makeover. It has:
- menu system from Matt integrated
- buttons drawing from Matt
- generic button panel system implemented
- converted displaybuttons (not the rest yet)
- cleaned up a lot in drawing spaces itself, to make it aligned and pixel exact.
- cleaned loads of little compiler warnings, protos...

still a lot of work needed, will all be in next week i hope!

(warn: 2 new c files! butspace.c and buttons_scene.c)
2003-10-04 20:35:50 +00:00
d8955d1b33 - Recursive environment map render
Multiple environments now can be rendered in one pass. Previously the other objects with environment maps didn't show up in a reflection. Like this:
http://www.blender.org/bf/dep.jpg

By default, Blender renders now this result:
http://www.blender.org/bf/dep0.jpg

For a further 'recursive ray-tracing effect' you can give each EnvMap texture a higher "Depth" value. Here is a result with depth set at '2':
http://www.blender.org/bf/dep2.jpg

Related new options:
- in (F10) DisplayButtons, environment map rendering can be turned on and off.
- in EnvMap texture buttons you can free all environment maps
- Environment map sizes are also reduced with the (F10) 'percentage' option.

Tech note: with this commit the VlakRen struct has on *ob pointer!
2003-09-23 21:05:51 +00:00
Alexander Ewering
c397e66bed On popular request, I made the "Sync" button (correct realtime
synchronization (framedrop) in ALT-A and synchronization to audio strips)
off by default when loading old .blend files or old ~/.B.blends.

This, however, makes the audio sequencer unusable by default, ALT-A will
not show realtime on complex scenes, and the "Frs/sec" value will be
ignored.
2003-09-11 19:08:45 +00:00
5574bd234b - fixed 'HOME' option for action window. it had a wrong 'max zoom' setting.
also provided a patch in do_versions to make saved action windows work.

  now you can zoom out nicely again!
2003-07-22 14:28:56 +00:00
aa9f2a5733 - saves the 'draw faces' flag in a file, in fact the entire G.f flag.
WARN: this recompiles other stuff too, outside of the loader. be sure
  to 'make' in source/blender/ or a higher dir.
2003-07-21 19:41:07 +00:00
9bf630a1f3 WARNING: with makefiles I could not get a stable blender compiled.
do a make clean in source/blender/ to be sure!

- Included the new shaders from Cessen... well, only the shader calls
  themselves. To make sure the shaders work I nicely integrated it

- MaterialButtons: layout changed a bit, but still resembles the old
  layout. The 'shader' options now are located together.

- Shaders are separated in 'diffuse' and 'specular'. You can combine them
  freely.

- diffuse Lambert: old shader
  diffuse Oren Nayar: new shader, gives sandy/silky/skinny material well
  diffuse Toon: for cartoon render

- specular Phong: new spec, traditional 70ies spec
  specular CookTorr: a reduced version of cook torrance shading, does
                     off specular peak well
  specular Blinn: new spec, same features as CookTorr, but with extra
                  'refraction' setting
  specular Toon: new spec for cartoon render

- default blender starts with settings that render compatible!

- works in shaded view and preview-render

- works in unified render

Further little changes:

- removed paranoia compile warnings from render/loader/blenlib

- and the warnings at files I worked at were removed.
2003-07-19 20:31:29 +00:00
4f27386740 Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;


Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)

Stuff that has been done:

./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c

Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.

./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c

The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.

./source/blender/makesdna/DNA_sound_types.h

Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.

./source/blender/makesdna/DNA_scene_types.h

Added AudioData struct, which holds scene-global audio settings.

./source/blender/makesdna/DNA_sequence_types.h

Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.

./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c

Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.

./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c

Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)

./source/blender/src/editsound.c

Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.

./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c

 - Created two different wrappers for update_for_newframe(), one which scrubs
   the audio, one which doesn't.
 - Replaced some of the occurences of update_for_newframe() with
   update_for_newframe_muted(), which doesn't scrub the audio.
 - In drawview.c: Changed the synchronization scheme to get the current audio
   position from the audio engine, and use that as a reference for setting
   CFRA. Implements a/v sync and framedrop.
 - In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
   volume envelopes.
 - In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
   (update_for_newframe()) for moving the sequence editor framebar.

./source/blender/src/editseq.c

Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.

./source/blender/src/buttons.c

Added Scene-global audio sequencer settings in Sound buttons.

./source/blender/src/sequence.c

Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 20:16:56 +00:00
38e20946c3 - fixed slow file reading of vertex deform groups.
found out that per vertex, per deform group, a heavy function was called
  to get an address from a huge array. that address even didnt exist, was
  not written in the file... just removing the code makes .blend file
  reading happy again.

  check it by parenting a 40k vertex mesh, to an armature with "use
  armature" and "create vertex groups". save and load file.
2003-07-05 16:41:04 +00:00
Chris Want
924a849755 Support for building bf-blender under windows with gcc (huge thanks to
Florian Eggenburger).

Full instructions are in doc/README.windows-gcc.

Main differences from Florian's patch:

- the 'lib' dir should now be the same level as the 'blender' dir (rather
than being a subdir of 'blender'). This is consistent with the other
platforms that bf-blender supports (tuhopuu will also adopt this convention
hopefully soon).

- the script 'free_windows-env.mk' is no longer needed ... see the
docs about how this is overcome (again, tuhopuu will hopefully
also follow this route soon).

- the dlltool dir has it's own Makefile that builds all of the
needed stub libraries from the dll's in cvs.
2003-05-24 20:04:37 +00:00
9662763ee0 Updated Quicktime code so settings can be stored in the blendfile.
This enables Blender to;
- have scenes with different codec settings. (same as avicodec)
- render directly without dialog.
- batch/background render to Quicktime movies.

Only tested on windows. ;)
2003-05-21 01:21:07 +00:00
9508bb0d41 comments translated for blenloader files 2003-04-26 18:01:01 +00:00
cdb2974b67 Fix for bug #70.
I am a little skeptical about this patch, because somehow
the file had the TXT_ISEXT flag set in it, and the support for
that feature isn't complete. What I want to know is how that
flag got set in the first place, none of the interface code
turns it on.

At least it fixes the crash.
2003-03-25 15:54:46 +00:00
19a8c2eae4 removed default wheellinescroll usersetting (didnt work here) 2003-02-10 14:13:51 +00:00
b68c3527e8 added default variable (3) for the wheellinescroll usersetting 2003-02-09 17:55:49 +00:00
e49aeb8468 In stubs.c I added a dummy return to functions that were non void types.
in readfile.c I renamed some localvars that were named main to mainl in
a couple of functions.

in action.c I initalized a var to 0.  This is probably not needed but
its a little safer incase someone adds more modes...
I've included a diff of this last one below.

Kent

Index: action.c
===================================================================
RCS file: /cvs01/blender/source/blender/blenkernel/intern/action.c,v
retrieving revision 1.6
diff -u -r1.6 action.c
--- action.c    2002/11/25 12:01:52     1.6
+++ action.c    2002/12/20 02:06:27
@@ -153,7 +153,7 @@
 ){
        bConstraint *dcon;
        const bConstraint *scon;
-       float dstweight;
+       float dstweight = 0;

        switch (mode){
        case POSE_BLEND:
2002-12-20 02:08:46 +00:00
d0e346d544 updated .c files to include:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Just need to finish cpp files now :)

Kent
--
mein@cs.umn.edu
2002-11-25 12:02:15 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00