Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-12-28 18:42:51 +0300
committerTon Roosendaal <ton@blender.org>2005-12-28 18:42:51 +0300
commit9df1460777cceed839721ea99fd9623aedbb26f5 (patch)
treef4ad7ebfb6294be13c01a3dba67e55354973818e /source/blender/render
parent7837866b1e226925b2a50041e3f0f56ac9e82021 (diff)
Christmas coding work!
********* Node editor work: - To enable Nodes for Materials, you have to set the "Use Nodes" button, in the new Material buttons "Nodes" Panel or in header of the Node editor. Doing this will disable Material-Layers. - Nodes now execute materials ("shaders"), but still only using the previewrender code. - Nodes have (optional) previews for rendered images. - Node headers allow to hide buttons and/or preview image - Nodes can be dragged larger/smaller (right-bottom corner) - Nodes can be hidden (minimized) with hotkey H - CTRL+click on an Input Socket gives a popup with default values. - Changing Material/Texture or Mix node will adjust Node title. - Click-drag outside of a Node changes cursor to "Knife' and allows to draw a rect where to cut Links. - Added new node types RGBtoBW, Texture, In/Output, ColorRamp - Material Nodes have options to ouput diffuse or specular, or to use a negative normal. The input socket 'Normal' will force the material to use that normal, otherwise it uses the normal from the Material that has the node tree. - When drawing a link between two not-matching sockets, Blender inserts a converting node (now only for value/rgb combos) - When drawing a link to an input socket that's already in use, the old link will either disappear or flip to another unused socket. - A click on a Material Node will activate it, and show all its settings in the Material Buttons. Active Material Nodes draw the material icon in red. - A click on any node will show its options in the Node Panel in the Material buttons. - Multiple Output Nodes can be used, to sample contents of a tree, but only one Output is the real one, which is indicated in a different color and red material icon. - Added ThemeColors for node types - ALT+C will convert existing Material-Layers to Node... this currently only adds the material/mix nodes and connects them. Dunno if this is worth a lot of coding work to make perfect? - Press C to call another "Solve order", which will show all possible cyclic conflicts (if there are). - Technical: nodes now use "Type" structs which define the structure of nodes and in/output sockets. The Type structs store all fixed info, callbacks, and allow to reconstruct saved Nodes to match what is required by Blender. - Defining (new) nodes now is as simple as filling in a fixed Type struct, plus code some callbacks. A doc will be made! - Node preview images are by default float ********* Icon drawing: - Cleanup of how old icons were implemented in new system, making them 16x16 too, correctly centered *and* scaled. - Made drawing Icons use float coordinates - Moved BIF_calcpreview_image() into interface_icons.c, renamed it icon_from_image(). Removed a lot of unneeded Imbuf magic here! :) - Skipped scaling and imbuf copying when icons are OK size ********* Preview render: - Huge cleanup of code.... - renaming BIF_xxx calls that only were used internally - BIF_previewrender() now accepts an argument for rendering method, so it supports icons, buttonwindow previewrender and node editor - Only a single BIF_preview_changed() call now exists, supporting all signals as needed for buttos and node editor ********* More stuff: - glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format argument for GL_FLOAT rects - Made the ColorBand become a built-in button for interface.c Was a load of cleanup work in buttons_shading.c... - removed a load of unneeded glBlendFunc() calls - Fixed bug in calculating text length for buttons (ancient!)
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/extern/include/render.h1
-rw-r--r--source/blender/render/extern/include/render_types.h3
-rw-r--r--source/blender/render/intern/source/ray.c4
-rw-r--r--source/blender/render/intern/source/rendercore.c9
-rw-r--r--source/blender/render/intern/source/texture.c2
5 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/render/extern/include/render.h b/source/blender/render/extern/include/render.h
index 5f8ceb45b15..c0eced8ad3a 100644
--- a/source/blender/render/extern/include/render.h
+++ b/source/blender/render/extern/include/render.h
@@ -190,6 +190,7 @@ void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec);
void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi);
void matlayer_blend(struct MaterialLayer *ml, float blendfac, struct ShadeResult *target, struct ShadeResult *src);
+void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col);
/* --------------------------------------------------------------------- */
/* ray.c (2) */
diff --git a/source/blender/render/extern/include/render_types.h b/source/blender/render/extern/include/render_types.h
index dc2f5616f29..ed3a54975ce 100644
--- a/source/blender/render/extern/include/render_types.h
+++ b/source/blender/render/extern/include/render_types.h
@@ -102,7 +102,8 @@ typedef struct ShadeInput
float dxrefract[3], dyrefract[3];
float dxstrand, dystrand;
- float xs, ys; /* pixel to be rendered */
+ int xs, ys; /* pixel to be rendered */
+ short do_preview, pr_type; /* for nodes, in previewrender */
short osatex, puno;
int mask;
int depth;
diff --git a/source/blender/render/intern/source/ray.c b/source/blender/render/intern/source/ray.c
index 30973b0891b..a91219846de 100644
--- a/source/blender/render/intern/source/ray.c
+++ b/source/blender/render/intern/source/ray.c
@@ -2071,7 +2071,7 @@ void ray_ao(ShadeInput *shi, World *wrld, float *shadfac)
nrm= shi->facenor;
}
- vec= sphere_sampler(wrld->aomode, wrld->aosamp, floor(shi->xs+0.5), floor(shi->ys+0.5) );
+ vec= sphere_sampler(wrld->aomode, wrld->aosamp, shi->xs, shi->ys);
// warning: since we use full sphere now, and dotproduct is below, we do twice as much
tot= 2*wrld->aosamp*wrld->aosamp;
@@ -2202,7 +2202,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac)
else shadfac[3]= 1.0; // 1.0=full light
fac= 0.0;
- jitlamp= give_jitter_plane(lar, floor(shi->xs+0.5), floor(shi->ys+0.5));
+ jitlamp= give_jitter_plane(lar, shi->xs, shi->ys);
a= lar->ray_totsamp;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 890a0b26674..acac0d48e2c 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -2198,7 +2198,7 @@ void shade_input_set_coords(ShadeInput *shi, float u, float v, int i1, int i2, i
}
if(texco & TEXCO_REFL) {
/* mirror reflection colour textures (and envmap) */
- calc_R_ref(shi);
+ calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
}
if(texco & TEXCO_STRESS) {
float *s1, *s2, *s3;
@@ -2279,9 +2279,10 @@ void *shadepixel(float x, float y, int z, int facenr, int mask, float *col, floa
return NULL;
}
/* currently in use for dithering (soft shadow) and detecting thread */
- shi.xs= x;
- shi.ys= y;
-
+ shi.xs= (int)(x+0.5f);
+ shi.ys= (int)(y+0.5f);
+ shi.do_preview= 0;
+
/* mask is used to indicate amount of samples (ray shad/mir and AO) */
shi.mask= mask;
shi.depth= 0; // means first hit, not raytracing
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index f792a07e307..9b38a65a4b9 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2352,7 +2352,7 @@ void render_realtime_texture(ShadeInput *shi)
tex2.type= TEX_IMAGE;
}
- if(((int)(shi->ys+0.5)) & 1) tex= &tex1; else tex= &tex2; // threadsafe
+ if(shi->ys & 1) tex= &tex1; else tex= &tex2; // threadsafe
ima = shi->vlr->tface->tpage;
if(ima) {