blender/intern/elbeem/intern/cfgparser.h
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

264 lines
6.9 KiB
C

/* A Bison parser, made by GNU Bison 2.0. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
DT_INTEGER = 258,
DT_FLOAT = 259,
DT_STRING = 260,
DT_ATTRNAME = 261,
DT_ATTRVALUE = 262,
KW_LBMSIM = 263,
KW_COMPARELBM = 264,
KW_ANIFRAMETIME = 265,
KW_DEBUGMODE = 266,
KW_DEBUGLEVEL = 267,
KW_P_RELAXTIME = 268,
KW_P_REYNOLDS = 269,
KW_P_VISCOSITY = 270,
KW_P_SOUNDSPEED = 271,
KW_P_DOMAINSIZE = 272,
KW_P_FORCE = 273,
KW_P_TIMELENGTH = 274,
KW_P_STEPTIME = 275,
KW_P_TIMEFACTOR = 276,
KW_P_ANIFRAMETIME = 277,
KW_P_ANISTART = 278,
KW_P_SURFACETENSION = 279,
KW_P_ACTIVATE = 280,
KW_P_DEACTIVATE = 281,
KW_P_DENSITY = 282,
KW_P_CELLSIZE = 283,
KW_P_GSTAR = 284,
KW_PFSPATH = 285,
KW_PARTLINELENGTH = 286,
KW_PARTICLES = 287,
KW_FRAMESPERSEC = 288,
KW_RAYTRACING = 289,
KW_PAROPEN = 290,
KW_PARCLOSE = 291,
KW_FILENAME = 292,
KW_PMCAUSTICS = 293,
KW_MAXRAYDEPTH = 294,
KW_CAUSTICDIST = 295,
KW_CAUSTICPHOT = 296,
KW_SHADOWMAPBIAS = 297,
KW_TREEMAXDEPTH = 298,
KW_TREEMAXTRIANGLES = 299,
KW_RESOLUTION = 300,
KW_ANTIALIAS = 301,
KW_EYEPOINT = 302,
KW_ANISTART = 303,
KW_ANIFRAMES = 304,
KW_FRAMESKIP = 305,
KW_LOOKAT = 306,
KW_UPVEC = 307,
KW_FOVY = 308,
KW_ASPECT = 309,
KW_AMBIENCE = 310,
KW_BACKGROUND = 311,
KW_DEBUGPIXEL = 312,
KW_TESTMODE = 313,
KW_OPENGLATTR = 314,
KW_BLENDERATTR = 315,
KW_ATTRIBUTE = 316,
KW_ATTRCHANNEL = 317,
KW_OBJATTR = 318,
KW_EQUALS = 319,
KW_DEFINEATTR = 320,
KW_ATTREND = 321,
KW_GEOMETRY = 322,
KW_TYPE = 323,
KW_GEOTYPE_BOX = 324,
KW_GEOTYPE_FLUID = 325,
KW_GEOTYPE_OBJMODEL = 326,
KW_GEOTYPE_SPHERE = 327,
KW_CASTSHADOWS = 328,
KW_RECEIVESHADOWS = 329,
KW_VISIBLE = 330,
KW_BOX_END = 331,
KW_BOX_START = 332,
KW_POLY = 333,
KW_NUMVERTICES = 334,
KW_VERTEX = 335,
KW_NUMPOLYGONS = 336,
KW_ISOSURF = 337,
KW_FILEMODE = 338,
KW_INVERT = 339,
KW_MATERIAL = 340,
KW_MATTYPE_PHONG = 341,
KW_MATTYPE_BLINN = 342,
KW_NAME = 343,
KW_AMBIENT = 344,
KW_DIFFUSE = 345,
KW_SPECULAR = 346,
KW_MIRROR = 347,
KW_TRANSPARENCE = 348,
KW_REFRACINDEX = 349,
KW_TRANSADDITIVE = 350,
KW_TRANSATTCOL = 351,
KW_FRESNEL = 352,
KW_LIGHT = 353,
KW_ACTIVE = 354,
KW_COLOUR = 355,
KW_POSITION = 356,
KW_LIGHT_OMNI = 357,
KW_CAUSTICPHOTONS = 358,
KW_CAUSTICSTRENGTH = 359,
KW_SHADOWMAP = 360,
KW_CAUSTICSMAP = 361
};
#endif
#define DT_INTEGER 258
#define DT_FLOAT 259
#define DT_STRING 260
#define DT_ATTRNAME 261
#define DT_ATTRVALUE 262
#define KW_LBMSIM 263
#define KW_COMPARELBM 264
#define KW_ANIFRAMETIME 265
#define KW_DEBUGMODE 266
#define KW_DEBUGLEVEL 267
#define KW_P_RELAXTIME 268
#define KW_P_REYNOLDS 269
#define KW_P_VISCOSITY 270
#define KW_P_SOUNDSPEED 271
#define KW_P_DOMAINSIZE 272
#define KW_P_FORCE 273
#define KW_P_TIMELENGTH 274
#define KW_P_STEPTIME 275
#define KW_P_TIMEFACTOR 276
#define KW_P_ANIFRAMETIME 277
#define KW_P_ANISTART 278
#define KW_P_SURFACETENSION 279
#define KW_P_ACTIVATE 280
#define KW_P_DEACTIVATE 281
#define KW_P_DENSITY 282
#define KW_P_CELLSIZE 283
#define KW_P_GSTAR 284
#define KW_PFSPATH 285
#define KW_PARTLINELENGTH 286
#define KW_PARTICLES 287
#define KW_FRAMESPERSEC 288
#define KW_RAYTRACING 289
#define KW_PAROPEN 290
#define KW_PARCLOSE 291
#define KW_FILENAME 292
#define KW_PMCAUSTICS 293
#define KW_MAXRAYDEPTH 294
#define KW_CAUSTICDIST 295
#define KW_CAUSTICPHOT 296
#define KW_SHADOWMAPBIAS 297
#define KW_TREEMAXDEPTH 298
#define KW_TREEMAXTRIANGLES 299
#define KW_RESOLUTION 300
#define KW_ANTIALIAS 301
#define KW_EYEPOINT 302
#define KW_ANISTART 303
#define KW_ANIFRAMES 304
#define KW_FRAMESKIP 305
#define KW_LOOKAT 306
#define KW_UPVEC 307
#define KW_FOVY 308
#define KW_ASPECT 309
#define KW_AMBIENCE 310
#define KW_BACKGROUND 311
#define KW_DEBUGPIXEL 312
#define KW_TESTMODE 313
#define KW_OPENGLATTR 314
#define KW_BLENDERATTR 315
#define KW_ATTRIBUTE 316
#define KW_ATTRCHANNEL 317
#define KW_OBJATTR 318
#define KW_EQUALS 319
#define KW_DEFINEATTR 320
#define KW_ATTREND 321
#define KW_GEOMETRY 322
#define KW_TYPE 323
#define KW_GEOTYPE_BOX 324
#define KW_GEOTYPE_FLUID 325
#define KW_GEOTYPE_OBJMODEL 326
#define KW_GEOTYPE_SPHERE 327
#define KW_CASTSHADOWS 328
#define KW_RECEIVESHADOWS 329
#define KW_VISIBLE 330
#define KW_BOX_END 331
#define KW_BOX_START 332
#define KW_POLY 333
#define KW_NUMVERTICES 334
#define KW_VERTEX 335
#define KW_NUMPOLYGONS 336
#define KW_ISOSURF 337
#define KW_FILEMODE 338
#define KW_INVERT 339
#define KW_MATERIAL 340
#define KW_MATTYPE_PHONG 341
#define KW_MATTYPE_BLINN 342
#define KW_NAME 343
#define KW_AMBIENT 344
#define KW_DIFFUSE 345
#define KW_SPECULAR 346
#define KW_MIRROR 347
#define KW_TRANSPARENCE 348
#define KW_REFRACINDEX 349
#define KW_TRANSADDITIVE 350
#define KW_TRANSATTCOL 351
#define KW_FRESNEL 352
#define KW_LIGHT 353
#define KW_ACTIVE 354
#define KW_COLOUR 355
#define KW_POSITION 356
#define KW_LIGHT_OMNI 357
#define KW_CAUSTICPHOTONS 358
#define KW_CAUSTICSTRENGTH 359
#define KW_SHADOWMAP 360
#define KW_CAUSTICSMAP 361
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 85 "src/cfgparser.yy"
typedef union YYSTYPE {
int intValue;
float floatValue;
char *charValue;
} YYSTYPE;
/* Line 1318 of yacc.c. */
#line 255 "bld-std-gcc/src/cfgparser.hpp"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yy_lval;