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

vanillaRenderPipe_int.h « include « intern « render « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 024b82cc812aeff1cf3734a080f1a2e876ba2210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*
 * vanillaRenderPipe_int.h
 *
 * $Id$
 *
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
 *
 * 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
 * of the License, or (at your option) any later version. The Blender
 * Foundation also sells licenses for use in proprietary software under
 * the Blender License.  See http://www.blender.org/BL/ for information
 * about this.
 *
 * 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.
 *
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): none yet.
 *
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
 */

#ifndef VANILLARENDERPIPE_INT_H
#define VANILLARENDERPIPE_INT_H

#include "vanillaRenderPipe_types.h"
#include "zbufferdatastruct_types.h"

/**
 * Z buffer initializer, for new pipeline.
 * <LI>
 * <IT> AColourBuffer : colour buffer for one line
 * <IT> APixbufExt    : pixel data buffer for one line, depth RE_ZBUFLEN 
 * </LI>
 */
void initRenderBuffers(int width);
/*  void initRenderBuffers(void); */

/**
 * Z buffer destructor, frees stuff from initZBuffers().
 */
void freeRenderBuffers(void);

/** 
 * Fill the accumulation buffer APixbufExt with face and halo indices. 
 * Note: Uses globals.
 * @param y the line number to set
 */
void calcZBufLine(int y);

/** 
 * Shade and render the pixels in this line, into AColourBuffer
 * Note: Uses globals.
 * @param y the line number to set
 */
void renderZBufLine(int y);

/**
 * Count and sort the list behind ap into buf. Sorts on min. distance.
 * Low index <=> high z
 */
int countAndSortPixelFaces(int buf[RE_MAX_FACES_PER_PIXEL][5], 
                           RE_APixstrExt *ap);

/** 
 * Compose the conflict and colour stacks 
 * Note: Uses globals.
 */
int composeStack(int zrow[RE_MAX_FACES_PER_PIXEL][RE_PIXELFIELDSIZE],
				 struct RE_faceField* stack, int ptr,
				 int totvlak, float x, float y, int osaNr);
/**
 * Integrate conflicting layers.
 * Note: Uses globals.
 */
int resolveConflict(struct RE_faceField* stack, int ptr, float x, float y);

/**
 * Integrate the colour stack, defer conflicts.
 * Note: Uses globals.
 */
void integrateStack(struct RE_faceField* stack, int ptr,
					float x, float y, int osaNr);
					
/**
 * Calculate the view depth to this object on this location, with 
 * the current view parameters in R.
 */
int calcDepth(float x, float y, void *data, int type);



/**
 * Fills in distances of all faces in a z buffer, for given jitter settings.
 */
int fillZBufDistances(void);

/**
 * Fills in distances of faces in the z buffer.
 *
 * Halo z buffering ---------------------------------------------- 
 *
 * A halo is treated here as a billboard: no z-extension, always   
 * oriented perpendicular to the viewer. The rest of the z-buffer  
 * stores face-numbers first, then calculates colours as the       
 * final image is rendered. We'll use the same approach here,      
 * which differs from the original method (which was add halos per 
 * scan line). This means that the z-buffer now also needs to      
 * store info about what sort of 'thing' the index refers to.      
 *                                                                 
 * Halo extension:                                                 
 * h.maxy  ---------                                               
 *         |          h.xs + h.rad                                 
 *             |      h.xs                                         
 *                 |  h.xs - h.rad                                 
 * h.miny  ---------                                               
 *                                                                 
 * These coordinates must be clipped to picture size.              
 * I'm not quite certain about halo numbering.                     
 *                                                                 
 * Halos and jittering -------------------------------------------  
 *                                                                 
 * Halos were not jittered previously. Now they are. I wonder      
 * whether this may have some adverse effects here.                
 
 * @return 1 for succes, 0 if the operation was interrupted.
 */
int zBufferAllFaces(void);

/**
 * Fills in distances of halos in the z buffer.
 * @return 1 for succes, 0 if the operation was interrupted.
 */
int zBufferAllHalos(void);

/**
 * New fill function for z buffer, for edge-only rendering.
 */
void zBufferFillEdge(float *vec1, float *vec2);

/**
 * New fill function for z buffer.
 */
void zBufferFillFace(float *v1, float *v2, float *v3);

/**
 * One more filler: fill in halo data in z buffer.
 * Empty so far, but may receive content of halo loop.
 */
void zBufferFillHalo(void);

/**
 * Copy the colour buffer output to R.rectot, to line y.
 */
void transferColourBufferToOutput(int y);

/**
 * Set the colour buffer fields to zero.
 */
void eraseColBuf(RE_COLBUFTYPE *buf);

/**
 * Blend source over dest, and leave result in dest. 1 pixel.
 */
void blendOverFloat(int type, float* dest, float* source, void* data);

/**
 * Blend source over dest, and leave result in dest. 1 pixel into 
 * multiple bins.
 */
void blendOverFloatRow(int type, float* dest, float* source, 
                       void* data, int mask, int osaNr) ;

/**
 * Do a post-process step on a finalized render image.
 */
void std_transFloatColV2CharColV( RE_COLBUFTYPE *buf, char *target);

#endif /* VANILLARENDERPIPE_INT_H */