Commit Graph

363 Commits

Author SHA1 Message Date
Kent Mein
391ae8f7ac Updated mallocn.c MEM_check_memory_integrity was casting
a string as an int and it was causing a warning.
I changed it to check to see if the string == 0
return 0 else return 1.

The only thing that called this function was memtest.c and it
had outdated code, so I fixed that...
        was calling MEM_set_error_stream updated to
                    MEM_set_error_callback

Kent
2006-03-23 17:45:40 +00:00
Ton Roosendaal
c8d295080c mmap allocs now fall back on regular malloc when mmap fails. 2006-03-15 15:06:53 +00:00
Jean-Luc Peurière
868874bd10 security patch #3910 provided by Joerg Sonnenberger on Os X
file opening
2006-03-13 18:27:51 +00:00
Nathan Letwory
36a4af22c3 ==SCons==
* These changes bring cross-compiling Blender for Windows on Linux one step
  closer to reality. The 'biggest' change is in makesdna SConscript to make
  sure a linux native makesdna is built, that can be run, too. Next to that
  proper checks for env['OURPLATFORM']=='linuxcross' are added in various
  places.

  Switch change in pluginapi.c was necessary, and AFAIK it should work like
  that also on WIN32, if not, slap me.

  Note: everything *compiles* now nicely, it is just that the final *linking*
  doesn't work (yet). Anyone who fixes this will be the
  hero of cross-compilers :)
2006-03-13 11:42:49 +00:00
Chris Want
46daa8d742 It looks like Irix works alright with the /dev/zero trick for mmap().
I had to include fcntl.h for Irix to get symbol O_RDWR.
2006-03-05 14:58:56 +00:00
Ton Roosendaal
2286118acc To prevent confusement; used %u (unsigned int) for printing memory error. 2006-03-04 22:22:38 +00:00
Brecht Van Lommel
2f5df4631d Fixes for some gcc 4 warnings in intern/. More than 100 lines of warnings
for 2 unused parameters in templated c++ code, that's just ridiculous.
2006-03-04 16:23:15 +00:00
Ton Roosendaal
61824579b0 Improved error print in case malloc returns NULL; it now adds the current
total allocated.
2006-03-02 19:49:51 +00:00
Jens Ole Wund
a040e208ee mscv6 projects again
no GE right now ( need to adapt to erwins file reshuffle
so may be i wait a bit until he has his mind made up )
elbeem is running when you remove the extra std:: at some places
well the msvc6 preprocessor is not very smart
--> std:: is not a member of std:: :)
so i guess there is a "using namespace std" somewhere
2006-02-28 08:31:33 +00:00
Kent Mein
4764cbe71b commented out a debugging message... was getting errors about cast to int
losses percision on 64bit linux with gcc4.X

Kent
2006-02-27 20:05:05 +00:00
Nils Thuerey
e48af6f10b - elbeem.h header file was missing 2006-02-27 11:56:04 +00:00
Nils Thuerey
0b7b0162eb - typo in SConscript 2006-02-27 11:48:25 +00:00
Nils Thuerey
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
Chris Want
5e3163041a I had to disable mmap altogether for Irix. 2006-02-24 14:37:24 +00:00
Ton Roosendaal
3bd57e6a64 Paranoia "volatile" assignment to globals in MEM module. Was suggested to
do this for globals that can be changed within threads.
2006-02-24 10:18:48 +00:00
Chris Want
a30dc3866c Some issues compiling on Irix:
+ the code in writemovie.c no longer compiles (since the renderer
refactor). I have #if 0-ed it.

+ OpenGL on Irix doesn't have GL_ARB_vertex_program

+ mmap on Irix doesn't like MAP_ANON.

+ If using the MipsPro 7.3 compiler, the variable MIPS73_ISOHEADERS
can be set to point to the directory with those weird C++ headers
that don't have .h in the name
2006-02-22 23:34:12 +00:00
Erwin Coumans
78942aa843 temporarily fix from Johnny Matthews committed, win32 doesn't have munmap. Someone can worry about a future mmap-like implementation. 2006-02-17 20:18:49 +00:00
Ton Roosendaal
fe036a0538 Added new malloc type in our MEM module; using the unix feature 'mmap'.
In Orange we've been fighting the past weeks with memory usage a lot...
at the moment incredible huge scenes are being rendered, with multiple
layers and all compositing, stressing limits of memory a lot.
I had hoped that less frequently used blocks would be swapped away
nicely, so fragmented memory could survive. Unfortunately (in OSX) the
malloc range is limited to 2 GB only (upped half of address space).
Other OS's have a limit too, but typically larger afaik.

Now here's mmap to the rescue! It has a very nice feature to map to
a virtual (non existing) file, allowing to allocate disk-mapped memory
on the fly. For as long there's real memory it works nearly as fast as
a regular malloc, and when you go to the swap boundary, it knows nicely
what to swap first.

The upcoming commit will use mmap for all large memory blocks, like
the composit stack, render layers, lamp buffers and images. Tested here
on my 1 GB system, and compositing huge images with a total of 2.5 gig
still works acceptable here. :)

http://www.blender.org/bf/memory.jpg
This is a silly composit test, using 64 MB images with a load of nodes.
Check the header print... the (2323.33M) is the mmap disk-cache in use.

BTW: note that is still limited to the virtual address space of 4 GB.

The new call is:
MEM_mapalloc()

Per definition, mmap() returns zero'ed memory, so a calloc isn't required.

For Windows there's no mmap() available, but I'm pretty sure there's an
equivalent. Windows gurus here are invited to insert that here in code! At
the moment it's nicely ifdeffed, so for Windows the mmap defaults to a
regular alloc.
2006-02-16 17:51:01 +00:00
Jens Ole Wund
c425ad9507 make msvc6 compile (thanks peter)
so beat me if it does not work ;)
2006-02-09 22:09:11 +00:00
Jens Ole Wund
daefa2afc6 ...umm msvc6 projects again 2006-02-09 19:31:50 +00:00
Jens Ole Wund
1d787c9e93 msvc6 projects that will compile when MEM_Allocator.h is fixed 2006-02-09 14:17:26 +00:00
Nathan Letwory
ef1b7a5735 ==SCons==
+ 'scons blenderplayer' builds blender AND blenderplayer now (tested on Linux
  only, but was only linking issue, so should work on other platforms too).

  NOTE: I noticed some compileflags for GE specific libs that were left out -
  I re-enabled them in the SConscripts, but I'm going to do a test build my-
  self now, so if there are problems with them on win32, I probably already
  know about them :)
2006-02-07 21:24:36 +00:00
Nathan Letwory
b11c92c66e ==SCons==
* use proper seperator instead of *nix-only /
2006-02-07 21:12:01 +00:00
Nathan Letwory
27110ec0f4 ==SCons==
- remove blenderdummy.cpp from list, so that elbeem actually works
2006-02-07 21:04:22 +00:00
Peter Schlaile
241352104f mem_in_use can be victim to C++ name mangling on some platforms... 2006-02-05 23:46:55 +00:00
Nathan Letwory
ba97d47df4 ==SCons==
* Changing linking order of a few libs, hopefully it solves a unresolved issue.
2006-02-05 20:38:40 +00:00
Peter Schlaile
57d7ae0365 Adds generic memcache limitor (used by the new sequencer to cache
only a certain amount of frames).
2006-02-05 18:56:30 +00:00
Nathan Letwory
04d44ee311 + add check for cygwin to continue parsing of SCons scripts 2006-02-05 17:14:52 +00:00
Nathan Letwory
3d3f5d1640 + WITH_BF_OPENAL=0 should now actually not need OpenAL stuff
* BF_PROFILE_FLAGS to list form
2006-02-05 01:09:40 +00:00
Nathan Letwory
4e82647e86 ==SCons==
+ BF_BUILDINFO=1 (by default) for build info in splash
- remove redundant renderconverter include dir
* check for win32-vc instead of only win32, so MingW compile goes ok
2006-02-04 16:36:37 +00:00
Nathan Letwory
3bb82a27fc == SCons ==
* This commit is all of the rewrite work done on the SCons system. For
  documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt.
  Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring
  contains valuable information, along with what still needs to be done.

    - linux, os x and windows compile now.
    - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py)
        - NOTE: Jean-Luc P will commit sometime during the weekend proper
          appit() for OS X. For now, copy the resulting binary to an
          existing .app bundle.
    - features:
        - cleaner structure for better maintenance
        - cleaner output during compile
        - better handling of build options
        - general overall speed increase
        - see the wiki for more info

  Cygwin, FreeBSD and Solaris systems still need work. For these systems:
    1) copy a config/(platform)-config.py to ie. config/cygwin-config.py
    2) set the proper defaults for your platform
    3) mail me at jesterking at letwory dot net with you configuration. if
       you need any modifications to the system, do send a patch, too.

  I'll be giving first-aid today and tomorrow, after that it'll be all
  regular development work :)

  /Nathan
2006-02-04 14:15:10 +00:00
Kent Mein
8e9222ec21 More simple fixes to cleanup warnings and what not:
extern/bullet/BulletDynamics/ConstraintSolver/SimpleConstraintSolver.h
        added newline at end of file.
 intern/boolop/intern/BOP_Face2Face.cpp
        fixed indentation and had nested declarations of a varible i used
                for multiple for loops, changed it to just one declaration.
 source/blender/blenkernel/bad_level_call_stubs/stubs.c
        added prototypes and a couple other fixes.
 source/blender/include/BDR_drawobject.h
 source/blender/include/BSE_node.h
 source/blender/include/butspace.h
 source/blender/render/extern/include/RE_shader_ext.h
        added struct definitions
 source/blender/src/editmesh_mods.c
 source/gameengine/Ketsji/KX_BlenderMaterial.cpp
 source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
 source/gameengine/Ketsji/KX_RaySensor.cpp
        removed unused variables;
 source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
        changed format of case statements to avoid warnings in gcc.

Kent
2006-01-30 19:59:33 +00:00
Brecht Van Lommel
24446906bc Use ALsizei/GLsizei to fix compile errors on mac / gcc 4.x. 2006-01-29 21:29:14 +00:00
Kent Mein
e544723e63 Fix some of Stealth Apprent's warnings/errors and some extra little stuff.
here is a quick summary...

Kent

intern/bsp/intern/BSP_CSGMesh_CFIterator.h
removed tri_index (unused variable)

intern/bsp/intern/CSG_BooleanOps.cpp
removed extra ;

intern/string/intern/STR_String.cpp
added <ctype.h>

source/blender/blenkernel/BKE_writeavi.h
moved things around so not doing forward declarations

source/blender/renderconverter/intern/convertBlenderScene.c
changed render.h to render_types.h

source/blender/src/blenderbuttons.c
source/blender/src/editgroup.c
source/blender/src/meshtools.c
added newline

source/gameengine/Ketsji/KX_KetsjiEngine.cpp
commented out include "PIL_time.h" code that requires it is commented out

reading blender/src/writeavicodec.c
(struct keyword to a couple of lines that needed it)
and added:
extern struct Render R;

blender/renderconverter/intern/convertBlenderScene.c
added extern Render R;
added #include "rendercore.h" to get rid of undeclared shade_material_loop
        (Not sure if this is right but it fixes it.
Did not fix this problem, is it alright to just pass NULL here or should we chan
ge it to something else:
        init_render_materials' : too few

gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
removed argument to dHashSpaceCreate
commented out dWorldQuickStep since it does not exist
2006-01-29 15:15:34 +00:00
Tom Musgrove
2fbef6f9c9 ==compiling==
need this version to compile with cygwin...
2006-01-28 19:57:09 +00:00
Jens Ole Wund
1ae7fb0c99 doing MSCV6 project woodoo ( preparing orange --> bf migration )
NOTE to Ton and Hos
PLEASE do not try to merge any ot the MSVC6 project files (*.dsw ,*dsp)
I have a plan to get it done with a minimum of pain
thanks
ole
2006-01-26 22:05:39 +00:00
Kent Mein
c693e01b8d Ton forgot a few modifications to the Scons and Makefile build systems.
These should make it so that other people can compile with OpenEXR support.

(I also added the OPENAL fix erwin commited to bf-blender since I
need it for my machine, and this syncs up the file)

Kent
2006-01-09 02:18:11 +00:00
Brecht Van Lommel
c2cff1cbcf More work on the new unwrapper code (orange branch):
- There is now a (temporary) dropdown box in the image window header for
  switching between the old an new unwrapper code. So to test the changes
  described below you need to enable the new unwrapper code.
- Pinning is now more predictable, if one uv is pinned, the others belonging
  to the same vertex are pinned also.
- Live LSCM is much faster, since the LU factorization, the most expensive
  part of the computation, is now stored and reused (was Jens' idea).
- Packing multiple uv charts is slightly improved, by doing a binary search
  over the texture width. This fixes the case where all the charts are
  packed at the bottom of the image.
- LSCM now uses an angle based formulation, and the results seem somewhat
  different (maybe slightly better?), didn't find out why yet.
2005-12-03 23:22:31 +00:00
Brecht Van Lommel
d6feeb6b22 Orange branch commit.
This commit adds new underlying uv unwrapper code, intended to be
more extensible. At the moment this has a re-implementation of LSCM.
This has not been activated yet, since it doesn't add anything new.

What's new is the stretch minimize tool from tuhopuu. It works by
selecting some some uv's in the uv editor window, and then pressing
ctrl+V. The uv's on the boundary stay fixed.

More stuff will follow as I port it over & fix it.
2005-12-01 02:09:21 +00:00
Nils Thuerey
006e9547a9 - 'extern "C"' fix for MSVC as suggested by Stephane 2005-11-24 12:42:33 +00:00
Nils Thuerey
1b6482771e - solver now supports animated time steps, gravity
and viscosity, an example can be found here:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/fluid_timeanim.mpg
- for simulation time animation the time IPO of the object is currently used,
  for all three there should probably be new ipos in the fluidsim struct
- started the API in elbeem.cpp, to get rid of parser & export
  via HD (it's not yet used)
2005-11-23 12:51:07 +00:00
Kent Mein
46875a6400 Changed powf to pow. (For Solaris)
Kent
2005-11-21 18:03:42 +00:00
Chris Want
b44ba190d2 Fix for bug #3414 provided by Lewis Saunders.
It appears that removing the 'int level' field from the
MemHead struct caused alignment issues for gcc builds of blender
on Irix (zr, who removed this field, commented that this problem
might occur, and sure enough it did happen). I've renamed the
field from 'level' to 'pad' to reflect that it has no meaning
beyond addressing alignment issues.
2005-11-17 14:48:11 +00:00
Jens Ole Wund
40237b6e57 some more msvc6 magic 2005-11-16 23:39:49 +00:00
Alexander Ewering
6b8007a8a3 Bjornmose's fixes for making booleans compile on MSVC 6.
Thanks!
2005-11-11 23:10:10 +00:00
Jens Ole Wund
e25b7c519e special service for msvc6 projects
post build step for booleans --> copy boolop.lib to lib folder _foo_/lib/windows..

enabeling bullet for GE
wants to link with _foo_/lib/windows/bullet/lib/bullet3.lib
you have to build it with continuous.dsw in exten/bullet and copy it manually there
since bullet is exten i think no automagic in place here
2005-11-11 20:15:16 +00:00
Ton Roosendaal
6a2413cbb4 Removal of ugly_nvidia_hack for OSX Nvidia systems. Apple has fixed this
bug in 10.4.3 now.
2005-11-11 11:42:54 +00:00
Jens Ole Wund
0093857b4f fixing msvc6 projects to compile again 2005-11-09 19:29:04 +00:00
Jens Ole Wund
e52c277423 adding msvc6 project to boolops 2005-11-09 19:27:25 +00:00
Nils Thuerey
35c605d299 - replaced values.h by float.h/limits.h as suggested by Hos,GSR,UnNamed 2005-11-09 16:47:49 +00:00