WO1998050890A1 - Procede d'obtention de fonction projecteur et processeur d'images utilisant ce procede - Google Patents

Procede d'obtention de fonction projecteur et processeur d'images utilisant ce procede Download PDF

Info

Publication number
WO1998050890A1
WO1998050890A1 PCT/JP1998/001475 JP9801475W WO9850890A1 WO 1998050890 A1 WO1998050890 A1 WO 1998050890A1 JP 9801475 W JP9801475 W JP 9801475W WO 9850890 A1 WO9850890 A1 WO 9850890A1
Authority
WO
WIPO (PCT)
Prior art keywords
light source
characteristic
spotlight
polygon
light
Prior art date
Application number
PCT/JP1998/001475
Other languages
English (en)
French (fr)
Inventor
Seisuke Morioka
Keisuke Yasui
Original Assignee
Sega Enterprises, Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sega Enterprises, Ltd. filed Critical Sega Enterprises, Ltd.
Priority to DE69826996T priority Critical patent/DE69826996T2/de
Priority to US09/214,494 priority patent/US6333742B1/en
Priority to EP98911132A priority patent/EP0974935B1/en
Priority to JP54791098A priority patent/JP4060375B2/ja
Publication of WO1998050890A1 publication Critical patent/WO1998050890A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/80Shading

Definitions

  • the present invention relates to a spotlight characteristic forming method and an image processing apparatus using the same.
  • the present invention relates to a method for forming a spotlight characteristic for giving a spotlight effect to an object displayed as an image by a computer graphics technique, and an image processing apparatus using the method. '' Conventional technology
  • O pen GL (trademark) method developed by Silicon Graphics.
  • Fig. 1 when considering a vector L of light from the spot light source 0 in the direction of the predetermined point P and an axis vector D of the light source from the spot light source 0 to the object, 0 pen GL
  • the characteristics of the spotlight are calculated using the following equation (1), specifying the parameters “spotexp : ” and “cutoff”.
  • the characteristics are as shown in FIG.
  • Fig. 2 when "spotexp" is set to a large value, the spot becomes narrower.
  • the characteristics of the spot are often considered based on the spread angle of the spot. Therefore, it is necessary to reverse-calculate the value of “spotex” at which the “spot Effect” becomes less than a certain value at the specified spread angle of the spot, but such reverse calculation is not a simple calculation process.
  • the shape of the spot characteristic curve is uniquely determined by the value of "spotex”, the spot opening and intensity distribution cannot be specified independently. As a result, the spot opening is narrow as in the case of a search light, and it is not possible to obtain a characteristic with a substantially constant intensity distribution, resulting in blurred spot light.
  • the value of "spotEffct" is set to 0 when the parameter "cutoff" is over a certain angle. That is, since it is a parameter designating an angle different from "spotexp", control is easy. However, since the intensity distribution becomes discontinuous, there is a disadvantage that the edge of the spot is sharp and the intensity distribution has only a constant spot characteristic.
  • the spot characteristics are calculated by the following equation (2).
  • the characteristic is specified by the angle, so that the control is easy and the calculation is simple.
  • the edge enhancement is a visual effect in which the brightness of the boundary is enhanced unless the brightness changes continuously in a region adjacent to the boundary region.
  • FIG. 5 shows a block diagram of an example of a conventional image processing apparatus.
  • CPU 1 controls the execution of a program for processing an image using polygons.
  • the CPU 1 reads the polygon data from the polygon buffer 11 and outputs it to the coordinate conversion unit 2.
  • the coordinate conversion unit 2 converts the polygon three-dimensional data into two-dimensional coordinates for display on the CRT display device 7.
  • the polygon data converted to the two-dimensional coordinates is sent to a filling circuit 30 and a texture generating circuit 31.
  • the fill circuit 30 calculates the information of the pixels (pixels) in the range surrounded by each vertex of the polygon.
  • the calculation for the above fill is For example, linear interpolation is performed on the information of the pixels between the vertices based on the information of the corresponding vertices.
  • the texture generation circuit 31 is a circuit that reads a texture corresponding to a pixel from an internal texture buffer and calculates a color for each pixel. The output of the texture generation circuit 31 is supplied to the shading circuit 32 as pixel data.
  • the shading circuit 32 is a circuit provided to each pixel based on the pixel data, for example, for obtaining the lighting effect by the spotlight described above.
  • the output of the shading circuit 32 is a color modulation circuit 12 and a mixing circuit.
  • Circuit 3 is led to 3.
  • the color modulation circuit 12 is a circuit that performs color modulation for each pixel based on the result obtained by the shading circuit 32, and the like
  • the mixing circuit 33 is a circuit that converts the color information of the pixels of the polygon into the previously drawn color information. Mix it with the information and write it to Frameno Sofa 5 as one screen of data.
  • the information of the frame buffer 5 is displayed on the CRT display device 7.
  • the shading circuit 32 for example, there are four light source registers 329 and four corresponding light source calculators (not shown) corresponding to the four light source registers 329. Information can be processed at once.
  • the information of the light sources a, b, c, and d is stored in advance in the light source registers A, B, C, and D. Based on the information of the light sources a, b, c, and d stored in the shading circuit 32 and the light source register 32, how each pixel is affected by the light sources a, b, c, and d. Calculate whether to receive.
  • the light source information includes, for example, the direction vector of the spot axis (Dx, Dy, Dz), the cutoff angle (Cutoff), and the blur width as described with reference to FIG. 1 or FIG.
  • the normalization coefficient (Penumbra-scale) is used.
  • the ⁇ -ding circuit 6 performs shading calculation based on the light source information, and sums up the results to obtain four values for each pixel. I was calculating the effect from the light source.
  • the number of light source registers 329 and the number of light source arithmetic units corresponding to the number of light sources that can be used in one image scene are provided. In general, the number of light sources in one image scene is equal to the number of light source registers.
  • an object of the present invention is to provide a spotlight characteristic forming method and an image processing apparatus using the same, which solve the above problem.
  • an object of the present invention is to provide a spotlight characteristic forming method that realizes a complex operation by a calculation process using an arithmetic unit in a conventional method using a table, and a spotlight characteristic forming method that realizes the method.
  • An object of the present invention is to provide an image processing apparatus used.
  • a polygon is strongly affected by a light source only at a light source located close to the polygon or with a strong light source. For example, if there are 100 light sources in an image scene, one polygon is strongly affected only by four or five light sources near the polygon. .
  • an object of the present invention is to provide an image processing method and an image processing apparatus which can increase the number of light sources that can be used in one image scene while maintaining the number of light sources that can be processed by the shading circuit. And there.
  • the spotlight characteristic forming method for achieving the object of the present invention and an image processing apparatus to which the method is applied have, as a basic configuration, a plurality of characteristic values corresponding to a predetermined spotlight characteristic curve.
  • the spotlight characteristic curve is formed by interpolating between characteristic values read from this table or adjacent characteristic values read from the table or interpolated values obtained from the table. It is characterized by
  • a plurality of characteristic values are stored in advance in a table corresponding to the spotlight characteristic curve. Further, a configuration is used in which the characteristic value read from the table or the interpolated value obtained by interpolating between adjacent characteristic values read from the table is used. Therefore, since a plurality of characteristic values can be made to correspond to the spotlight characteristic curve, an arbitrary spotlight characteristic can be formed.
  • the characteristic is obtained from the address of the table according to the inner product of the optical axis vector of the spotlight and the light vector from the light source to each pixel or from each pixel to the light source.
  • the value is read.
  • the optical axis vector of the spotlight and at least two axes perpendicular to the optical axis vector of the spotlight are defined, and the optical axis vector of the spotlight and the vertical axis are defined.
  • At least two planes each defined by at least two axes, and an orthographic projection of at least two planes from the light source to each pixel or from each pixel to the light source
  • the characteristic value is read from the table corresponding to the angle between and, and the spotlight characteristic is obtained by the read characteristic value or the interpolated value between the characteristic values adjacent to each other read from this table.
  • a memory for storing information of a plurality of light sources, Means for shading a polygon with information of a predetermined number of light sources, and means for reading information of a predetermined number of light sources from a memory corresponding to the polygon and supplying the information to a means for shading.
  • an object of the present invention is to provide, in an image processing apparatus for giving an illumination effect of a light source to an object displayed by a plurality of polygons, a memory for storing a plurality of information sets of a plurality of light sources, and a single polygon.
  • the information on the plurality of light sources is stored in the buffer as a group, and the light source identification symbol attached to each polygon is changed from the buffer to the group. To read out the light source information. Therefore, the process of selecting the light source information for each polygon can be omitted, and the processing speed can be improved.
  • the above object is to provide a first step of writing information of a light source used in an image scene ⁇ into a memory in an image processing method for giving an illumination effect of a light source to an object displayed by a plurality of polygons.
  • a second step for identifying the affected light source for each polygon a third step for performing coordinate transformation on the polygon data, and writing an identification code for each pixel of the polygon.
  • an eighth step of writing pixel data to the frame buffer It is possible.
  • each pixel in the polygon only needs to calculate the influence of the light source specified by the light source identification symbol, the shading processing speed can be improved.
  • the light sources constituting the set of light sources can be used at least in part for each polygon. Therefore, by partially using the light sources, it is possible to use more light sources than the number of light sources in the scene while maintaining the number of light sources that can be used simultaneously.
  • Figure 1 is a diagram illustrating the open GL method.
  • FIG. 2 is a diagram showing spot characteristics according to the open GL method.
  • FIG. 3 is a diagram for explaining a method of designating an angle at which a spot starts blurring (cone angle) and an angle at which the blur ends (spread angle).
  • FIG. 4 is a diagram showing spot characteristics according to the method of FIG.
  • FIG. 5 is a block diagram of a configuration example of a conventional image processing apparatus.
  • FIG. 6 is a block diagram of a configuration example of an image processing apparatus to which the spotlight characteristic forming method of the present invention is applied.
  • FIG. 7 is a block diagram of a configuration of an embodiment of a shading circuit to which the present invention is applied.
  • FIG. 8 is a block diagram of a configuration example of a spot characteristic generation circuit applied to a shading circuit according to the present invention.
  • FIG. 9 is an example of a conventional configuration compared to clarify the features of the circuit of FIG.
  • FIG. 10 is a block diagram showing a configuration example of the address generator.
  • FIG. 11 is a diagram for explaining an illumination effect by a spot light source having an axis vector.
  • FIG. 12 is a diagram for explaining spot effect characteristics shown as an example by a spot light source having an axial vector.
  • FIG. 13 is a diagram illustrating another embodiment of the present invention.
  • FIG. 14 is a block diagram of a first configuration example of the image processing apparatus of the present invention.
  • FIG. 15 is a block diagram of a second configuration example of the image processing apparatus of the present invention.
  • FIG. 16 is a block diagram of a third configuration example of the image processing apparatus of the present invention.
  • FIG. 17 is a diagram showing the contents of the light source buffer in the configuration example of FIG.
  • FIG. 18 is a block diagram of an embodiment of a shading circuit to which the present invention is applied.
  • FIG. 19 is a block diagram of a configuration example of a spot characteristic generation circuit and a light source register according to the present invention.
  • FIG. 20 is an explanatory diagram of a lighting effect by a spot light source having an axial vector.
  • FIG. 20 is an explanatory diagram of one image scene according to the embodiment of the present invention.
  • FIG. 21 is a processing flowchart of the present embodiment.
  • Embodiment of the Invention is a processing flowchart of the present embodiment.
  • FIG. 6 is a block diagram of a configuration example of an image processing apparatus to which the spotlight characteristic forming method of the present invention is applied.
  • CPU 1 controls the execution of a program for processing an image using a polygon.
  • the CPU 1 temporarily stores the polygon vertex data and the resist setting data displayed on the display device 12 as the program proceeds in the polygon memory 11.
  • the data read from the polygon buffer memory 11 is input to the geometry processing unit 2.
  • the geometry processing unit 2 converts the input data into a two-dimensional coordinate system in order to display the polygons arranged in the three-dimensional space on the display device 7 according to the execution of the CPU 1 program.
  • a rendering processing unit 3 for coloring, shading, and pasting a texture is connected to each polygon to be displayed.
  • a frame buffer 5 is connected to the output side of the rendering processing unit 3 and stores data for one screen to be displayed.
  • a display device 7 such as a CRT is connected to the frame buffer 5 through a D / A conversion circuit 6, and the contents of the frame buffer 5 are sequentially displayed.
  • the geometry processing unit 3 converts the polygon data from the polygon buffer memory 11 to the polygon vertex data (vertex coordinates, Vertex color, tex Reads the map coordinates, vertex transparency, vertex normal vector, etc.) and registry settings function.
  • the geometry processing unit 2 arranges the polygon in the three-dimensional space based on the vertex coordinate data, and determines a view port to which region of the three-dimensional space to display. In addition, the vertices of the polygon that protrudes from the viewport are removed, that is, clipping is performed. In addition, the polygons placed in the viewport are projected onto a secondary plane based on a predetermined viewpoint, and coordinate transformation from 3D to 2D is performed.
  • the polygon data that has been converted to two-dimensional coordinates is sent to the rendering processing unit 3.
  • the rendering processing unit 3 has a filling circuit 30, a texture pasting circuit 31, a shading circuit 32, and a rendering circuit 33.
  • the filling circuit 30 has a function of calculating information of pixels (pixels) in a range surrounded by each vertex of the polygon and passing the information to each circuit in the other rendering processing unit 3.
  • the above-described calculation for filling is performed, for example, by performing linear interpolation on the information of pixels between vertices of the polygon based on the information of both corresponding vertices.
  • the texture pasting circuit 31 is a circuit that reads a texture corresponding to a pixel from the texture buffer 4 and calculates and calculates a color for each pixel.
  • the shading circuit 32 is a circuit that gives a lighting effect to the polygon based on the peak of the polygon, and the method of forming the spotlight characteristic according to the present invention is realized in such a circuit. Therefore, details and functions of the shielding circuit 32 will be described later.
  • the output of the shading circuit 32 is directed to the pruning circuit 33 (which, if necessary, reads the previously drawn polygon pixels read from the frame buffer 11). And the color information of the pixels of the polygon to be newly processed, Write to.
  • the information of the frame buffer 5 is sent to the display device 7 for each screen through the D / A conversion circuit 6 and displayed.
  • the rendering processing unit 3 further includes a depth function unit.
  • This depth function section is a function of comparing the context of a plurality of polygons and storing data of the most recently arranged polygon in a depth buffer (not shown).
  • the Z value of the pixel of the previously drawn figure is stored in the depth buffer. Then, when a new polygon is displayed at a position on the screen that overlaps the previously drawn polygon, the Z value of each pixel constituting the new polygon and the destination read from the depth buffer are displayed. Compare the Z value of the drawn polygon pixel. If the result of the comparison indicates that the pixel of the new polygon is in the foreground, the Z value of that pixel is written to the depth buffer.
  • a description will be given of an embodiment of a spotlight characteristic forming method to which the present invention is applied in the shading section 32 of the image processing apparatus having the above configuration, and a shading circuit.
  • FIG. 7 is a block diagram of an embodiment of a shading circuit 32 to which the present invention is applied.
  • the coordinate inversion circuit 320 is a circuit for converting input two-dimensional coordinate polygon data into three-dimensional coordinate polygon data.
  • the data of each pixel, which has been converted into three-dimensional coordinates by the coordinate conversion circuit 320, is branched, and one is input to the light vector circuit 321 and the other is input to the reflection vector circuit 327. Is done.
  • the light vector circuit 321 calculates a light vector from the spot light source toward the pixel based on the position of the spot light source in the virtual three-dimensional space and the three-dimensional coordinates of the pixel. In addition, the distance data between the light source and the pixel is obtained.
  • the obtained light vector is input to the spot characteristic generating circuit 3 22. Further, the obtained distance data between the light source and the pixel is input to the attenuation processing circuit 323.
  • a configuration example according to the present invention of the spot characteristic generating circuit 32 2 will be described later. In this circuit, as shown in FIG. 11, a spot light source 0 having an axis vector 70 as shown in FIG. The spot effect characteristic shown as an example is required.
  • the inner product 60 of the input light vector for each pixel and the axis vector 70 of the spot light source that is, the cosine value is obtained, and the pixel direction by the spot light source is determined. It is output as the light intensity.
  • the attenuation processing circuit 3 2 3 calculates the amount of light attenuation depending on the distance between the spot light source 0 and the corresponding pixel. Next, based on the intensity of light in the pixel direction from the spot light source from the spot characteristic generation circuit 322 and the amount of light attenuation due to the distance from the spot light source from the attenuation processing circuit 323 to the pixel.
  • the light intensity for the corresponding pixel is obtained from the light intensity combining circuit 3 2 4 (that is, the light intensity for each pixel is the angle between the axis vector 70 of the spot light source and the light vector of the pixel).
  • the light intensity is calculated based on the light intensity for each pixel obtained by the light intensity synthesis circuit 3 24, and then for each pixel.
  • a shading effect is given to the object, and the shading effect includes a diffuse reflection effect and a specular reflection effect.
  • the diffuse reflection effect is so-called diffuse reflection, which is light that penetrates the surface of an object, is absorbed and re-emitted. This diffusely reflected light radiates evenly in any direction.
  • the light intensity for each pixel obtained by the light intensity synthesizing circuit 324 is input, and the diffused light is multiplied by a constant diffuse reflection coefficient in the diffusion circuit 325 to obtain the diffuse reflected light.
  • the specular reflection effect is such that the angle of the reflected light with respect to the incident light is the same as the normal with respect to the normal line on the perfect reflection surface. Therefore, the specular reflection effect can be observed only by an observer at an angle corresponding to the angle of the reflected light. For this reason, the gaze vector of the observer is required to determine the magnitude of the reflected light.
  • the specular reflection circuit 326 inputs the light intensity for each pixel obtained by the light intensity synthesis circuit 324, and inputs the incident angle at the corresponding pixel and the line of sight obtained from the reflection vector circuit 327. The amount of reflection is calculated from the vector and output. Further, the diffused light quantity from the diffusion circuit 325 and the specular reflected light quantity from the specular reflection circuit 326 are combined by the modulation circuit 328 and output.
  • FIG. 8 shows a block diagram of a configuration example according to the present invention of the spot characteristic forming circuit 322 applied to the shading circuit configured as described above.
  • FIG. 9 is an example of a conventional configuration compared to clarify the features of the circuit of FIG.
  • the arithmetic unit 40 obtains the spot characteristics by direct calculation from the pixel data and the coefficient data. In such a case, as described above with reference to FIGS. 1 to 4, the calculation is complicated and it is difficult to form an arbitrary spot characteristic.
  • a method using a table as described below does not require a complicated calculation, and an arbitrary spot characteristic can be formed by data stored in the table.
  • the spot characteristics generated by the spot characteristic generation circuit 3222 are, for example, as shown in FIG. 12, the characteristic points a to p in the range of the blur region (penumbra scale).
  • a characteristic curve is formed by connecting the light intensity characteristic values of the characteristic points.
  • the blur area is the area from the point at which the spot characteristic begins to decay to the point at which the spot lighting effect becomes zero (cut-off) within the range of the angle 62 shown in FIG.
  • the light intensity in the direction of the optical axis vector of spot light source 0 is set to 1, and the vector L and the optical axis vector D directed to the pixel corresponding to each of the characteristic points a to p.
  • the horizontal axis represents the angle between the two, and the vertical axis represents the spot characteristic value, and plots the normalized value of each point with respect to one light intensity.
  • the spot characteristic generation circuit 322 includes a table 8 for storing the light intensity values of the characteristic points a to p of the spot characteristic, and a table 8 for each characteristic point. It comprises an address generator 9 for generating an address for reading the light intensity values of a to p, and an interpolator 10 for performing a linear interpolation between characteristic points.
  • the spot characteristic table 8 of the spot characteristic generating circuit 32 2 of FIG. 8 is configured to include a first bank 80 and a second bank 81 as an embodiment.
  • An example of the configuration of the address generator 9 is shown in FIG.
  • the address generator 9 contains pixel information L (light source vectors LX, Ly, Lz) and coefficient data (spot axis direction vectors Dx, Dy, Dz, cutoff angle Cutoff angle). , A blur width normalization coefficient Penumbra-scale, and an index (table-id) for selecting the characteristic table 8 are input.
  • the inner product calculator 90 calculates the inner product 6 0 of the light source vector L x, Ly, L z and the direction vector D x, D y, D z of the spot axis (see FIG. 11). ) And obtain the cosine value of these two vectors. Further, the portion exceeding the cut-off portion 61 (see FIG. 11) is deleted by the subtractor 91.
  • the output of the subtracter 91 from which the portion exceeding the cutoff part 61 has been deleted is multiplied by a normalization coefficient Penumbra-scale, for example, a coefficient 10 of the blur width by a multiplier 92 to obtain a semi-shadow.
  • the part applied to the part (blurred part) 62 (see Fig. 11) is normalized to 0.0 to 1.0. Therefore, the clip calculator 93 clips to 1.0 when the input is 1.0 or more, and to 0.0 when the input is 0.0.
  • the output of the clip calculator 93 is used for accessing the characteristic table 8 and for interpolation between characteristic points. Now, assuming that the output of the clip calculator 93 is 16 bits, among them, the access to the characteristic table 8 is 4 bits, and the non-link is turned off. One bit is used for the replacement flag SF and 11 bits are used for interpolation between characteristic points.
  • the characteristic table 8 includes first and second memory banks 80 and 81. Therefore, in the characteristic diagram of FIG. 12, the characteristic value data adjacent to the characteristic points a to p are stored in the first memory bank 80 and the second memory bank 81 alternately. With such a configuration, adjacent characteristic value data can be read out at the same time, so that it is possible to shorten the memory access time.
  • the link switching flag SF when the link switching flag SF is 0, the read address (odd address) 0 A for the first memory bank 80 and the read address (even address) for the second memory link 81 are set. ) EA is the same.
  • the non-switching flag SF when the non-switching flag SF is 1, the read address (even address) EA to the second memory bank 81 by the increment circuit 94 is set to the first memory non-link. For the 0 read address (odd address) 0 A, step forward by one.
  • the read address EA for the first memory bank 80 is equal to the second memory link 8 This is the same as the read address OA for 1; data of the characteristic point a is read from the first memory bank 80, and data of the characteristic point b is read from the second memory bank 81.
  • the interpolation parameter t and the bank readout switching flag SF of logic 0 are input to the interpolator 10 in FIG. Et al is, characteristic table 8 0: 8 1 a read is characteristic points a, b data is input.
  • the interpolator 10 obtains the value between the characteristic points a and b by primary interpolation from the relationship of the following equation (3).
  • Dt ab t A + (1-t) B
  • Dt ab is the spot effect value at point t of the interpolation parameter between characteristic points a and b
  • A is the spot effect value at characteristic point a
  • B is the spot effect value at characteristic point b.
  • the read address of the first characteristic table 80 is increased by one step by the increment circuit 94.
  • the address becomes 0 0 0 1.
  • the data of the characteristic point c is stored in this address. 'In such a case, in the interpolator 10, since the logic of the bank read switching flag SF is 1, the characteristic point b read from the characteristic table 81 is prioritized, and the interpolation data between the characteristic points b and c is set. D t b ⁇ c is obtained according to the following equation (4).
  • an arbitrary spot characteristic can be formed by arbitrarily configuring the characteristic point data stored in the characteristic table 8. That is, by configuring the characteristic point data as a power, the spot characteristic of OpenGL (trademark) becomes similar to the spot characteristic of softtimege by further linearly configuring.
  • FIG. 13 is a diagram illustrating still another embodiment of the present invention.
  • the spot characteristics are always determined by the angle with respect to a certain axis, so that the spot is always a circular spot. That is, in the example of FIG. 12, only the spotlight effect based on the concentric spotlight characteristics can be expressed. In other words, only one-dimensional spotlight characteristics can be generated.
  • the number of axes is further increased so that the characteristic table 8 has characteristic point data in two dimensions.
  • the spot characteristic becomes a spot having a two-dimensional characteristic.
  • axes A and B perpendicular to the axis 0 of the spotlight are defined, and the OA plane defined by the axis of the spotlight and the axes A and B and the axis ⁇ are defined. .
  • the two-dimensional table is referred to by using the angles ⁇ , which are the orthogonal projections C and D of the light vector OB on the OA plane and the OB plane with respect to the axes A and B, and B.
  • which are the orthogonal projections C and D of the light vector OB on the OA plane and the OB plane with respect to the axes A and B, and B.
  • FIG. 14 is a block diagram of a first configuration example of an image processing apparatus to which the light source characteristic forming method of the present invention is applied.
  • CPU 1 controls the execution of a program for processing an image using polygons.
  • the CPU 1 temporarily stores the polygon peaks and the resist set functions displayed on the CRT display device 7 in the polygon buffer 11 as the program proceeds. Further, CPU 1 adds Light_ID to each polygon as information on which light source is affected by each polygon.
  • the coordinate conversion unit 2 converts the input data into two-dimensional coordinates in order to display a polygon arranged in a three-dimensional space on the CRT display device 7 in accordance with the execution of the CPU 1 program.
  • the polygon data converted to the two-dimensional coordinates is sent to the filling circuit 30 and the texture generating circuit 31.
  • the fill circuit 30 calculates the information of the pixels (pixels) in the range surrounded by each vertex of the polygon.
  • the above-described calculation for filling is performed, for example, by performing linear interpolation on the information of the pixels between the vertices of the polygon based on the information of the corresponding vertices.
  • the fill circuit 4 The added Right ID is written to each pixel constituting the polygon, and this writing is repeated for the number of polygons.
  • the texture generation circuit 31 is a circuit that reads a texture corresponding to a pixel from a texture buffer (not shown) and calculates a color for each pixel.
  • the output of the texture generation circuit 31 is supplied to the shading circuit 32 as pixel data, and the pixels constituting each polygon are provided with the L of the corresponding polygon by the filling circuit 30.
  • a lighting ID is added, and the shading circuit 32 performs a shading process on a light source in which each of the pixels constituting each polygon is affected based on the lighting ID.
  • the shading circuit 32 there are four light source registers 329 in the shading circuit 32, A, B, C, and D, and the shading circuit 32 can be processed in one image scene. This is the case with four light sources.
  • the light source buffer 17 stores information on all the light sources.
  • Four light source information items are specified by the Right—ID, and the light source information is stored in the light source registers 3 29 in the shading circuit 32. Is stored.
  • the shading circuit 32 calculates the lighting effect of the pixel based on the vertex data of the polygon based on the light source information of the light source register 329. The details and functions of the shading circuit 32 will be described later.
  • the output of the n-ding circuit 32 is led to the color modulation circuit 12 and the mixing circuit 33.
  • the color modulation circuit 12 is a circuit that performs color modulation for each pixel based on the output of the shading circuit 32.
  • the mixing circuit 3 3 is the color information of the previously drawn polygon pixels read from the frame buffer 5, and the new polygon pixels to be processed.
  • the color information of is mixed and written into frame buffer 5 as one screen data.
  • the information of the frame buffer 11 is displayed on the CRT display device 7.
  • FIG. 15 is a block diagram showing a second configuration example of the image processing apparatus to which the present invention is applied.
  • the light source buffer 17 in FIG. 15 stores a plurality of light source information in which the number of light sources that can be processed in one image scene, that is, the number of light source registers 329 as one group. In this case, one Light-I ⁇ ) is added to each pixel, and the shading circuit 6 uses the Light-ID from the light source buffer 17 as an embodiment. Light source information with four light sources as one group can be read.
  • FIG. 16 is a block diagram of a third configuration example of an image processing apparatus to which the present invention is applied.
  • all the light source information to be used is stored in the light source memory 8, and the light source buffer 17 stores information of a set of light sources that affect each pixel.
  • Each pixel has one Light-ID added to it, and the shading circuit 32 recognizes the set of light sources affected by each pixel from the light source buffer 17 based on the Light-ID.
  • the light source information can be read from the light source memory 18.
  • FIG. 17 shows an example of the contents of the light source buffer 17 of the third example of the image processing apparatus shown in FIG.
  • the Light—ID of each pixel is given as a 6-bit address, and that address in the light source buffer 17 is given as the light source at which each pixel is affected.
  • Light—ID follows the game program, and some polygons are It is given by CPU 1 as information on whether or not it is affected. Usually, a light source located close to the polygon or a light source with high intensity is specified.
  • a polygon has a Lightght-ID (00000001), it is included in that polygon and the polygon.
  • Each pixel is shaded as affected by light sources c, d, e, and f.
  • FIG. 18 is a block diagram of an embodiment of the shading circuit 32 to which the present invention is applied.
  • the shading circuit 32 is a circuit that calculates how pixels included in each polygon are affected by the light source.
  • the vector arithmetic unit 331 and the light source arithmetic unit 3 It consists of 4 blocks of 3 0, light source register 3 2 9 and accumulator 3 2 8.
  • the effects from the four light sources of each pixel are calculated by the light source calculators 33OA, B, C, and D corresponding to the light sources, respectively.
  • the light source data stored in the light source register 329 is used when generating a spot characteristic in the light source calculator 330 or processing the attenuation of the light source.
  • the vector calculator 331 is composed of a coordinate inverse calculator 3200 and a reflection vector circuit 3227.
  • the coordinate inverse calculator 320 is a circuit that converts an input two-dimensional coordinate pixel data into a three-dimensional coordinate pixel data.
  • the output of the coordinate inversion circuit 320 is four light source calculators 330 (A, B, C, D). To calculate the effects from four light sources at once.
  • the other output of the coordinate inversion circuit 320 is input to the reflection vector circuit 327.
  • the data of each pixel, which is converted into three-dimensional coordinates by the coordinate inversion circuit 320 and input to, for example, A of each light source calculator 330, is input to the light vector circuit 321.
  • the light vector circuit 3 21 obtains a light vector directed from the light source to the pixel based on the position of the light source in the virtual three-dimensional space and the three-dimensional coordinates of the pixel. In addition, the distance between the light source and the pixel is calculated. 'The obtained light vector is input to the spot characteristic generation circuit 3 2 2. Further, the obtained distance data between the light source and the pixel is input to the attenuation processing circuit 323. In this spot characteristic generation circuit 3222, as shown in FIG. 11, a spot effect characteristic shown as an example in FIG. 12 is obtained by a spot light source 0 having an axis vector 70.
  • the spot characteristic generation circuit 3 22 calculates the inner product 60 of the input light vector for each pixel and the axis vector 70 of the spot light source, that is, the cosine value, and determines the cosine value. Output the light intensity in the pixel direction.
  • the attenuation processing circuit 3 2 3 calculates the amount of light attenuation depending on the distance between the spot light source 0 and the corresponding pixel. Next, based on the intensity of light in the pixel direction from the spot light source from the spot characteristic generation circuit 322 and the amount of light attenuation due to the distance from the spot light source from the attenuation processing circuit 323 to the pixel.
  • the light intensity for the corresponding pixel is obtained from the light intensity synthesis circuit 3 2 4, that is, the light intensity for each pixel is determined by the intensity of the light source itself, the axis vector 70 of the spot light source, and the It can be obtained from the amount of attenuation due to the angle made with the vector and the amount of attenuation due to the distance from the spot light source to the corresponding pixel position.
  • the shading effect includes a diffuse reflection effect and a specular reflection effect.
  • the diffuse reflection effect is so-called diffuse reflection, light that penetrates the surface of an object, is absorbed and re-emitted. This diffusely reflected light radiates evenly in any direction. Therefore, it has nothing to do with the observer's viewpoint. What is important is the angle between the direction from the light source toward the pixel and the normal to the surface of the pixel.If this angle is greater than 7 ⁇ / 2, the light rays will shadow the object and become diffuse Light reflection does not occur.
  • the specular reflection effect gives the effect that the angle of reflected light for incident light is the same as for the normal on the perfect reflecting surface.
  • the specular reflection effect can be observed only by an observer at an angle corresponding to the angle of the reflected light. Therefore, in order to determine the magnitude of the reflected light, a reflection vector of the observer's line of sight is required.
  • the specular reflection circuit 326 inputs the light intensity for each pixel obtained by the light intensity synthesis circuit 324, and inputs the angle of incidence at the pixel and the line of sight obtained from the reflection vector circuit 327. The amount of reflection is calculated from the vector and output. Further, the amount of diffused light from the diffusion circuit 3 25 and the amount of specularly reflected light from the specular reflection circuit 3 26 are calculated by the accumulator together with the outputs of the other light source calculators 3 330 B, C, and D. The output is synthesized by 3 2 8.
  • FIG. 19 is a block diagram showing a configuration example of the spot characteristic generation circuit 322 applied to the shading circuit 32 configured as described above.
  • a method using a table as described below does not require complicated calculations, and an arbitrary spot characteristic can be formed by data stored in the table. Since the spot characteristic generation circuits A, B, C, and D have the same configuration, the description will focus on the spot characteristic generation circuit A.
  • the spot characteristic generated by the spot characteristic generating circuit 32 2 has a characteristic point a in a range of a blur region (penumbra scale) 62 (see FIG. 12).
  • a characteristic curve is formed by connecting the light intensity characteristic values of the characteristic points up to p. _
  • the light intensity in the optical axis vector direction of spot light 0 is set to 1, and the vector L and the optical axis vector directed to the pixel corresponding to each of the characteristic points a to p.
  • the horizontal axis is the angle formed by the torque D, and the normalized value for each point at 1 light intensity is plotted.
  • the spot characteristic generation circuit 32 2 of this configuration example includes a table 80 storing the light intensity values of the characteristic points a to p of the spot characteristics, and a table 80 It comprises an address generator 90 for generating an address for reading the light intensity values of the characteristic points a to p, and an interpolator 100 for performing a linear interpolation between the characteristic points.
  • the address generator 90 contains pixel data (Lx, Ly, Lz) as pixel information, and spot axis direction vectors (Dx, Dy, Dz) as light source information. ), Cutoff angle (Cutoff), blur width normalization coefficient (Penumbra-scale), and index (table-id) for selecting the characteristic table 80 are input.
  • each pixel has a Light-ID designating the four light sources in the CPU 1 shown in FIG. Given by There are four light source registers A, B, C, and D. Four light source data are read from the light source buffer 7 or the light source memory 8 according to the Right-ID, and spot characteristics are generated. Light source data is provided to the circuit 322 (A, B, C, D).
  • Figure in 1 9 calculates the inner product calculation unit 9 1 by Ri pixel data Lx, Ly, and L z, spot axis direction base-vector Dx, Dy, inner product of Dz 6 0 (see Figure 1 1), these Find the cosine value between the two vectors. Further, the portion exceeding the cut-off portion 61 (see FIG. 11) is deleted by the subtractor 92.
  • the output of the subtracter 92 from which the portion exceeding the cutoff portion 61 has been deleted is multiplied by a normalized integer Penumbra-scale, for example, a coefficient 10, by a multiplier 93 to obtain a penumbra.
  • Penumbra-scale for example, a coefficient 10
  • a multiplier 93 to obtain a penumbra. Part (blurred part) 6 2 (see Fig. 11) .
  • the clip calculator 94 clips the input to 1.0 when the input is 1.0 or more, and to 0.0 when the input is 0.0 or less.
  • the output of the clip calculator 94 is used to access the characteristic table 80 and to interpolate between characteristic points. Now, assuming that the output of the clipping calculator 94 is 16 bits, among them, 4 bits are used for accessing the characteristic table 80, and 1 bit is used for the link switching flag SF, and Thus, 11 bits are used for interpolation between characteristic points.
  • the characteristic table 80 includes first and second memory banks 81 and 82. Therefore, in the characteristic diagram of FIG. 12, the data of the characteristic points a to p are stored alternately in the first memory bank 81 and the second memory bank 82, respectively.
  • the link switching flag SF when the link switching flag SF is 0, the read address (odd address) 0A for the first memory link, link 81, and the read address for the second memory link 82, Less (even address) EA is the same.
  • the bank switching flag SF when the bank switching flag SF is 1, the readout address (even address) EA for the second memory cell, the ink tank 82 and the first memory cell are stored by the increment circuit 95.
  • the read address (odd address) of the link 81 1 ⁇ A is incremented by one.
  • a specific example is the same as that described above.
  • the bank read switching flag SF is 0 and the address is 0 0 0 0, the read address for the first memory cell, link 81 is read.
  • the EA is the same as the read address OA for the second memory bank 82, and the data at the characteristic point a from the first memory bank 81 and the data at the characteristic point b from the second memory bank 82.
  • the interpolation parameter t and the bank read-out switching flag SF of logic 0 are input to the interpolator 100 in FIG.
  • data of the characteristic points a and b read from the characteristic tables 81 and 82 are input. Therefore, the interpolator 100 obtains the value Dt ab between the characteristic points a and b by linear interpolation from the relationship of the above equation (3).
  • the read address of the first characteristic table 81 is set to 1 by the increment circuit 95. Step forward to address 0 0 0 1. This address stores the data of the characteristic point c.
  • the characteristic point b read from the characteristic table 82 is prioritized, and the interpolation data Dt bc between the characteristic points b and c is determined. It is calculated according to the above equation (4).
  • an arbitrary spot characteristic can be formed by arbitrarily configuring the characteristic point data stored in the characteristic table 80.
  • FIG. 20 shows an embodiment in the case of an image scene in which a street is illuminated by a plurality of street lamps according to the present invention.
  • Light sources a, b, c, etc. are arranged on both sides of the street.
  • the polygons that make up the street have L i g h t — I D that indicates which light sources are affected.
  • one polygon can be affected by up to four light sources. For example, if the Right — ID of polygon P 2 is (0 0 0 0 1), the light source c, d, e, and f will be affected by the contents of the light source buffer in Fig. 17. Become.
  • each polygon has an ID indicating which light source is affected, and the corresponding light source is processed, the scene can have more light sources than the number of light sources that can be processed simultaneously.
  • FIG. 21 shows a processing flow of the present invention. Steps 1 and 2 are performed as processing in the program initial processing stage.
  • the light source parameters in the scene are written into the light source buffer 17 (step 1).
  • the light source parameters include the position, color, intensity and direction of the light source, and the scene can have as many light sources as the light source buffer 1 mm allows.
  • the ID (Light—ID) of the affected light source is assigned to each polygon (Step 2).
  • Each polygon is usually strongly influenced by the nearest light source. For example, if the system is capable of processing four light sources at the same time in terms of hardware, each polygon can be assigned the most You can add a light source buffer address that specifies four nearby light sources.
  • a light source can be selected based on the normal vector direction of each vertex of the polygon and the direction in which the light source faces as the light source affected by the polygon.
  • step 3 as the game progresses, coordinate transformation and perspective transformation of each polygon in each scene are repeated by the number of polygons (step 3).
  • step 3 the three-dimensional polygon data is converted into a two-dimensional image on the screen, and the perspective transformation is used to change the perspective due to the change in the viewpoint position. Can be processed.
  • each polygon is painted, and L i g h t -I D is written for each pixel (step 4). Therefore, in this step 4, from the many light sources in the scene, four light sources whose pixels are affected will be specified.
  • step 5 texture generation is performed (step 5).
  • the texture includes the pattern or texture of the surface of the polygon, and the pattern is applied to the surface of the polygon by mapping.
  • the light source parameters corresponding to L i g h t —I D are read from the light source buffer 17 (step 6). That is, when Light-ID is the address of the light source buffer 17, the light source information stored in the light source memory 18 is read out based on the address.
  • step 7 a shading process is performed (step 7).
  • the screen is illuminated, colored and shaded based on the light source and the polygon data of the object.
  • one screen of video data is written to the frame buffer 5 (step 8). From step 5 The processing up to step 8 is repeated for each pixel forming the polygon, and the information of one screen stored in the frame buffer 5 is displayed on the CRT display device 7.
  • the spotlight characteristic forming method according to the present invention has a higher spotlight characteristic than a method of calculating the spot characteristic based on a calculation formula for each pixel.
  • the angle between the axis of the light source and the light source vector to refer to the characteristic table that stores the characteristic point data in advance, the spot characteristics with a high degree of freedom can be obtained with a simpler circuit. It can be formed.
  • the circuit has a high degree of freedom in the characteristics of the spot, and the circuit to be realized is simple. Furthermore, if the prepared property table is extended to two dimensions, it is possible to form non-circular spots or to form multiple spots with one light source. As described above, according to the present invention, since a plurality of light source groups are provided and are selected by Light-ID, more light sources than can be used simultaneously can be used in a scene.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Description

明細書
スポッ トライ ト特性形成方法及びこれを用いた画像処理装置 発明の属する技術分野
本発明は、 コンピュータグラフィ ック技術によ り画像表示されるォブジ ェク 卜にスポッ トライ ト効果を与えるためのスポッ トライ ト特性を形成す る方法及び、 この方法を用いた画像処理装置に関する。 ' 従来の技術
近年、 コンピュータグラフィ ック技術を用い、 仮想 3次元空間内に配置 されたォブジェク トを複数のポリ ゴンで画像表示する画像処理装置が普及 している。 さ らに、 表示されるオブジェク ト をよ り現実に近いものとすべ く研究開発が進められている。
かかるコンピュータグラフィ ック技術において、 表示されるォブジェク 卜の表面に光の照明効果を与えるシヱ一ディ ング処理の技術がある。 ォブ ジェク トにスポッ トライ 卜が当てられたような特殊効果を与えるこ とは、 かかるシェーディ ング処理に含まれる一つの方法である。
従来のスポッ トライ ト特性を与える技術と して、 シリ コングラフィ ック ス社によ り開発された O p e n G L (商標) の方法がある。 図 1に示すよ うに、 スポッ ト光源 0から所定の点 P方向への光のベク トル L及び、 スポ ッ ト光源 0からオブジェク トに向かう光源の軸べク トル Dを考える時、 0 p e n G L (商標) の方法は、 スポッ トライ トの特性を " s p o t e x p: 及び " c u t o f f " というパラメ一夕を指定して、 次の式 ( 1 ) を用い て算出するものである。 この時のスポッ ト効果特性は、 図 2に示すごと く である。
Figure imgf000004_0001
図 2示すように、 "s p o t e x p " を大きい値にすると、 スポッ トを絞 つた形状のものになる。 しかし、 実際に使用する際は、 スポッ トの特性は スポッ トの広がり角で考える場合が殆どである。 したがって、 指定したス ポッ トの広がり角度で " s p o t E f f e c t " が一定値以下になる " s p o t e x " の値を逆算して求めることが必要であるが、 かかる逆算は、 簡単な計算処理ではない。
また、 たとえ逆算によ り "s p o t e x p" の値が求められたと しても、 図 2に示すように " s p o t e X p " の値によ りスポッ ト特性曲線の形状 が変わって しまう。 このために、 実際に描画像を見た時の観察者の感覚と は異なって しまう恐れがある。
さ らに、 "s p o t e x " の値によ りスポッ ト特性曲線の形状が一意 に決まって しまうので、 スポッ 卜の開きと強度分布を独立して指定するこ とができない。 その結果として、 サーチライ トのようにスポッ トの開きが 狭く、 且つ強度分布が略一定の特性を得るこ とができず、 ぼんやり と した スポッ ト光になってしまう。
一方、 "c u t o f f " パラメ一夕は、 ある角度を境にこれを超えると、 "s p o t E f f e c t " の値を 0とする。 即ち、 したがって、 "s p o t e x p" と異な り角度を指定するパラメ一夕であるので制御がし易い。 し かし、 強度分布が不連続になるのでスポッ トのエッジが尖鋭で強度分布が 一定のスポッ ト特性しか得られないという欠点を有する。
即ち、 " c u t o f f " は、 これを超えるとスポッ ト照明効果がゼロ と なる光の広がりの限界値である。 "c u t o f f " を設定すると、 この限 界領域が目立って しまう という問題がある。 . 一方、 マイ クロソフ ト社によ り開発された s o f t i ma g eをはじめ とする方法と して、 図 3に示すように、 スポッ トの暈け初めの角度 ( cone angle) と暈け終わ りの角度 ( spread angle) を指定する方法がある。
この方法では、 次の式 ( 2 ) によ りスポッ ト特性が算出される。 この第 2の方法の場合、 特性は角度で指定するので制御がし易く、 演算が簡単で あるという特徴がある。
0 L. D < spread angle
apotEffect 1 L · D > cone angle
L D- spread angle
cone angle >L-D> spread angle cone angle― spread angle
Figure imgf000005_0001
しかし、 図 4に示されるごときスポッ ト特性であって、 特性値の変化 が直線的であり、 O p e nG L (商標) のような正規曲線に似たスポッ ト 特性を得ることができない。
したがって、 図 3に示すように暈け初めの角度 (cone-angle) の位置で不 自然なエッジ強調が生じるという問題がある。 ここで、 エッジ強調とは、 境界領域に隣接する領域で明るさの変化が連続的でないと、 境界の明るさ が強調されて しまう という視覚効果である。
ここで、 従来の画像処理装置の一例のブロ ック図を図 5に示す。 図 5お いて、 C P U 1は、 ポリゴンを使用した画像を処理するためのプログラム の実行を制御するものである。 C P U 1は、 ポリ ゴンバッファ 1 1からポ リ ゴンデ一夕を読み出し、 座標変換部 2に出力する。
座標変換部 2は、 ポリ ゴンの 3次元データを、 CR Tディスプレイ装置 7上に表示するために 2次元座標に変換する。 2次元座標に座標変換され たポリ ゴンデータは、 塗りつぶし回路 3 0、 テクスチャ生成回路 3 1に送 られる。
塗りつぶし回路 3 0は、 ポリ ゴンの各頂点で囲まれた範囲にある画素 (ピ クセル) の情報を計算する。 上記塗りつぶしのための計算は、 ポリゴンの 各頂点間にあるピクセルの情報を対応の両頂点の情報を基に、 例えば線形 補間を行う ものである。 テクスチャ生成回路 3 1 は、 ピクセルに対応した テクスチャを内部にあるテクスチャバッファから読み出し、 ピクセル毎に カラ一を計算して求める回路である。 テクスチャ生成回路 3 1の出力は、 ピクセルデータ と して、 シヱ一ディ ング回路 3 2 に与えられる。
シエーディ ング回路 3 2は、 ピクセルデータに基づき各ピクセルに与え られる、 例えば上記したスポッ トライ トによる照明効果を求める回路—であ り、 シェーディ ング回路 3 2の出力は、 色変調回路 1 2及び混合回路 3 3 に導かれる。 色変調回路 1 2は、 シエーディ ング回路 3 2の求めた結果等 に基づきピクセル毎にカラー変調する回路であ り、 混合回路 3 3は、 ポリ ゴンのピクセルのカラー情報を先に描かれたカラー情報と混合し、 1 画面 のデータ と してフ レームノ ソファ 5 に書き込む。 このフ レームノ ッファ 5 の情報が C R Tディ スプレイ装置 7 に表示される。
次に、 上記のような構成の画像処理装置のシエーディ ング回路 3 2おい て従来実施された光源特性形成方法を説明する。 図 5 に示す従来例では、 シェ一ディ ング回路 3 2 中に例えば、 4個の光源レジス夕 3 2 9 とこれに 対応する図示しない 4個の光源演算器があ り、 4個の光源の情報を一度に 処理できる場合である。
例えば、 1画像シーンの中で光源 a , b, c , dを使用する場合は、 予 め光源 a , b , c, dの情報を光源レジスタ A , B, C, Dに記憶させて おく。 シヱ一ディ ング回路 3 2、 光源レジスタ 3 2 9 に記憶された光源 a , b , c, dの情報に基づき、 各ピクセルが光源 a, b , c , dによ り どの ような影響を受けるかを計算する。
光源情報には、 例えば、 図 1若しく は図 3 によ り説明した様に、 スポッ ト軸の向きベク トル ( D x, D y,D z)、 カ ッ トオフ角 (Cutoff), ぼけ幅の正規 化係数 (Penumbra-scale) 等があ り、 シ: π—デイ ング回路 6はそれらの光源 情報によ り シェーディ ング計算を行い、 その結果をたし合わせて各ピクセ ルに対する 4個の光源からの影響を計算していた。 このように、 従来の技術では、 1画像シーンで使用できる光源数に対応 する個数分だけ光源レジスタ 3 2 9及び光源演算器を持っており、 一般に 1画像シーン中の光源の個数は、 光源レジス夕 3 2 9及び光源演算器の個 数と同じであった。 したがって、 1画像シーンの中に例えば 1 0 0個の光 源を使用する場合は、 光源レジスタ 3 2 9及び光源演算器をそれぞれ 1 0 0個持ち、 1 0 0個の光源からのシヱーデイ ング計算を行い、 その結果を たし合わせて各ピクセルの 1 0 0個の光源からの影響を計算するこ と'にな るが、 ハー ドウェアの規模と して現実的ではなかった。
これに対し、 ステー トマシン型のシステムであれば逐次光源パラメ一夕 を書き換えるこ とによって、 見かけ上の光源数を増やすことは可能である が、 管理が大変である。 また、 Z— s o r t などを含むような、 ポリ ゴン の描画順序が保存されないシステムでは、 見かけ上の光源数を増やすこと はできない。 発明の概要
上記のように従来提案されているスポッ トライ 卜の効果を与えるいずれ の方法にも問題がある。 したがって、 本発明の目的は、 かかる問題を解決 するスポッ トライ ト特性形成方法及びこれを用いた画像処理装置を提供す るこ とにある。
さ らに、 本発明の目的は、 従来の方法では複雑な演算を演算器による計 算処理によ り実現していたのをテーブルによ り実現するスポッ 卜ライ ト特 性形成方法及びこれを用いた画像処理装置を提供するこ とにある。
さ らに、 上記したように従来の画像処理装置においては、 1画像シーン の中で多数の光源を使用する場合は、 各ピクセルのシェーディ ング計算を その光源数分だけ行い、 その結果をたし合わせなければならなかった。 ま た、 1画像シーン中で使用する光源数分の光源レジス夕及び光源演算器を 持つのは、 ハー ドウェア量が膨大なものになる。 しかし、 実際にゲームス ト一リーの 1 つのシーンの中で、 1つのポリ ゴ ンが光源の影響を強く受けるのは、 そのポリ ゴンに近い位置にある光源や、 光の強い光源に限られる。 例えば、 画像シーンの中に 1 0 0個の光源があ つたと しても、 1つのポリ ゴンが強く影響を受けるのは、 そのポリ ゴンの 近く にある 4個とか 5個の光源に限られる。 この場合、 画像シーン中にあ るすべての光源の影響を計算する必要はな く、 強く影響を受ける光源に対 してだけシェーディ ング計算を行えばよい場合も多い。 ' したがって、 本発明の目的は、 シェーディ ング回路で処理できる光源数 をそのままで、 1画像シーン中に使用できる光源数を増やすこ とを可能と する画像処理方法及び、 画像処理装置を提供するこ とにある。
上記本発明の目的を達成するスポッ トライ ト特性形成方法及びこの方法 を適用する画像処理装置は、 基本的構成と して、 所定のスポッ トライ ト特 性曲線に対応する複数の特性値をテ一ブルに格納し、 このテーブルから読 み出される特性値若し くは、 テーブルから読み出される互いに隣接する特 性値間を補間して求められる補間値によ り該スポッ トライ ト特性曲線を形 成するこ とを特徴とする。
本発明は、 予めスポッ トライ ト特性曲線に対応するに複数の特性値を予 めテ一ブルに格納している。 さ らに、 テーブルから読み出される特性値若 し く は、 テーブルから読み出される互いに隣接する特性値間を補間して求 められるを補間値を用いる構成である。 したがって、 複数の特性値をスポ ッ トライ ト特性曲線に対応させるこ とができるので、 任意のスポッ トライ ト特性を形成することができる。
さ らに、 予めテーブルに格納されている特性値を使用するので、 複雑な 計算を必要と しない。
具体的構成と して、 スポッ ト ライ 卜の光軸ベク トルと光源から各ピクセ ルに向かう若しく は各ピクセルから光源に向かうライ トべク トルとの内積 に応じたテーブルのァ ドレスから特性値を読み出す様に している。 さ らに、 スポッ トライ 卜の光軸べク トルとこのスポッ トライ 卜の光軸べ ク トルに垂直な少な く とも二つの軸を定義し、 スポッ トライ 卜の光軸べク トルとこれに垂直な少な く とも二つの軸によってそれぞれ定義される少な く とも二つの平面と、 光源から各ピクセルに向かう若しく は各ピクセルか ら光源に向かう ライ トべク トルの少なく とも二つの平面に対する正射影と が成す角度に対応して、 テーブルから特性値を読み出し、 この読み出され た特性値若し く はこのテーブルから読み出された互いに隣接する特性値間 の補間値によ りスポッ トライ ト特性曲線を形成する構成とすることによ り、 非円形のスポッ ト効果を与えることも容易に可能である。
さ らに、 本発明によれば、 複数のポリ ゴンによ り画像表示されるォブジ ェク 卜に光源による照明効果を与える画像処理装置において、 複数の光源 の情報を保存するメモリ と、 一のポリゴンに対し所定数の光源の情報によ り シエーディ ングを行う手段と、 所定数の光源の情報をポリ ゴンに対応し てメモリから読み出し、 シェーディ ングを行う手段に供給する手段とを有 するこ とによって達成するこ とができる。
したがって、 各ポリゴンが光源から どのような影響を受けるかを計算す る場合に、 画像シーンにあるすベての光源からの影響を計算する必要はな く、 各ポリゴンに付けられた光源識別記号で特定される所定数の光源の情 報だけを読み出し、 その光源に対してだけシェ一ディ ング処理をすれば、 見かけ上同時に使用できる光源数以上の光源を画像シーンの中に使う こと ができる。
また、 上記の目的は、 複数のポリ ゴンによ り画像表示されるォブジェク トに光源による照明効果を与える画像処理装置において、 複数の光源の情 報の組を複数保存するメモリ と、 一のポリ ゴンに対し複数の光源の情報の 組によ り シェ一ディ ングを行う手段と、 複数の光源の情報の組をポリ ゴン に対応してメモ リから読み出し、 シェ一ディ ングを行う手段に供給する手 段とを有することによつても達成することができる。 したがって、 画像処理装置が同時に使用できる光源数が複数個の場合、 その複数個の光源情報を 1 グループと してバッファに複数保存し、 各ポリ ゴンに付された光源識別記号はバッファからグループと して光源情報を読 み出すことができる。 このため、 ポリ ゴン毎に光源情報を選択する処理が 省略でき、 処理速度の向上を図るこ とができる。
また、 上記の目的は、 複数のポリ ゴンによ り画像表示されるォブジェク トに光源による照明効果を与える画像処理方法において、 画像シーン ©中 で使用する光源の情報をメモリ に書き込む第 1 のステップと、 各ポリ ゴン 毎に影響を受ける光源の識別記号を付ける第 2のステツプと、 ポリ ゴンの デ一夕に対し座標変換を行う第 3のステップと、 ポリ ゴンのピクセル毎に 識別記号を書き込む第 4のステップと、 ピクセルのデータをもとにテクス チヤ生成を行う第 5のステップと、 識別記号に対応する光源の情報をメモ リから読み出す第 6のステップと、 ピクセルにシェ一ディ ングを行う第 7 のステップと、 ピクセルのデータをフ レームノ ッファに書き込む第 8のス テツプとからなることを特徴とする画像処理方法によっても達成すること ができる。
したがって、 ポリ ゴン内の各ピクセルは光源識別記号で特定される光源 に対してだけその影響を計算すればよいため、 シエーディ ング処理速度の 向上を図るこ とができる。
また、 本発明によれば、 光源の組を構成する光源は、 各ポリ ゴンに対し て少なく とも一部重複して使用することができる。 したがって、 光源を一 部重複して使用するこ とによ り、 同時に使用できる光源数をそのままで、 その光源数以上の光源をシーン中に使用するこ とができる。
本発明の更なる目的及び、 特徴は以下の図面を参照しての実施の形態の 説明から明らかとなる。 図面の簡単な説明
図 1 は、 o p e n G Lの方法を説明する図である。 図 2は、 o p e n G Lの方法によるスポッ ト特性を示す図である。
図 3は、 スポッ トの暈け初めの角度 (cone angle ) と暈け終わ りの角度 ( spread angle) を指定する方法を説明する図である。
図 4は、 図 3の方法によるスポッ ト特性を示す図である。
図 5は、 従来の画像処理装置の構成例プロ ック図である。
図 6は、 本発明のスポッ トライ ト特性形成方法が適用される画像処理装 置の構成例ブロ ック図である。 ' 図 7は、 本発明を適用するシヱ一ディ ング回路の実施例構成のプロ ック 図である。
図 8は、 シエーディ ング回路において適用されるスポッ ト特性生成回路 の本発明に従う構成例ブロ ック図である。
図 9は、 図 8の回路の特徴を明確にするために比較される従来構成例で ある。
図 1 0は、 ア ドレスジェネレータの構成例を示すブロ ック図である。 図 1 1は、 軸ベク トルを有するスポッ ト光源による照明効果を説明する 図である。
図 1 2は、 軸べク トルを有するスポッ ト光源による一例と して示すスポ ッ ト効果特性を説明するための図である。
図 1 3は、 本発明の別の実施の形態を説明する図である。
図 1 4は、 本発明の画像処理装置の第 1 の構成例プロ ック図である。 図 1 5は、 本発明の画像処理装置の第 2の構成例プロ ック図である。 図 1 6は、 本発明の画像処理装置の第 3の構成例プロ ック図である。 図 1 7は、 本図 1 6の構成例におけるの光源バッファの内容を示す図で ある。
図 1 8は、 本発明を適用するシェ一ディ ング回路の実施例構成のプロ ッ ク図である。
図 1 9は、 スポッ ト特性生成回路と光源レジスタの本発明に従う構成例 ブロ ック図である。 図 2 0は、 軸べク トルを有するスポッ ト光源による照明効果の説明図で ある。
図 2 0は、 本発明の実施例の 1 画像シーンの説明図である。
図 2 1 は、 本実施の形態例の処理フローチヤ一 トである。 発明の実施の形態
以下、 本発明の実施の形態を図面に従い説明する。 尚、 図において: 同 一又は類似のものには同一の参照番号又は、 参照記号を付して説明する。 図 6は、 本発明のスポッ トライ ト特性形成方法が適用される画像処理装 置の構成例ブロ ック図である。
図 6 において、 C P U 1は、 ポリ ゴンを使用 した画像を処理するための プログラムの実行を制御するものである。 C P U 1 にはプログラムの進行 に伴いディ スプレー装置 1 2上に表示するポリ ゴンの頂点データやレジス 夕セ ヅ トフアンクシヨ ンをポリ ゴンノ ヅ フ ァメモリ 1 1 に一次的に蓄え る。
このポリ ゴンバッファメモリ 1 1 から読み出されるデータが、 ジオメ ト リ処理部 2に入力される。 ジオメ ト リ処理部 2は入力されたデータを、 C P U 1 のプログラムの実行に従い 3次元空間内に配置されるポリ ゴンをデ イ スプレー装置 7上に表示するために 2次元座標系に変換する。
さ らに、 表示する各ポリ ゴンに対し、 着色、 シェーディ ング、 テクスチ ャの貼り付けを行う レンダリ ング処理部 3が接続されている。 レンダリ ン グ処理部 3の出力側には、 フ レームバッ フ ァ 5が接続され、 表示される一 画面分のデータが格納される。
フ レームバッ フ ァ 5に D / A変換回路 6 を通して、 C R T等のディ スプ レ一装置 7が接続され、 フ レームバッ フ ァ 5 の内容が順次表示される。 ここで、 上記ジオメ ト リ処理部 3は、 ポリ ゴンバッフ ァメモリ 1 1 ら C P U 1 によるプログラムの進行及び処理速度に対応して、 ポリ ゴンバッフ ァメモ リ 1 1からポリ ゴンの頂点デ一夕 (頂点座標、 頂点カラー、 テクス チヤマップ座標、 頂点透明度及び頂点の法線ベク トル等を有する) やレジ ス夕セッ ト フアンクシヨ ンを読み出す。
ジオメ ト リ処理部 2は、 頂点座標データに基づき 3次元空間にポリ ゴン を配置し、 3次元空間のどの領域まで表示対象とするかのビユ ーポー トの 決定等を行う。 また、 ビューポー ト よ りはみ出すポリ ゴンの頂点除去即ち、 ク リ ッピングを行う。 さ らに、 ビューポー トに配置されたポリ ゴンを所定 の視点を基準に 2次平面に投影して 3次元から 2次元への座標変換を疔
Ό o
2次元座標に座標変換されたポリ ゴンデータは、 レンダリ ング処理部 3 に送られる。 レンダリ ング処理部 3は、 塗り潰し回路 3 0、 テクスチャ貼 り付け回路 3 1、 シヱ一ディ ング回路 3 2、 プレンディ ング回路 3 3 を有 している。
塗り潰し回路 3 0は、 ポリゴンの各頂点で囲まれた範囲にある画素 (ピ クセル) の情報を計算し、 他のレンダリ ング処理部 3内の各回路に渡す機 能を有する。 上記塗り潰しのための計算は、 ポリ ゴンの各頂点間にあるピ クセルの情報を対応の両頂点の情報を基に、 例えば線形補間を行うもので ある。
テクスチャ貼り付け回路 3 1 は、 ピクセルに対応したテクスチャをテク スチヤバッファ 4から読み出し、 ピクセル毎にカラ一を計算して求める回 路である。 シェーディ ング回路 3 2は、 ポリ ゴンの頂点デ一夕に基づきポ リ ゴンに照明効果を与える回路であ り、 かかる回路において、 本発明に従 うスポッ トライ ト特性形成の方法が実現される。 したがって、 シ I—ディ ング回路 3 2の詳細および機能については後に説明する。
シエーディ ング回路 3 2の出力は、 プレンディ ング回路 3 3 に導かれる ( プレンディ ング回路 3 3は、 必要に応じ、 フ レームバッ フ ァ 1 1 から読み 込んだ、 先に描かれているポリ ゴンのピクセルのカラー情報と、 新し く処 理するポリ ゴンのピクセルのカラー情報とを混合し、 フ レームバッファ 5 に書き込む。 このフ レームバッファ 5の情報が 1画面分ずつディ スプレー 装置 7 に、 D / A変換回路 6 を通して送られ表示される。
ここで、 図 6 において図示省略されているが、 レンダリ ング処理部 3 内 には更に、 デプステス ト機能部が備えられる。 このデプステス ト機能部は、 複数のポリ ゴンの前後関係を比較して、 最も手前に配置されたポリ ゴンの データを図示しないデプスバッファに記憶させる機能である。
即ち、 デプスバッファには、 先に描いた図形 (ポリ ゴン) のピクセルの Z値が記憶されている。 そ して、 画面上の先に描かれたポリ ゴンと重なる 位置に、 新し く ポリ ゴンを表示する場合、 新しいポリ ゴンを構成する各ピ クセルの Z値と、 デプスバッファから読み出される先に描かれたポリ ゴン のピクセルの Z値とを比較する。 比較の結果、 新しいポリ ゴンのピクセル が手前の場合は、 デプスバッファに当該ピクセルの Z値が書き込まれる。 次に、 上記のような構成の画像処理装置のシエーディ ング部 3 2 におい て実施される本発明を適用するスポッ トライ ト特性形成方法及び、 シエー ディ ング回路の実施例構成を説明する。
図 7は、 本発明を適用するシヱーデイ ング回路 3 2の実施例構成のプロ ック図である。
座標逆算回路 3 2 0は、 入力される 2次元座標ポリ ゴンデータを 3次元 座標ポリ ゴンデ一夕に変換する回路である。 座標変換回路 3 2 0によ り 3 次元座標に変換された各ピクセルのデータは分岐され、 一方は、 ライ 卜べ ク トル回路 3 2 1、 他方は、 反射べク トル回路 3 2 7 に入力される。
ライ トベク トル回路 3 2 1 は、 仮想 3次元空間中のスポッ ト光源の位置 とピクセルの 3次元座標に基づき、 スポッ ト光源から当該ピクセルに向か うライ トベク トルを求める。 さ らに、 光源と当該ピクセル間の距離データ を求める。
求められたライ トべク トルは、 スポッ ト特性生成回路 3 2 2 に入力され る。 さ らに、 求められた光源と当該ピクセル間の距離データは、 減衰処理 回路 3 2 3 に入力される。 スポッ ト特性生成回路 3 2 2の本発明に従う構成例について後に説明す るが、 この回路において、 図 1 1 に示す様に、 軸べク トル 7 0 を有するス ポッ ト光源 0による図 1 2 に一例と して示すスポッ ト効果特性が求められ る。
スポッ ト特性生成回路 3 2 2 において、 各ピクセルに対する入力される ライ トべク トルとスポッ ト光源の軸べク トル 7 0 との内積 6 0即ち、 余弦 値を求め、 スポッ ト光源によるピクセル方向の光の強度と して出力する。 一方、 減衰処理回路 3 2 3は、 スポッ ト光源 0と該当ピクセルの距離に よる、 光の減衰量を計算する。 次いで、 スポッ ト特性生成回路 3 2 2から のスポッ ト光源によるピクセル方向の光の強度及び、 減衰処理回路 3 2 3 からのスポッ ト光源から当該ピクセルまでの距離による光の減衰量に基づ き、 光強度合成回路 3 2 4から該当ピクセルに対する光強度が求められる ( 即ち、 各ピクセルに対する光強度は、 スポッ ト光源の軸ベク トル 7 0 と、 該当ピクセルのライ トべク トルとのなす角度による減衰量及び、 スポッ ト 光源から該当ピクセル位置までの距離による減衰量によ り求められる。 光強度合成回路 3 2 4によ り求められた各ピクセルに対する光強度に基 づき、 次いで、 各ピクセルに対してシェーディ ング効果が与えられる。 シ エーデイ ング効果と して、 拡散反射効果、 鏡面反射効果がある。
拡散反射効果は、 いわゆる乱反射であ り、 物体表面の中に入り込み、 吸 収されそ して再び放射される光である。 この拡散反射光は、 どの方向にも 均等に放射する。
そのため観察者の視点とは関係がない。 重要なのは光源からの該当ピク セルに向かう方向と、 該当ピクセルの表面の法線方向とのなす角度であ り . この角度が 7Γ / 2 よ り大き く なると、 光源は物体の陰にな り、 拡散光反射 は、 生じない。
したがって、 光強度合成回路 3 2 4 によ り求められた各ピクセルに対す る光強度を入力し、 これに拡散回路 3 2 5 において、 一定の拡散反射係数 を掛けるこ とによ り拡散反射光の大きさが求められる。 一方、 鏡面反射効果は、 完全反射面において、 入射光に対し反射光の角 度が法線に対し、 同じになるような効果を与えるものである。 したがって、 反射光の角度に一致する角度にいる観察者にのみ鏡面反射効果を観察する こ とができる。 このために、 反射光の大きさを求めるには、 観察者の視線 べク トルが必要である。
鏡面反射回路 3 2 6は、 光強度合成回路 3 2 4 によ り求められた各ピク セルに対する光強度を入力し、 該当ピクセルにおける入射角と、 反射べク トル回路 3 2 7から得られる視線べク トルから反射量を求め、 出力する。 さ らに、 、 上記拡散回路 3 2 5からの拡散光量と、 鏡面反射回路 3 2 6 からの鏡面反射光量が、 変調回路 3 2 8で合成されて出力される。
上記のごと く構成されるシヱ一ディ ング回路において適用されるスポッ ト特性 成回路 3 2 2の本発明に従う構成例プロ ック図が図 8に示され る。 図 9は、 図 8の回路の特徴を明確にするために比較される従来構成例 である。
図 9 における構成では、 演算器 4 0 によ り、 ピクセルデータ と、 係数デ —夕から直接演算によ りスポッ ト特性を求めるものである。 かかる場合は、 先に図 1乃至図 4 について説明したように、 計算が複雑であるとともに、 任意のスポッ ト特性を形成することが困難である。
これに対し、 本発明では、 以下に説明するようにテーブルを用いる方法 であ り、 複雑な計算を必要とせず、 テーブルに格納するデータによ り任意 のスポッ ト特性の形成が可能である。
なお、 スポッ ト特性生成回路 3 2 2 によ り生成するスポッ ト特性は、 一 例と して図 1 2 に示すごと く、 暈け領域 (penumbra scale) の範囲で特性点 a〜 pまでの特性点の光強度特性値を結んで特性曲線が形成される。 ここ で暈け領域 ( penumbra scale) は、 図 1 1 に示す角度 6 2の範囲でスポッ ト 特性の減衰の始まる点からスポヅ ト照明効果がゼロ となる点 (カッ トオフ) までの領域である。 図 1 2 において、 スポッ ト光源 0の光軸べク トル方向の光強度を 1 と し て、 特性点 a〜 pの各点に対応するピクセルに向かうべク トル Lと光軸べ ク トル D とがなす角を横軸に、 スポッ ト特性値を縦軸にと り、 且つ各点の 1の光強度に対する正規化した値をプロ ッ ト して示される。
本発明に従うスポッ ト特性生成回路 3 2 2は、 図 8 に示されるように、 上記スポッ ト特性の特性点 a〜pの光強度値を格納するテーブル 8 と、 テ 一ブル 8から各特性点 a〜 pの光強度値を読み出すア ド レスを発生す ¾ァ ド レスジエネレー夕 9及び、 特性点間を一次補間する補間器 1 0 を有して 構成される。
さ らに、 図 8のスポッ ト特性生成回路 3 2 2のスポッ ト特性テーブル 8 は、 実施例と して第 1 のバンク 8 0、 第 2のバンク 8 1 を有して構成され る。 ア ド レスジェネレータ 9の構成例が図 1 0 に示される。
ア ド レスジェネレータ 9 には、 ピクセル情報 L (光源ベク トル L X, L y, L z ) と、 係数デ一夕 (スポッ ト軸の向きベク トル D x,D y, D z 、 カッ トオフ 角 Cutoff、 暈け幅の正規化係数 Penumbra-scale及び、 特性テ一ブル 8 を選択 するイ ンデックス table-id ) が入力される。
図 1 0において、 内積計算部 9 0によ り光源ベク トル L x,L y, L z と、 ス ポッ ト軸の向きベク トル D x,D y, D z の内積 6 0 (図 1 1参照) を求め、 こ れら二つのベク トルのなす余弦値を求める。 さ らに、 減算器 9 1でカ ッ ト オフ部 6 1 (図 1 1参照) を超える部分を削除する。
次いで、 カッ トオフ部 6 1 を超える部分を削除した減算器 9 1 の出力に 対し、 乗算器 9 2 によ り暈け幅の正規化係数 Penumbra-scale例えば、 係数 1 0 を乗算し、 半影部 (暈け部) 6 2 (図 1 1参照) に適用する部分を 0 . 0〜 1 . 0 に正規化する。 したがって、 、 ク リ ップ演算器 9 3 によ り、 入 力が 1 . 0以上の時は 1 . 0 に、 0 . 0の時は、 0 . 0 にク リ ップする。 ク リ ップ演算器 9 3の出力が特性テーブル 8のァクセス及び、 特性点間 の補間に使用される。 今、 ク リ ップ演算器 9 3の出力が 1 6 ビッ トである と考えると、 その内、 特性テーブル 8のアクセスに 4 ビッ ト、 ノ ンク切り . 替えフラグ S Fに 1 ビッ ト、 そして特性点間の補間に 1 1 ビッ トが使用さ れる。
ここで、 図 8の実施例において、 特性テーブル 8は、 第 1、 第 2のメモ リバンク 8 0 , 8 1で構成されている。 したがって、 図 1 2の特性図にお いて、 特性点 a〜 pの隣接する特性値データは第 1のメモ リバンク 8 0 と 第 2のメモリバンク 8 1 にそれそれ交互に格納されている。 この様に構成 するこ とによ り、 隣接する特性値データを同時に読み出すこ とができ—るの で、 メモ リへのアクセス時間を短縮するこ とが可能である。
さ らに、 ノ ンク切り替えフラグ S Fが 0である時、 第 1のメモリバンク 8 0 に対する読み出しア ドレス (odd address)0 Aと、 第 2のメモ リ ノ ンク 8 1 の読み出しア ドレス (even address) E Aは、 同一である。 一方、 ノ ン ク切り替えフラグ S Fが 1である時、 イ ンク リ メ ン ト回路 9 4によ り第 2 のメモ リバンク 8 1 に対する読み出しア ドレス (even address) E Aを、 第 1のメモリ ノ ンク 8 0の読み出しア ド レス (odd address)0 Aに対し、 1 だ け歩進する。
具体例で説明すると、 バンク読み出し切り替えフラグ S Fが 0であり、 ア ドレスが 0 0 0 0である時、 第 1 のメモリバンク 8 0 に対する読み出し ア ド レス E Aは、 第 2のメモ リ ノ ンク 8 1 に対する読み出しア ドレス O A と同一であ り、 第 1 のメモリバンク 8 0から特性点 aのデ一夕が、 第 2の メモ リバンク 8 1から特性点 bのデータが読み出される。
かかる場合、 図 8の補間器 1 0には、 補間パラメ一夕 t と論理 0のバン ク読み出し切り替えフラグ S Fが入力される。 さ らに、 特性テーブル 8 0 : 8 1から読み出される特性点 a, bのデータが入力される。
したがって、 補間器 1 0は、 特性点 a, b間の値を次の式 ( 3 ) の関係 から一次補間によ り求める。
Dt a-b = t A + ( 1 - t ) B · · . ( 3 ) 但し、 Dt a-b は特性点 a— b間の補間パラメ一夕 t点のスポッ ト効果値、 Aは特性点 aのスポッ ト効果値及び、 Bは特性点 bのスポッ ト効果値であ る。
さ らに、 上記具体例で、 バンク読み出し切り替えフラグ S Fの論理が 1 になると、 イ ンク リ メ ン ト回路 9 4によ り、 第 1の特性テーブル 8 0の読 み出しア ドレスが 1歩進し、 ア ドレス 0 0 0 1 となる。 このア ドレスには、 特性点 cのデータが記憶されている。 ' かかる場合、 補間器 1 0では、 バンク読み出し切り替えフラグ S Fの論 理が 1であるので、 特性テーブル 8 1から読み出される特性点 bを優先し て、 特性点 b— c間の補間デ一夕 D t b- c を次の式 ( 4 ) に従い求める。
Dt b-c = t B + ( 1 - t ) C · · · ( 4 )
上記のようにして、 本発明によ り、 簡単な演算によ り スポッ ト特性を形 成するこ とが可能である。
さ らに、 、 特性テーブル 8に格納する特性点データを任意に構成するこ とによ り任意のスポッ ト特性を形成するこ とができる。 即ち、 特性点デー 夕をべき乗に構成するこ とによ り O p e n G L (商標) のスポッ ト特性を、 更に線形に構成するこ とによ り s o f t i m a g eのスポッ ト特性と同様 になる。
図 1 3、 更に本発明の別の実施の形態を説明する図である。 上記の実施 の形態では、 スポッ トの特性をある軸との角度で求めていたので必ず円形 のスポッ 卜になる。 即ち、 図 1 2の例では同心円状のスポッ トライ ト特性 に基づく スポッ トライ ト効果しか表現し得ない。 換言すると、 1次元的な スポッ トライ ト特性しか生成できない。
そこで図 1 3の実施の形態では、 更に軸を増やし、 特性テーブル 8に 2 次元で特性点データを持つ様にしている。 これによ り、 スポッ ト特性は、 2次元的な特性を持ったスポッ トになる。
図 1 3に示す具体例では、 スポッ トライ トの軸 0に垂直な軸 A , Bを定 義し、 スポッ トライ トの軸と軸 A, Bによって定義される O A平面及び〇 .
B平面を考える。 そ して、 ライ トベク トル O Bの O A平面及び O B平面に 対する正射影 C , Dが軸 A , B となす角 、 Θを用いて 2次元のテーブル を参照する。 これによ り 2次元的な特性のスポッ ト特性を得るこ とができ る。 さ らに、 スポッ トの軸 0に垂直な複数の軸を定義するこ とも同様に可 能である。
次に、 上記に説明した本発明のスポッ ト光源特性形成方法を適用する画 像処理装置の実施の形態について、 説明する。 本発明の実施例では、 光源 のグループを複数持ち、 ポリ ゴン毎にどの光源グループを使用するかを示 す光源識別記号 (以下、 L i g h t — I D と呼ぶ。 ) を持つ。 シヱーディ ング回路は、 L i g h t— I Dをも とに有効な光源情報を読み出し、 それ にしたがって、 シヱーデイ ングを行う。 図 1 4は、 本発明の光源特性形成 方法が適用される画像処理装置の第 1 の構成例プロ ック図である。
C P U 1は、 ポリゴンを使用 した画像を処理するためのプログラムの実 行を制御するものである。 C P U 1 はプログラムの進行に伴い C R Tディ スプレイ装置 7に表示するポリ ゴンの頂点デ一夕やレジス夕セッ ト フ ァ ン クシヨ ンをポリゴンバッファ 1 1 に一時的に蓄える。 さ らに、 C P U 1 は、 各ポリ ゴンがどの光源の影響を受けるかという情報と して、 各ポリ ゴン毎 に L i g h t— I Dを付加する。
ポリゴンバッ フ ァ 1 1 から読み出されるデータが、 座標変換部 2 に入力 される。 座標変換部 2は、 入力されたデ一夕を、 C P U 1 のプログラムの 実行に従い 3次元空間内に配置されるポリゴンを C R Tディ スプレイ装置 7上に表示するために 2次元座標に変換する。 2次元座標に座標変換され たポリ ゴンデータは、 塗りつぶし回路 3 0、 テクスチャ生成回路 3 1 に送 られる。
塗りつぶし回路 3 0は、 ポリ ゴンの各頂点で囲まれた範囲にある画素 (ピ クセル) の情報を計算する。 上記塗りつぶしのための計算は、 ポリ ゴンの 各頂点間にあるピクセルの情報を対応の両頂点の情報を基に、 例えば線形 補間を行う ものである。 さ らに、 、 、 塗りつぶし回路 4は、 ポリゴン毎に 付加された L i g h t一 I Dをポリ ゴンを構成する各ピクセルに書き込 み、 この書き込みをポリ ゴン数分繰り返す。
テクスチャ生成回路 3 1 は、 ピクセルに対応したテクスチャを図示しな いテクスチャバッファから読み出し、 ピクセル毎にカラーを計算して求め る回路である。 テクスチャ生成回路 3 1 の出力は、 ピクセルデ一夕 と して、 シエーディ ング回路 3 2 に与えられるとともに、 各ポリ ゴンを構成するピ クセルには、 塗りつぶし回路 3 0によ り対応するポリ ゴンの L i g h t— I Dが付加されており、 シエーディ ング回路 3 2はこの L i g h t— I D をも とに各ポリゴンを構成するピクセルの各々が影響を受ける光源につい てシェ一ディ ング処理を行う。
図 1 4に示す構成例では、 シヱーディ ング回路 3 2 内の光源レジスタ 3 2 9は A, B , C , Dの 4個あ り、 1画像シーンの中でシェーディ ング回 路 3 2が処理できる光源数が 4個の場合である。 この 4個の光源レジスタ 3 2 9の中に、 各ポリ ゴンが影響を受ける光源の情報が格納されている。 一方、 光源バッファ 1 7 には、 すべての光源の情報が記憶されており、 この光源情報が L i g h t— I Dによ り 4個指定され、 シエーディ ング回 路 3 2内の光源レジスタ 3 2 9に格納される。 この場合は画像シーンの中 の各ピクセルにはそれぞれ L i h t - I Dが付加されているので、 各ピ クセルのシェ一ディ ング処理はその L i g h t— I Dで指定された 4個の 光源に対してだけ行えばよい。 そ して、 シェーディ ング回路 3 2は、 光源 レジスタ 3 2 9の光源情報に基づき、 ポリゴンの頂点デ一夕に基づきピク セルの照明効果を計算する。 なお、 シェーディ ング回路 3 2の詳細および 機能については後に説明する。
シ: n—ディ ング回路 3 2の出力は、 色変調回路 1 2及び混合回路 3 3 に 導かれる。 色変調回路 1 2は、 シェーディ ング回路 3 2の出力に基づきピ クセル毎にカラ一変調する回路である。
混合回路 3 3は、 フ レームバファ 5から読み込んだ、 先に描かれている ポリ ゴンのピクセルのカラー情報と、 新し く処理するポリ ゴンのピクセル , のカラ一情報とを混合し、 1画面のデータ と してフ レームバファ 5に書き 込む。 このフ レームバファ 1 1の情報が C R Tディ スプレイ装置 7に表示 される。
また、 図 1 5は本発明を適用する画像処理装置の第 2の構成例プロ ック 図を示す。 図 1 5の光源バッファ 1 7には、 1画像シーンで処理できる光 源数、 即ち、 光源レジスタ 3 2 9の数を 1グループと した光源情報が複数 記憶されている。 この場合は、 各ピクセルには 1個の L i g h t— I ί)が 付加されており、 シェ一ディ ング回路 6はこの L i g h t - I Dをも とに 光源バッファ 1 7から、 実施例と して 4個の光源を 1グループと した光源 情報を読み出すこ とができる。
また、 図 1 6は本発明を適用する画像処理装置の第 3の構成例プロ ック 図である。 この構成例では、 使用するすべての光源情報は光源メモリ 8に 記憶されており、 光源バッファ 1 7には各ピクセルが影響を受ける光源の 組の情報が記憶されている。 各ピクセルには 1個の L i g h t— I Dが付 加されてお り、 シェーディ ング回路 3 2はその L i g h t— I Dをも とに 光源バッファ 1 7から各ピクセルが影響を受ける光源の組を認識し、 光源 メモリ 1 8から光源情報を読み出すこ とができる。
図 1 7は、 図 1 6に示す第 3の画像処理装置構成例の光源バッファ 1 7 の内容の一例である。 この場合は、 各ピクセルの L i g h t— I Dは 6ビ ッ トのア ド レスデ一夕 と して与えられ、 光源バッファ 1 7のそのア ド レス には、 各ピクセルが影響を受ける光源と して光源レジス夕の数だけの光源 数、 例えば 4個を 1グループと した光源グループの情報が記憶されている , なお、 L i g h t— I Dはゲームプログラムに従い、 あるポリ ゴンはど の 4個の光源の影響を受けるかという情報と して C P U 1によ り与えら れ、 通常は、 そのポリ ゴンに近い位置にある光源や、 強度の強い光源が指 定される。
このため、 図 1 7に示すように、 あるポリ ゴンに L i gh t— I D ( 0 0 0 0 0 1 ) が付属している場合、 そのポリ ゴン及びそのポリ ゴンに含ま れる各ピクセルは光源 c, d, e, f の影響を受けるものと してシエーデ ィ ング処理される。
したがって、 6 ビッ トのア ド レスであれば、 6 4の光源グループの組合 わせが可能であ り、 ハー ドウェア的に処理できる光源の個数が 4個であつ ても、 見かけ上の光源の個数を増やすこ とができる。
次に、 上記のような構成の画像処理装置のシエーディ ング回路 3 2 にお いて実施される光源特性形成方法及び、 シヱ一ディ ング回路 3 2の実'施例 を説明する。 図 1 8は、 本発明を適用するシェーディ ング回路 3 2の実施 例のブロ ック図である。
シェーディ ング回路 3 2は、 各ポリ ゴンに含まれるピクセルが光源から どのような影響を受けるかを計算する回路で、 本実施の形態例では、 べク トル演算器 3 3 1 と光源演算器 3 3 0 と光源レジスタ 3 2 9 と累算器 3 2 8の 4つのプロ ックからなる。 本実施の形態例では 4つの光源からの影響 を一度に処理できるように、 光源の情報を格納する光源レジスタ 3 2 9 と、 ピクセルに対しシェ一ディ ングの計算をする光源演算器 3 3 0はそれぞれ 4組設けられている。 4つの光源のデ一夕は、 先に図 1 4乃至図 1 7 にお いて説明したように、 光源レジスタ 3 2 9 A , B , C , Dにそれぞれ格納 される。
したがって、 各ピクセルの 4つの光源からの影響が、 それぞれ光源対応 に光源演算器 3 3 O A , B, C, Dで計算され、 累算器 3 2 8で各ピクセ ルの 4つの光源からの影響が合成される。 尚、 光源レジスタ 3 2 9 に格納 された光源データは、 光源演算器 3 3 0の中でスポッ ト特性を生成した り、 光源の減衰を処理した りするときに使用される。
次ぎにシエーディ ング回路 3 2 に含まれる各回路の動作を説明する。 ベ ク トル演算器 3 3 1は、 座標逆算器 3 2 0 と反射べク トル回路 3 2 7から 構成される。 座標逆算器 3 2 0は、 入力される 2次元座標ピクセルデ一夕 を 3次元座標ピクセルデ一夕に変換する回路である。 座標逆算回路 3 2 0 の出力は、 本実施の形態例では 4個の光源演算器 3 3 0 ( A , B , C, D ) に入力され、 4個の光源からの影響を一度に計算する。 座標逆算回路 3 2 0の他の出力は、 反射ベク トル回路 3 2 7 に入力される。 座標逆算回路 3 2 0 によ り 3次元座標に変換され、 各光源演算器 3 3 0の例えば Aに入力 される各ピクセルのデータは、 ライ トべク トル回路 3 2 1 に入力される。 ライ トべク トル回路 3 2 1 は、 仮想 3次元空間中の光源の位置とピクセ ルの 3次元座標に基づき、 光源から当該ピクセルに向かうライ トベク トル を求める。 さ らに、 光源と当該ピクセル間の距離デ一夕を求める。 ' 求められたライ トべク トルは、 スポッ ト特性生成回路 3 2 2 に入力され る。 さ らに、 求められた光源と当該ピクセル間の距離データは、 減衰処理 回路 3 2 3 に入力される。 このスポッ ト特性生成回路 3 2 2 において、 図 1 1 に示した様に、 軸ベク トル 7 0 を有するスポッ ト光源 0によ り、 図 1 2 に一例と して示すスポッ ト効果特性が求められる。 スポッ ト特性生成回 路 3 2 2は、 各ピクセルに対する入力されるライ トべク トルとスポッ ト光 源の軸ベク トル 7 0 との内積 6 0即ち、 余弦値を求め、 スポッ ト光源によ るピクセル方向の光の強度を出力する。
一方、 減衰処理回路 3 2 3は、 スポッ ト光源 0と該当ピクセルの距離に よる、 光の減衰量を計算する。 次いで、 スポッ ト特性生成回路 3 2 2から のスポッ ト光源によるピクセル方向の光の強度及び、 減衰処理回路 3 2 3 からのスポッ ト光源から当該ピクセルまでの距離による光の減衰量に基づ き、 光強度合成回路 3 2 4から該当ピクセルに対する光強度が求められる, 即ち、 各ピクセルに対する光強度は、 光源自身の持つ強度、 及びスポッ ト光源の軸べク トル 7 0 と、 該当ピクセルのライ トべク トルとのなす角度 による減衰量及び、 スポッ ト光源から該当ピクセル位置までの距離による 減衰量によ り求められる。
光強度合成回路 3 2 4 によ り求められた各ピクセルに対する光強度に基 づき、 次いで、 各ピクセルに対してシェーディ ング効果が与えられる。 シ エーデイ ング効果と して、 拡散反射効果、 鏡面反射効果がある。 拡散反射効果は、 いわゆる乱反射であ り、 物体表面の中に入り込み、 吸 収されそして再び放射される光である。 この拡散反射光は、 どの方向にも 均等に放射する。 そのため観察者の視点とは関係がない。 重要なのは光源 からの該当ピクセルに向かう方向と、 該当ピクセルの表面の法線方向との なす角度であ り、 この角度が 7Γ / 2 よ り大き く なると、 光線は物体の蔭に な り、 拡散光反射は、 生じない。
一方、 鏡面反射効果は、 完全反射面において、 入射光に対し反射光め角 度が法線に対し、 同じになるような効果を与えるものである。
したがって、 反射光の角度に一致する角度にいる観察者にのみ鏡面反射 効果を観察するこ とができる。 このため、 反射光の大きさを求めるには、 観察者の視線の反射べク トルが必要である。
鏡面反射回路 3 2 6は、 光強度合成回路 3 2 4によ り求められた各ピク セルに対する光強度を入力し、 該当ピクセルにおける入射角と、 反射べク トル回路 3 2 7から得られる視線べク トルから反射量を求め、 出力する。 さ らに、 上記拡散回路 3 2 5からの拡散光量と、 鏡面反射回路 3 2 6か らの鏡面反射光量が、 他の光源演算器 3 3 0 B , C , Dの出力と共に、 累 算器 3 2 8で合成されて出力される。
上記のごと く構成されるシヱーディ ング回路 3 2において適用されるス ポッ ト特性生成回路 3 2 2の構成例プロ ック図が図 1 9 に示される。 本構 成例では、 以下に説明するようにテーブルを用いる方法によ り、 複雑な計 算を必要とせず、 テーブルに格納するデータによ り任意のスポッ ト特性の 形成が可能である。 尚、 スポッ ト特性生成回路 A , B, C, Dは同様の構 成を有するのでスポッ ト特性生成回路 Aを中心に説明する。
スポッ ト特性生成回路 3 2 2 によ り生成するスポッ ト特性は、 一例と し て図 1 2 に示すごと く、 ぼけ領域 (penumbra scale ) 6 2 (図 1 2参照) の 範囲で特性点 a〜 pまでの特性点の光強度特性値を結んで特性曲線が形成 される。 _ 即ち、 図 1 2において、 スポッ ト光線 0の光軸ベク トル方向の光強度を 1 と して、 特性点 a〜 pの各点に対応するピクセルに向かうべク トル Lと 光軸べク トル Dとなす角を横軸にと り、 且つ各点の 1の光強度に対する正 規化した値をプロ ッ ト して示される。
本構成例のスポッ ト特性生成回路 3 2 2は、 図 1 9に示されるように、 上記スポッ ト特性の特性点 a〜pの光強度値を格納するテーブル 8 0 と、 テーブル 8 0から各特性点 a〜 pの光強度値を読み出すァ ド レスを発生す るア ド レスジェネレータ 9 0及び、 特性点間を一次補間する補間器 1 0 0 を有して構成される。
ア ドレスジェネレータ 9 0には、 ピクセル情報と してピクセルデータ ( L x,L y,L z)が、 また光源情報と してスポッ ト軸の向きべク トル ( D x,D y,D z)、 カツ トオフ角 (Cutoff) 、 ぼけ幅の正規化係数 (Penumbra-scale) 及び、 特 性テーブル 8 0を選択するィ ンデイ クス (table-id) が入力される。
なお、 これらの光源情報は、 図 1 4、 図 1 5に示す光源バッファ 1 7又 は、 図 1 6に示す光源メモリ 1 8に光源 a , b , c · · ' ごとに記憶され ている。 本実施の形態例においては、 各ピクセルに対する 4個の光源の影 響を処理することができ、 各ピクセルにはその 4個の光源を指定する L i g h t— I Dが図 1 4等に示す C P U 1によ り与えられている。 光源レジ スタ 3 2 9は A, B , C, Dの 4個があ り、 L i g h t— I Dによ り光源 バッファ 7又は光源メモリ 8から 4個の光源デ一夕を読み込み、 スポッ ト 特性生成回路 3 2 2 (A, B , C , D ) に光源データを提供する。
図 1 9において、 内積計算部 9 1によ り ピクセルデータ Lx,Ly,Lz と、 スポッ ト軸の向きべク トル Dx,Dy,Dz の内積 6 0 (図 1 1参照) を求め、 これら二つのベク トルのなす余弦値を求める。 さ らに、 減算器 9 2でカツ トオフ部 6 1 (図 1 1参照) を越える部分を削除する。
次いで、 カ ッ トオフ部 6 1を越える部分を削除した減算器 9 2の出力に 対し、 乗算器 9 3によ りぼけ幅の正規化整数 Penumbra-scale例えば、 係数 1 0を乗算し、 半影部 (ぼけ部) 6 2 (図 1 1参照) に適用する部分を 0. .
0〜 1 . 0 に正規化する。 したがって、 、 ク リ ップ演算器 9 4によ り、 入 力が 1 . 0以上の時は 1 . 0 に、 0 . 0以下の時は、 0 . 0 にク リ ップす る。
ク リ ップ演算器 9 4の出力が特性テーブル 8 0のアクセス及び、 特性点 間の補間に使用される。 今、 ク リ ップ演算器 9 4の出力が 1 6 ビッ トであ ると考えると、 その内、 特性テーブル 8 0のアクセスに 4 ビッ ト、 ノ ンク 切り替えフラグ S Fに 1 ビッ ト、 そ して特性点間の補間に 1 1 ビッ トが使 用される。
ここで、 図 1 9の実施例において、 特性テーブル 8 0は、 第 1、 第 2の メモ リバンク 8 1、 8 2で構成されている。 したがって、 図 1 2の特性図 において、 特性点 a〜 pのデ一夕は第 1 のメモリバンク 8 1 と第 2のメモ リバンク 8 2 にそれぞれ交互に格納されている。
さ らに、 ノ ンク切り替えフラグ S Fが 0である時、 第 1のメモリ ノ、ンク 8 1 に対する読み出しア ドレス (odd address ) 0 Aと、 第 2のメモ リ ノ ン ク 8 2の読み出しア ド レス (even address) E Aは、 同一である。 一方、 バン ク切り替えフラグ S Fが 1である時、 イ ンク リメ ン ト回路 9 5 によ り第 2 のメモリ ノ、ンク 8 2 に対する読み出しア ド レス ( even address) E Aを、 第 1 のメモリ ノ、ンク 8 1 の読み出しア ド レス (odd address ) 〇 Aに対し、 1 だ け歩進する。
具体例は、 先に説明したと同様であ り、 バンク読み出し切り替えフラグ S Fが 0であ り、 ア ド レスが 0 0 0 0である時、 第 1 のメモリ ノ、ンク 8 1 に対する読み出しア ドレス E Aは、 第 2のメモリバンク 8 2 に対する読み 出しア ドレス O Aと同一であ り、 第 1 のメモ リバンク 8 1 から特性点 aの データが、 第 2のメモ リバンク 8 2から特性点 bのデ一夕が読み出される。 かかる場合、 図 1 9の補間器 1 0 0 には、 補間パラメ一夕 t と論理 0の バンク読み出し切り替えフラグ S Fが入力される。 さ らに、 特性テーブル 8 1、 8 2から読み出される特性点 a , bのデータが入力される。 したがって、 補間器 1 0 0は、 特性点 a, b間の値 Dt a-bを、 上記した 式 ( 3 ) の関係から一次補間によ り求める。
さ らに、 上記具体例で、 バンク読み出し切り替えフラグ S Fの論理が 1 になると、 イ ンク リ メ ン ト回路 9 5 によ り、 第 1の特性テーブル 8 1 の読 み出しア ド レスが 1歩進し、 ア ド レス 0 0 0 1 となる。 このア ド レスには、 特性点 cのデータが記憶されている。
かかる場合、 補間器 1 0 0では、 バンク読み出し切り替えフラグ S Fの 論理が 1であるので、 特性テーブル 8 2から読み出される特性点 bを優先 して、 特性点 b— c間の補間データ Dt b-c を上記した式 ( 4 ) に従い求め る。
上記のようにして、 簡単な演算によ りスポッ ト特性を形成するこ とが可 能である。 さ らに、 特性テーブル 8 0 に格納する特性点データを任意に構 成するこ とによ り任意のスポッ ト特性を形成することができる。
次ぎに、 本発明にしたがって、 街路を複数の街灯で照明する画像シー ンの場合の実施例を図 2 0 に示す。 光源 a, b , c等が街路両側に配置さ れる。 街路を形成するポリゴンには、 どの光源からの影響を受けるかを示 す L i g h t — I Dが付加されている。 この例では 1 つのポリ ゴンは、 最 大 4光源からの影響を受けることができる。 例えば、 ポリ ゴン P 2 の L i g h t — I Dが ( 0 0 0 0 0 1 ) の場合は、 図 1 7の光源バッファの内容 によ り光源 c , d , e , f の影響を受けるこ とになる。
このように、 ポリ ゴン毎にどの光源からの影響を受けるかの I Dをもち、 対応する光源の処理を行えば、 同時に処理できる光源数以上の数の光源を シーン中に持てることになる。
また、 本発明の処理フローを図 2 1 に示す。 プログラム初期処理段階の 処理と して、 ステップ 1 , 2の処理が行われる。 先ずシーン中の光源パラ メータを光源バッファ 1 7 に書き込む (ステップ 1 ) 。 光源パラメ一夕に は、 光源の位置、 色、 強さ及び方向等があり、 シーン中には、 光源バッフ ァ 1 Ίが許す限りの光源を持つこ とができる。 . 次いで、 各ポリ ゴン毎に影響を受ける光源の I D ( L i g h t— I D ) を付ける (ステップ 2 ) 。 各ポリ ゴンは、 通常は、 最も近い光源の影響を 強く 受けるが、 例えば、 ハー ドウェア的に同時に 4個の光源の処理が可能 なシステムの場合は、 L i g h t — I Dとして、 各ポリ ゴンから最も近く にある、 4個の光源を指定する光源バッファのァ ドレスを付けるこ とがで きる。 なお、 ポリ ゴンが影響を受ける光源と して、 ポリ ゴンの各頂点の法 線ベク トル方向、 及び光源の向く方向を基準に、 光源を選択するこ ともで きる。
さ らに、 ステップ 3は、 ゲームの進行に伴い、 各シーンで各ポリゴンの 座標変換及び透視変換を、 ポリゴン数分繰り返す (ステップ 3 ) 。 このス テツプ 3の処理によ り、 3次元のポリ ゴンデータは、 スク リーン上の 2次 元デ一夕に変換され、 透視変換によ り、 視点位置の変更に伴う遠近感の変 化を処理することができる。
次いで、 各ポリ ゴンの塗りつぶしを行い、 ピクセル毎に L i g h t— I Dを書き込む (ステップ 4 ) 。 したがって、 このステップ 4において、 シ ーン中の多くの光源から、 ピクセルが影響を受ける 4個の光源を指定され るこ とになる。
そして、 ステップ 5は、 テクスチャ生成が行われる (ステップ 5 ) 。 テ クスチヤには、 ポリ ゴン表面の模様あるいは材質感を含み、 マッ ピング (写 像) によ りその模様等を対象のポリ ゴン面に貼りつける。
次いで、 本発明の特徴によ り、 L i g h t — I Dに対応する光源パラメ 一夕を光源バッファ 1 7から読み出す (ステップ 6 ) 。 すなわち、 L i g h t - I Dが光源バッファ 1 7のア ド レスの場合は、 そのア ドレスに基づ き光源メモ リ 1 8に記憶された光源情報が読み出される。
その後、 シェーディ ング処理が行われる (ステップ 7 ) 。 このシエーデ ィ ング処理によ り、 光源及び対象物のポリ ゴンデータに基づき画面の照明、 色付け及び陰影処理が行われる。 さ らに、 1画面のビデオデータがフ レー ムバッファ 5に書き込まれる (ステップ 8 ) 。 この様なステップ 5からス テツプ 8 までの処理を、 ポリ ゴンを形成する各ピクセル数分繰り返し、 フ レームバッファ 5 に蓄積された 1画面の情報が C R Tディスプレイ装置 7 に表示される。 産業上の利用可能性
以上、 図にしたがい実施の形態を説明したように、 本発明に従うスポッ トライ ト特性形成方法は、 スポッ トの特性を計算式に基づき、 ピク ルご とに演算によ り求める方法に比べ、 スポッ 卜の軸と光源べク トルのなす角 を用いて、 予め特性点デ一夕を記憶する特性テーブルを参照するように し ているので、 よ り簡単な回路で自由度の高いスポッ ト特性を形成するこ と が可能である。
さ らに、 スポッ トの特性に高い自由度を持ち、 且つ実現する回路も簡単 である。 さ らに、 予め用意する特性テーブルを 2次元に拡張すれば、 非円 形のスポッ トを形成した り、 1つの光源で複数のスポッ トを形成するこ と も可能となる。 以上説明した通り、 本発明によれば、 光源グループを複数 持ち、 L i g h t— I Dによ りセレク トするので、 同時に使用できる光源 数以上の光源をシーン中に使う こ とができる。

Claims

請求の範囲
1 . ポリ ゴンを構成する画素に付与されるスポッ トライ ト効果の特性を 形成する方法において、
所定のスポッ トライ ト特性曲線に対応する複数の特性値をテーブルに 格納し、 該テ一ブルから読み出される特性値若し く は、 該テーブルから 読み出される互いに隣接する特性値間を補間して求められる補間値によ り 該スポッ トライ ト特性曲線を形成する ' ことを特徴とするスポッ トライ ト特性形成方法。
2 . ポリ ゴンを構成する画素に付与されるスポッ ト ライ ト効果の特性を 形成する方法において、
所定のスポッ トライ ト特性曲線に対応する複数の特性値をテーブルに 格納し、 スポッ トライ 卜の光軸ベク トルと光源から各ピクセルに向かう若 しく は各ピクセルから光源に向かう ライ トべク トルとの内積に応じた該テ 一ブルのア ドレスから特性値を読み出し、
該テーブルから読み出される特性値若しくは、 該テーブルから読み出 される互いに隣接する特性値間を補間して求められるを補間値によ り該ス ポッ トライ ト特性曲線を形成する
こ とを特徴とするスポッ トライ ト特性形成方法。
3 . 請求項 2 において、
前記光軸べク トルと前記ライ トべク トルの内積のうちスポッ トライ ト の暈け領域内のビクセルに関するライ トべク トルとの内積を正規化し、 正 規化された内積に応じ該テ一ブルのア ドレスから特性値を読みだすことを 特徴とするスポッ トライ ト特性形成方法。
4 . ポリゴンを構成する画素に付与されるスポッ トライ ト効果の特性を 形成する方法において、
所定のスポッ トライ ト特性曲線に対応する複数の特性値をテーブルに 格納し、 スポッ トライ トの光軸べク トルと該スポッ トライ トの光軸べク トルに垂直な少なく とも二つの軸を定義し、 該スポッ トライ トの光軸べク トルとこれに垂直な少なく とも二つの軸 によってそれそれ定義される少なく とも二つの平面と、 光源から各ピクセ ルに向かう若し く は各ピクセルから光源に向かう ピクセルに向かうライ ト べク トルの該少な く とも二つの平面に対する正射影とが成す角度に対応し て、 該テーブルから特性値を読み出し、
該読み出された特性値若し く は、 該テ一ブルから読みだされた互いに 隣接する特性値間の補間値によ り該スポッ トライ ト特性曲線を形成する こ とを特徴とするスポッ トライ ト特性形成方法。
5 . 表示されるポリ ゴンにスポッ トライ 卜の照明効果を与えるスポッ ト ライ ト特性形成部を有する画像処理装置において、
該スポッ トライ ト特性形成部は、
所定のスポッ トライ ト特性曲線に対応する複数の特性値を格納するテ 一ブルと、
該テーブルから特性値を読み出すためのア ドレスを発生するア ド レス 生成回路と、
該テーブルから該ァ ドレスに対応して読み出される互いに隣接する特 性値間の補間値を求める補間器を有し、
該テーブルから読み出される特性値若しく は、 該補間器で求めらた補 間値によ り、 該スポッ トライ ト特性曲線を形成する
ことを特徴とするる画像処理装置。
6 . 請求項 5 において、
前記ァ ドレス生成回路は、
スポッ トライ トの光軸べク トルと光源からピクセルに向かう若しく は ピクセルから光源に向かうライ トべク トルの内積を求める回路を有し、 該内積を求める回路によ り求められた内積の値に応じて、 該テーブル から特性値を読み出すァ ド レスを出力するこ とを特徴とする画像処理装 置。
7 . 請求項 6 において、 前記ァ ド レス生成回路は、 更に
前記内積を求める回路によ り求められた内積値から、 スポッ トライ ト の暈け領域内のピクセルに関する内積値を抽出する抽出回路と、
該抽出回路の出力を正規化する正規化回路とを有するこ とを特徴とす る画像処理装置。
8 . 請求項 5乃至 7のいずれかにおいて、
前記所定のスポッ トライ ト特性曲線に対応する複数の特性値を格'納す るテーブルは、 2バンクで構成され、 それそれ該複数の特性値の奇数番目 の特性値と、 偶数番目の特性値を格納し、
前記補間器は、 該 2バンクのテーブルのそれそれから読み出される互 いに隣接する特性値の補間値を求めることを特徴とする画像処理装置。
9 . ポリ ゴンを構成する画素に対するスポッ トライ ト効果の特性を形成 する方法において、
所定のスポッ トライ ト特性曲線に対応する複数の特性値をスポッ トラ ィ 卜の光源から各ピクセルに向かう若し く は各ピクセルからスポッ ト ライ 卜の光源に向かうライ トべク トルよ り抽出される独立した 2つの成分をパ ラメータ とする 2次元テーブルに格納し、
前記 2つのパラメータに基づき、 前記 2次元テーブルから特性値を読 み出し、 該読み出された特性値若しくは、 該テーブルから読み出された 互いに隣接する特性値間の補間値によ りスポッ トライ ト特性曲線を形成す る
ことを特徴とするスポッ トライ ト特性形成方法。
1 0 . 複数のポリ ゴンによ り画像表示されるオブジェク 卜に光源による 照明効果を与える画像処理装置において、
複数の光源の情報を保存するメモリ と、
一のポリ ゴンに対し所定数の光源の情報によ り シエーディ ングを行う 手段と、 該所定数の光源の情報をポリゴンに対応して該メモリから読み 出し、 該シエーディ ングを行う手段に供給する手段と、 を有するこ とを特徴とする画像処理装置。
1 1 . 請求項 1 0において、 前記所定数の光源は、
前記ポリ ゴンと前記光源との距離に基づいて対応付けられている こ とを特徴とする画像処理装置。
1 2 . 請求項 1 0において、 前記所定数の光源の情報は、
ポリ ゴンを構成する複数のピクセルの各々に対するピクセルデータに 含まれる識別記号によ り特定されるこ と ' を特徴とする画像処理装置。
1 3 . 請求項 1 0において、 前記所定数の光源は、
異なるポリ ゴンに対して少な く とも一部重複しているこ と
を特徴とする画像処理装置。
1 4 . 複数のポリ ゴンによ り画像表示されるォブジヱク トに光源による 照明効果を与える画像処理装置において、
複数の光源の情報の組を複数保存するメモ リ と、
一のポリ ゴンに対し該複数の光源の情報の組によ り シヱーディ ングを 行う手段と、
該複数の光源の情報の組をポリゴンに対応して該メモリから読み出 し、 該シェーディ ングを行う手段に供給する手段と、
を有するこ とを特徴とする画像処理装置。
1 5 . 複数のポリ ゴンによ り画像表示されるォブジェク トに光源による 照明効果を与える画像処理装置において、
複数の光源の情報を保存する第 1 のメモリ と、
複数の光源の組の情報を複数保存する第 2のメモリ と、
一のポリ ゴンに対し該複数の光源の組に対応する光源の情報によ り シ エーデイ ングを行う手段と、
該複数の光源の組の情報をポリ ゴンに対応して該第 2のメモリから読 み出し、 更に、 該複数の光源の組の情報によ り該複数の光源の組に対応す る光源の情報を前記第 1のメモリから読み出し、 該シヱーデイ ングを行う 手段に供給する手段とを有するこ とを特徴とする画像処理装置。
1 6 . 請求項 1 4 または 1 5 において、 前記複数の光源の組は、
前記ポリ ゴンと前記光源との距離に基づいて対応付けられているこ と を特徴とする画像処理装置。
1 7 . 請求項 1 4 または 1 5 において、 前記複数の光源の組は、
ポリ ゴンを構成する複数のピクセルの各々に対するピクセルデ一夕に 含まれる識別記号によ り特定されるこ と
を特徴とする画像処理装置。
1 8 . 請求項 1 4 または 1 5 において、 前記複数の光源の組における光 源は、
異なるポリ ゴンに対して少な く とも一部重複しているこ と
を特徴とする画像処理装置。
1 9 . 複数のポリ ゴンによ り画像表示されるォブジェク トに光源による 照明効果を与える画像処理方法において、
画像シーンの中で使用する複数の光源の情報をメモリ に書き込む第 1 のステップと、
ポリゴン毎に影響を受ける光源の識別記号を付ける第 2のステップ と、
該ポリ ゴンのデータに対し座標変換を行う第 3のステップと、 該ポリ ゴンを構成するピクセル毎に該識別記号を書き込む第 4のステ ップと、 該ピクセルのデータをも とにテクスチャ生成を行う第 5のステ ップと、
該識別記号に対応する該ポリ ゴン毎に影響を受ける光源の情報を該メ モ リから読み出す第 6のステップと、
該ピクセルに該メモリから読み出された光源の情報に基づきシエーデ ィ ングを行う第 7のステップと、
該ピクセルのデ一夕をフ レームノ ッファに書き込む第 8のステップと からなるこ とを特徴とする画像処理方法。
2 0 . 請求項 1 9 において、
複数のポリ ゴンによ り構成されるォブジェク トに対し、 前記ステップ 3及びステップ 4を該ポリ ゴン数分繰り返すこ と
を特徴とする画像処理方法。
2 1 . 請求項 2 0において、 更に、
複数のピクセルによ り構成されるポリゴンに対し、 前記ステヅプ 5か らステップ 8 を該ピクセル数分繰り返すこ と
を特徴とする画像処理方法。
2 2 . 請求項 1 9 において、 前記識別記号は、
ポリゴン毎に影響を受ける複数の光源の組を特定するものであるこ と を特徴とする画像処理方法。
2 3 . 請求項 1 9 において、 前記ポリ ゴン毎に影響を受ける光源は、 前 記ポリ ゴンと前記光源との距離に基づいて対応付けられているこ と を特徴とする画像処理方法。
PCT/JP1998/001475 1997-05-07 1998-03-31 Procede d'obtention de fonction projecteur et processeur d'images utilisant ce procede WO1998050890A1 (fr)

Priority Applications (4)

Application Number Priority Date Filing Date Title
DE69826996T DE69826996T2 (de) 1997-05-07 1998-03-31 Scheinwerfer-kennzeichnende erzeugungsverfahren und bildprozessor-verwendung
US09/214,494 US6333742B1 (en) 1997-05-07 1998-03-31 Spotlight characteristic forming method and image processor using the same
EP98911132A EP0974935B1 (en) 1997-05-07 1998-03-31 Spotlight characteristic forming method and image processor using the same
JP54791098A JP4060375B2 (ja) 1997-05-07 1998-03-31 スポットライト特性形成方法及びこれを用いた画像処理装置

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP11597197 1997-05-07
JP9/115971 1997-05-07
JP9/175904 1997-07-01
JP17590497 1997-07-01

Publications (1)

Publication Number Publication Date
WO1998050890A1 true WO1998050890A1 (fr) 1998-11-12

Family

ID=26454384

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP1998/001475 WO1998050890A1 (fr) 1997-05-07 1998-03-31 Procede d'obtention de fonction projecteur et processeur d'images utilisant ce procede

Country Status (9)

Country Link
US (1) US6333742B1 (ja)
EP (1) EP0974935B1 (ja)
JP (1) JP4060375B2 (ja)
KR (1) KR100295709B1 (ja)
CN (1) CN1231041A (ja)
DE (1) DE69826996T2 (ja)
ES (1) ES2226109T3 (ja)
TW (1) TW371746B (ja)
WO (1) WO1998050890A1 (ja)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001084405A (ja) * 1999-09-16 2001-03-30 Sega Corp ポリゴン画像形成方法及び、これを用いた画像処理装置
US6753875B2 (en) * 2001-08-03 2004-06-22 Hewlett-Packard Development Company, L.P. System and method for rendering a texture map utilizing an illumination modulation value
US7948490B2 (en) * 2003-10-22 2011-05-24 Microsoft Corporation Hardware-accelerated computation of radiance transfer coefficients in computer graphics
EP2439729A3 (en) * 2006-06-02 2013-09-04 Samsung Display Co., Ltd. Field sequential color display system having multiple segmented backlight
US8913829B2 (en) * 2012-06-05 2014-12-16 Tandent Vision Science, Inc. Automatic processing scale estimation for use in an image process
CN104361863A (zh) * 2014-11-30 2015-02-18 南京巨鲨显示科技有限公司 基于等高圆近似的亮度均匀性调节方法
GB2545226A (en) * 2015-12-09 2017-06-14 Samsung Electronics Co Ltd Determining lighting in a 3D virtual scene

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04127386A (ja) * 1990-09-19 1992-04-28 Sony Corp 画像表示処理装置
JPH04315274A (ja) * 1991-04-12 1992-11-06 Sony Corp 画像変換装置
JPH06301794A (ja) * 1993-04-15 1994-10-28 Matsushita Electric Ind Co Ltd 3次元画像生成表示装置
JPH08161527A (ja) * 1994-12-01 1996-06-21 Namco Ltd 画像合成装置及び画像合成方法
JPH1063874A (ja) * 1996-08-13 1998-03-06 Tsuneo Ikedo スポットライティング回路

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60246481A (ja) * 1984-05-21 1985-12-06 Yokogawa Hokushin Electric Corp 図形表示装置
JPH0746391B2 (ja) * 1984-09-14 1995-05-17 株式会社日立製作所 図形シエ−デイング装置
US4819192A (en) * 1985-02-26 1989-04-04 Sony Corporation Method of displaying image
GB9301661D0 (en) * 1993-01-28 1993-03-17 Philips Electronics Uk Ltd Rendering an image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04127386A (ja) * 1990-09-19 1992-04-28 Sony Corp 画像表示処理装置
JPH04315274A (ja) * 1991-04-12 1992-11-06 Sony Corp 画像変換装置
JPH06301794A (ja) * 1993-04-15 1994-10-28 Matsushita Electric Ind Co Ltd 3次元画像生成表示装置
JPH08161527A (ja) * 1994-12-01 1996-06-21 Namco Ltd 画像合成装置及び画像合成方法
JPH1063874A (ja) * 1996-08-13 1998-03-06 Tsuneo Ikedo スポットライティング回路

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP0974935A4 *

Also Published As

Publication number Publication date
JP4060375B2 (ja) 2008-03-12
DE69826996D1 (de) 2004-11-18
US6333742B1 (en) 2001-12-25
CN1231041A (zh) 1999-10-06
ES2226109T3 (es) 2005-03-16
KR20000023605A (ko) 2000-04-25
TW371746B (en) 1999-10-11
KR100295709B1 (ko) 2001-07-28
EP0974935B1 (en) 2004-10-13
DE69826996T2 (de) 2005-03-10
EP0974935A1 (en) 2000-01-26
EP0974935A4 (en) 2003-04-16

Similar Documents

Publication Publication Date Title
US5856829A (en) Inverse Z-buffer and video display system having list-based control mechanism for time-deferred instructing of 3D rendering engine that also responds to supervisory immediate commands
McReynolds et al. Advanced graphics programming techniques using OpenGL
Merritt et al. [26] Raster3D: Photorealistic molecular graphics
Rezk-Salama et al. Interactive volume on standard pc graphics hardware using multi-textures and multi-stage rasterization
US6181352B1 (en) Graphics pipeline selectively providing multiple pixels or multiple textures
US5224208A (en) Gradient calculation for texture mapping
US6833830B2 (en) Method and apparatus for providing shading in a graphic display system
US5307450A (en) Z-subdivision for improved texture mapping
US6417858B1 (en) Processor for geometry transformations and lighting calculations
US6747660B1 (en) Method and system for accelerating noise
AU757621B2 (en) Apparatus and method for real-time volume processing and universal 3D rendering
Hart Perlin noise pixel shaders
US6437781B1 (en) Computer graphics system having per pixel fog blending
JP5061273B2 (ja) 画像生成装置、テクスチャマッピング装置、画像処理装置、及びテクスチャ格納方法
JPH06348864A (ja) 画像表示装置、コンピュータ・グラフィックス・システム及び画像表示方法
JPH04222071A (ja) テキスチュア・マッピング方法及びその装置
US6806886B1 (en) System, method and article of manufacture for converting color data into floating point numbers in a computer graphics pipeline
US20040113911A1 (en) Method and system for improved per-pixel shading in a computer graphics system
WO1996028794A1 (fr) Dispositif d&#39;affichage graphique tridimensionnel
US7071937B1 (en) Dirt map method and apparatus for graphic display system
KR20040024550A (ko) 묘화 처리 방법
US5740344A (en) Texture filter apparatus for computer graphics system
WO1998050890A1 (fr) Procede d&#39;obtention de fonction projecteur et processeur d&#39;images utilisant ce procede
US5732248A (en) Multistep vector generation for multiple frame buffer controllers
US7116333B1 (en) Data retrieval method and system

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 98800937.4

Country of ref document: CN

AK Designated states

Kind code of ref document: A1

Designated state(s): CN JP KR US

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): DE ES FR GB IT

WWE Wipo information: entry into national phase

Ref document number: 09214494

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 1998911132

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 1019997000052

Country of ref document: KR

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWP Wipo information: published in national office

Ref document number: 1998911132

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 1019997000052

Country of ref document: KR

WWG Wipo information: grant in national office

Ref document number: 1019997000052

Country of ref document: KR

WWG Wipo information: grant in national office

Ref document number: 1998911132

Country of ref document: EP