Commit Graph

262 Commits

Author SHA1 Message Date
4091851043 Replace all glFinish() with glFlush().
This is supposed to fix gradual slowdown of Blender interface on ATI cards.
2004-06-16 11:34:45 +00:00
6b51c684f1 NEW! Blender now displays flipped (negative scaled) Objects correctly in
OpenGL draw.

(BTW: the previous commit also solves raytrace errors with negative scaled
objects...)

Further a cleanup of displaylist flags and object/base flags. The #define
ACTIVE is moved to filesel.c (only used here).
The GONNA_MOVE #define got a OB_ added in front.
2004-05-29 16:17:46 +00:00
954e5546ea In drawing solid objects ("Solid" drawmode) there were material
switches (glMaterial) inbetween a glBegin and glEnd. Combined with a
switch of glShadeModel however, on recent Nvidia it caused faces not
to be drawn... dunno if this is official compliancy, but not too
complex just to correct.
2004-05-26 21:04:02 +00:00
ec45e4ad78 Patch provided by Matthew Plough for better view zoom with CTRL+middle
mouse.

For me it's a good replacement, and more intuitive & compatible. Now
let's wait for the storm of reactions...
2004-05-18 19:59:50 +00:00
a0d82b242f Drawing cylinder & cone bounding objects according to how they will act in the physics simulation. 2004-05-16 13:23:59 +00:00
208a2937f7 PATCH!
Bug 1258: selecting objects with text drawing (axis, or as draw extra)
causes crashes in IBM cards. Has been tested & verified. A crash on
selecting Empty is often reported... so I just disabled drawing of
text when in selecting-draw mode.
Added comments in code to note it clearly.
2004-05-10 20:14:21 +00:00
24a8327d25 fix for bug #1263
When zooming in extreme, scaling things outside of view caused dashed
line to be wrong... it used shorts for screencoords. Made it a float.
2004-05-09 21:15:05 +00:00
e74a3b4166 Bug 1142
In Mesh editmode, with option "draw faces", hiding 1 vertex of a quad
doesn't always result in not drawing the face. Only 3 out of 4 vertices
were tested.
2004-04-10 11:33:01 +00:00
78c613e7f2 Fixed bug #1007:
With extra Wire and Bounds (Cylinder, Cone or Sphere) drawing enabled in the
Object Buttons, the Wire was drawn incorrectly.
2004-04-06 14:37:25 +00:00
9206a1eba6 - replaced G.{edve,eded,edvl} with G.editMesh, atm just a structure to
hold the three lists, nothing major, but gives a place to hang data
    off of and a single "mesh" structure to pass around for editing
    functions.
2004-03-28 08:46:35 +00:00
aedf456938 - split the data structures that actually constitute a mesh
(MVert,MFace,etc) off into DNA_meshdata_types.h, to isolate areas
    of source that actually edit mesh *data* vs. areas that just edit
    mesh object information.
2004-03-20 22:55:42 +00:00
Chris Want
dd3c9c0c46 Removed the struct MFaceInt from DNA_mesh_types.h (by the recommendation
of zr). This struct was never written to file and the new 'int based'
MFace can be used in it's place. Some removal of redundant code could
perhaps be done now (I didn't do any though, just "s/MFaceInt/MFace/").
2004-03-14 21:00:51 +00:00
7ba0272093 rwenzlaff: Added a small round-off constant to Faceloopcut's percent calc
so that it rounds numbers off consistantly.  (Fixes bug #970) Though
	it was only a 0.03% error.

	Also fixed some sloppy/missing comments.
2004-03-09 13:49:45 +00:00
9ed4436058 Updated the Sun ifdef's basically I standardized them so they
were all the same and make sure all platforms see them.

Kent
2004-03-06 19:32:33 +00:00
60a5328d4b Drawing a line to show where the area lights are heading.
Feel free to make better.
2004-01-18 16:55:07 +00:00
247d40d11e - fix for drawing lamp name in 3d window at correct location. 2004-01-17 13:15:19 +00:00
Chris Want
a5a01ed549 Armature speed ups, Part I
--------------------------

Major speed up for armatures during times when you aren't
posing a figure.

Background: the calculation of poses generated by actions and the
calculation of displists were getting somewhat out of sync.
This was being remedied by 'clearing the constraint done flag'
of the pose channels and recalculating the displists every time
the 3d view was redrawn, making life slow and unpleasant.
Commenting out the code that was doing this, then reinserting
the 'clearing the constraint done flag' at the right times
made things a bit more perky.
2004-01-02 23:29:34 +00:00
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
cad30134cb - Bug fix: lamp axis was not drawn at correct location. Was already wrong
since a long long time... :P
2003-12-10 19:01:26 +00:00
43369f076f - added wire color theme usage for drawing edges in editmode. 2003-12-04 11:37:39 +00:00
d3563d23b7 No line for constraint without target
Code notes:

The constraint_has_target can be used to test if a constraint has a target at all.
2003-11-23 20:28:35 +00:00
71500a2df1 - fixed another oldie... displaylists for MBall was generated FAR too often.
even for each redraw! Now its all smooth & fast again.

  introduced new kernel API call: int is_basis_mball(ob), this provides a
  quick check of the object is the actual basis for the displaylist and
  polygonization.
2003-11-21 12:30:15 +00:00
487fd93a2b - bug fix: subdiv level 0 and drawtype 'optim' caused mesh not drawing
in editmode...
2003-11-19 22:38:19 +00:00
f83a7dfc11 - fixed warning by not prototyping something a couple of commits ago... 2003-11-19 22:13:53 +00:00
4a5ae4a55f Fix for undo... it didn't do the UV coords (tface) nor the vertexpaint
colors. This because of the pretty weird (ab)use of load & make editmesh...

For each added undo step, the load_editmesh was fed with an empty mesh
to assign data to, without knowledge of what was in the original mesh.
That way UV and color data got lost.

Solved it in 2 steps:

1. removing the ->tface pointer from EditVlak, and make TFace a builtin
  struct inside EditVlak. This didnt cost much extra mem, since it already
  stored UV and color. This enabled some pretty cleanup in editmesh.c as
  well, storing tface pointers was cumbersome.
2. for each undo step, it then generates always a tface and mcol block to
  link to the undo Mesh.
  Even when it wasn't in the actual Mesh, at exit editmode the original
  Mesh is used as reference anyway, and undo-meshes are freed correctly.

The enormous commit is because I had to change the BLI_editVert.h file, and
found it was included in about every file unnecessary. I removed it there.
ALso found out that subsurf has code ready (unfinished) to make UV coords for
the displaylist in EditMode as well, nice to know for later...
2003-11-19 22:00:14 +00:00
683b51fe83 - added color for constraint dashed line 2003-11-17 22:33:11 +00:00
0894c8e3e2 - fix: vpaint and weightpaint and texturepaint allow drawmode wire-extra
again.
2003-11-17 21:10:18 +00:00
2403120f33 Constraint dashed line drawing.
Still one little problem: It draws the line even where there is not constraint target. Guess I'll have to wip a function to check for that if there isn't one already.

Note to Ton: You just need to add the color link to theme
2003-11-11 16:56:51 +00:00
6b6cc8d97a - further tweaking of selecting objects...
I keep forgetting to add 'curarea->win_swap= WIN_FRONT_OK;' after
  drawing in frontbuffer... tsk tsk!
2003-11-10 15:28:48 +00:00
602fe19b6f - fixed drawing in frontbuffer of selected object... the previous
fix for selecting multiple objects reveiled this error...
2003-11-08 17:51:32 +00:00
e51a464731 - fixed this nasty selection problem, i hope for good!
- problem was in limiting the abuse of frontbuffer drawing as happended
  a lot in 2.28 and older. the less the better...
- bug was not registering a curarea->win_swap=FRONT_OK, to indicate there
  was only drawn in frontbuffer
- cleaned up calls further, and made sure it doesnt draw 1 vertex too many!
  also means it works better with selecting in solid drawmode now, check!
2003-10-26 23:47:58 +00:00
bbd9018ec5 - fixed colors of ipokeys in 3d window
- fixed constraint popup menu (used icons)
- moved 'full' and 'View3d props' and 'background' items in menu to bottom
  Hope Matt wont kill me for it, but these were about the only useful
  ones there... :)
- little fix in interface.c for menus...
2003-10-25 22:29:24 +00:00
9a625925da Cleaned up new constraint line drawing while grab/rot/scale
- uses callback mechanism to tell main drawing routine what to do
- for that reason it doesn't use frontbuffer drawing anymore
  and it shows up in all 3d windows as well
- it uses the same colors as for the grid axes (I tweaked it a bit,
  this is based at themecolors, and also should work in different
  background and grid color)
- I disabled drawing lines through every object or every vertex.
  The current display method is clear and not distracting
- when in 'local' transform (double press X/Y/Z), it displays a nice
  axis in the center of transform for vertices.
  In object-mode, local transform differs per object, so constraint lines
  and axes are drawn for each individually...

Also:

- fixed an old bug in rotate transform(). Using a constraint for
  rotation (X, Y, Z) didn't work for multiple objects at all!
2003-10-23 16:15:05 +00:00
389b06c91e More fixes in object drawing:
- transparent faces in editmode don't write in zbuffer anymore (prevents
  drawing errors) but still read (so behind the subsurf faces for example)
- improved drawing 'handles' for subsurf editing
- going in editmode to Solid view, will draw extra wire always, including
  transparent faces when set
- works in all combos... http://www.blender.org/docs/ton/subsurf.html

- fixed error; padplus/padminus didnt work in buttonswindow anymore
- improved buttonswin: when dragging window edge, the buttons dont
  rescale, but stay same size
2003-10-22 09:06:30 +00:00
e0e45e81da - fixed error; the vertices didnt draw anymore in editmode with sold draw.
was caused because i only tested the new cool 'draw wire extra'. :)

- by default, in solid draw mode & editmode, it does a 'draw wire extra'
  now, giving nice clean editmesh drawing.

- there's still a few quirks, i do a test now... this commit is to have
  a good working blender in cvs. the whole drawing system is such chaos...
2003-10-21 21:59:00 +00:00
a0824f8fb9 Mesh drawing stuff!
- in zbuffer mode, vertices will be blended 50% in... and when you increase
  vertex size larger than 2 pixels, it will draw them smaller
- removed all 'wire extra' calls (there were dozens!) and replaced it with
  simple call where it belongs.
  This drawing mode is becoming nice & stable... maybe something to make
  default on for new objects? Makes selecting quite easier...

- Subsurf: in editmode, with new 'Optimal' option set, the mesh itself
  will not draw, but instead it draws 'handles' to the vertices. Looks
  extremely clean!

- matched drawing of default grid-floor (persp) to ortho grid

- killed drawing vertices outside of main drawing loop, apart from the
  routine that uses mouse-selecting. (tekenvertices_ext()). It was an old
  optimize routine which became quite useless.
2003-10-21 16:41:28 +00:00
41f4940bff Helpline drawing in transform (semi broken in this commit)
This is only usefull for rotate now, but the axis constraining code has a part that depended on this, so I commit this part first.

For coders:

void constline(float *center, float *dir, int col)
	Draw an infinite line on the screen. col is the color argument. It must be cpack compatible

void project_short_infiniteline(float *vec, float *dir, short *adr1, short *adr2);
	clips infinite line to screen border
2003-10-21 16:25:00 +00:00
2da9cb5db2 fixed bugs:
- faceselect mode works again
- selecting vertices for lattices, surfaces and curves works again
- in previewrender sometimes a square was drawn, which was texture-crop
2003-10-21 12:23:38 +00:00
8e2225e027 - another formula for 'draw wire extra'. this time it doen't scale, but
only moves z-values in drawing in zbuffer. still matrix art I don't
  fully grasp... but it seems to work!
2003-10-21 08:43:29 +00:00
ff89daceb0 - fixed drawmode 'wire extra'.
it was using some unsupported linewidth trick... I've been trying to
  get the official glPolygonOffset to working, but my silly Mac doesnt
  support it, it seems.
  So! I thought of another trick, and that's just moving the window
  matrix a little to the front. :)

- for those interested; the code for glPolygonOffset is still there,
  commented out. (drawobject.c)

- btw: the drawobject.c routines are a TOTAL mess!
2003-10-20 23:20:37 +00:00
7893cc25d1 - added new drawing type for subsurf editing. Is called 'Optimal' and
can be found under the 'SubSurf' button.
  Optimal drawing only shows the subdivided original edges. Quite nice!
  And; it's a load faster!

- to evaluate: do we want this in editmode too?
2003-10-20 21:58:15 +00:00
7f5d06d638 Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
  AA fonts  as for default fonts. Now it's identical. Setting color for fonts
  can just be done with OpenGL, for both font types.
  Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color

- removed entirely the silly old color system (BIFColorID). All color
  calls can now be done with a BIF_ThemeColor() call, including fonts and
  buttons and opengl stuff

- all buttons in button header have headercolor by default

- recoded drawing icons, it was a really bad & old loop doing manually
  colorshading and blending... which was per pixel a load of code!
  Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
  but have a different alpha to blend in (when not active)


- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
  1. main drawing function for text and icons
  2. free definable callback for button itself
  3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
  callback system

- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
  UI_EMBOSS : the themable drawing style
  UI_EMBOSSP: the pulldown menu system (apart from color not themable)
  UI_EMBOSSN: draw nothing, only text and/or icon
  UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
  this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.

TODO: make UI API call for button alignment

(plus removed another series of warnings from code...)

Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
c6a2f42dba - simplified Theme API. No need to include 'current active area' anymore.
like: BIF_ThemeColor(TH_GRID); will be sufficient. Blender does the rest.
- fixed bug in CTRL-X (reload home file) with themes
- fixed bug in horizontal alignment of different height panels. Seems also
  to solve the drawing error with constraints...
2003-10-19 09:19:58 +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
7a7956509d - fixed edge selecting... :) 2003-10-16 20:36:29 +00:00
5d1438ad96 - fixed editing vertices again!
I had to clean up very old calls to switch matrices for 3d windows.
To make it more clear, I've introduced defines for the infamous persp()
function:

persp(PERSP_WIN);  sets matrices at pixel level window
persp(PERSP_VIEW); restores matrices back to 3d drawing
persp(PERSP_STORE); only called once, to store correct matrices

I will now check on frontbuffer drawing of vertices... it's very doubtful
if it's used still correctly, was only meant for visual speed in the
early nineties you know. :)
2003-10-16 09:39:19 +00:00
c01d06df3c - fixed display of dashed helpline, when rotating multiple objects or
around the 3d cursor.
  fix only works for OSX and certain nvidia cards. they need a glFinish()
  call after drawing in frontbuffer.
2003-09-17 10:23:53 +00:00
5572323a3a - added czech translation (cs.po)
- changed function drawcircball() in source/blender/src/drawobject.c. Circle is computed faster (no 32 calls of sin() and cos() each time witch same results).
2003-09-08 12:13:54 +00:00
03ada07a57 - fixed a small error, the change i made before with frontbuffer drawing
of right-mouse selection of objects, now calls a correct glFlush

  only to be noticed at osx and nvidia systems...
2003-07-21 17:46:55 +00:00
9a9cb5448b - changed order for 'draw faces'... it now draws first, then wire and
vertices
2003-07-20 20:38:22 +00:00