Image processing program, information processing system. information processing apparatus, and image processing method
By employing partial shadow maps and shadow buffer updates for each object, the method effectively reduces processing load and light bleeding in image processing, ensuring natural-looking shadows in virtual spaces.
Patent Information
- Application Number
- JP2024011042
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-01-29
AI Technical Summary
Existing image processing techniques for generating images with shadows in virtual spaces impose a significant processing load on computers, particularly due to the complexity of shadow map calculations.
The method involves setting a subspace for each object, generating a partial shadow map based on a virtual light source, determining shadow density using depth buffers, and storing shadow intensity in a shadow buffer to reduce processing load by utilizing partial shadow maps for each object.
This approach reduces the processing load on computers while maintaining natural-looking shadows, minimizing light bleeding, and facilitating efficient shadow calculation.
Smart Images

Figure 2025116554000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to an image processing program, an information processing system, an information processing device, and an image processing method for generating an image in which a shadow is added to an object in a virtual space. [Background technology]
[0002] Conventionally, there is a technique that uses a shadow map to generate an image in which a shadow is added to an object in a virtual space (for example, see Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] “Cascaded Shadow Maps”, [online], Microsoft Corporation, [Retrieved December 19, 2023], Internet<https: / / learn.microsoft.com / en-us / windows / win32 / dxtecharts / cascaded-shadow-maps> Summary of the Invention [Problem to be solved by the invention]
[0004] It is desirable to reduce the processing load on a computer due to the processing required to generate a shaded image.
[0005] Therefore, an object of the present invention is to provide an image processing program, an information processing system, an information processing device, and an image processing method that can reduce the processing load on a computer when generating an image with a shadow. [Means for solving the problem]
[0006] In order to solve the above problems, the present invention employs the following configurations (1) to (4).
[0007] (1) An example of the present invention is an image processing program that causes a computer of an information processing apparatus to execute the following processes. - Processing for drawing objects in virtual space to the frame buffer or G buffer while performing depth tests using the depth buffer A process of setting a subspace that is a part of the virtual space and that includes the first type of object for each of a plurality of first type objects among the objects. A process of setting a virtual light source for the subspace for each of the above objects and generating a subshadow map that is a shadow map of the first type of object in the subspace based on the virtual light source. For each of the above objects, a process of determining the shadow density of the first type object for each pixel corresponding to the pixel within the range of the subspace based on the depth of the depth buffer and the depth of the partial shadow map, and overwriting and storing the shadow density in the shadow buffer if the shadow density of the pixel is a shadow value that is darker than the value stored in the shadow buffer that stores the shadow density. A process of drawing a shadow onto an image in a frame buffer based on the frame buffer and shadow buffer, or drawing an image with a shadow onto a frame buffer based on the G buffer and shadow buffer.
[0008] According to the above configuration (1), the processing load on the computer can be reduced by using a partial shadow map for each object.
[0009] (2) In the above configuration (1), the image processing program may cause the computer to determine the shadow density for each pixel corresponding to the range of the subspace based on a distributed shadow map technique using the depth of the depth buffer and the depth of the partial shadow map.
[0010] According to the above configuration (2), it is possible to display natural-looking shadows using a distributed shadow map while suppressing light bleeding.
[0011] (3) In the above configuration (2), the first type of object may be a flat-shaped object.
[0012] According to the above configuration (3), the risk of light bleeding occurring can be further reduced.
[0013] (4) In the above configuration (1), the virtual light source may be a parallelepiped light source, and the subspace may be a rectangular parallelepiped having sides aligned with the light direction of the parallelepiped light source.
[0014] According to the above configuration (4), it is possible to facilitate the calculation for generating the partial shadow map.
[0015] Another example of the present invention may be an information processing device or an information processing system that executes the processes in (1) to (4) above. Also, another example of the present invention may be an image processing method that executes the processes in (1) to (4) above. [Effects of the Invention]
[0016] According to the image processing program, the information processing system, the information processing device, and the image processing method, the processing load on the computer can be reduced. [Brief explanation of the drawings]
[0017] [Figure 1] A diagram showing an example of the left and right controllers attached to the main unit. [Figure 2] A diagram showing an example of the state when the left controller and right controller are detached from the main unit. [Figure 3] Six-sided views showing an example of the main unit [Figure 4] Six-sided diagram showing an example of the left controller [Figure 5] Six-sided diagram showing an example of the right controller [Figure 6]A block diagram showing an example of the internal configuration of a main unit. [Figure 7] A block diagram showing an example of the internal configuration of the main unit, left controller, and right controller. [Figure 8] FIG. 10 is a diagram showing an example of a game image. [Figure 9] FIG. 1 is a diagram showing an example of a predetermined type of object placed in a virtual space. [Figure 10] FIG. 10 is a diagram showing an example of a subspace set for each object. [Figure 11] FIG. 10 is a diagram showing an example of a subspace in a modified example of the present embodiment. [Figure 12] FIG. 1 is a diagram showing an example of the positional relationship between a light source, an object, and a surface onto which the shadow of the object is cast. [Figure 13] FIG. 1 is a diagram showing an example of an object and an area cast in shadow by the object; [Figure 14] A diagram showing an example of a game image in which the shadows of two objects overlap. [Figure 15] An example of updating the shadow buffer. [Figure 16] A diagram showing an example of a game image in which the shadows of two objects overlap. [Figure 17] FIG. 10 is a diagram showing an example of a storage area for storing various data used in information processing in a game system. [Figure 18] A flowchart showing an example of the flow of game processing executed by the game system. [Figure 19] 19 is a sub-flowchart showing an example of a detailed flow of the rendering process in step S3 shown in FIG. 18. [Figure 20] 20 is a sub-flowchart showing an example of the detailed flow of the shadow buffer update process in step S17 shown in FIG. 19. [Figure 21] 21 is a sub-flowchart showing an example of a detailed flow of the distributed shadow map processing in step S23 shown in FIG. 20. [Figure 22] 20 is a sub-flowchart showing an example of the detailed flow of the lighting process in step S18 shown in FIG. 19. DETAILED DESCRIPTION OF THE INVENTION
[0018] [1. Game system configuration] A game system according to an example of this embodiment will be described below. An example of the game system 1 according to this embodiment includes a main unit (information processing device; in this embodiment, it functions as a game device main unit) 2, a left controller 3, and a right controller 4. The left controller 3 and the right controller 4 are each detachable from the main unit 2. In other words, the game system 1 can be used as an integrated device by attaching the left controller 3 and the right controller 4 to the main unit 2. The game system 1 can also be used by separating the main unit 2 from the left controller 3 and the right controller 4 (see FIG. 2). Below, the hardware configuration of the game system 1 according to this embodiment will be described, followed by a description of the control of the game system 1 according to this embodiment.
[0019] FIG. 1 is a diagram showing an example of a state in which a left controller 3 and a right controller 4 are attached to a main unit 2. As shown in FIG. 1, the left controller 3 and the right controller 4 are each attached to and integrated with the main unit 2. The main unit 2 is a device that executes various processes (e.g., game processes) in the game system 1. The main unit 2 is equipped with a display 12. The left controller 3 and the right controller 4 are devices that have operation units that allow the user to perform inputs.
[0020] Fig. 2 is a diagram showing an example of the state in which the left controller 3 and the right controller 4 are detached from the main unit 2. As shown in Figs. 1 and 2, the left controller 3 and the right controller 4 are detachable from the main unit 2. Note that, below, the left controller 3 and the right controller 4 may be collectively referred to as "controllers."
[0021] Fig. 3 is a six-sided view showing an example of the main unit 2. As shown in Fig. 3, the main unit 2 includes a substantially plate-shaped housing 11. In this embodiment, the main surface of the housing 11 (in other words, the front surface, i.e., the surface on which the display 12 is provided) is generally rectangular.
[0022] The shape and size of the housing 11 are arbitrary. As an example, the housing 11 may be of a portable size. Furthermore, the main unit 2 alone or an integrated device in which the left controller 3 and right controller 4 are attached to the main unit 2 may be a portable device. Furthermore, the main unit 2 or the integrated device may be a handheld device. Furthermore, the main unit 2 or the integrated device may be a portable device.
[0023] 3, the main unit 2 includes a display 12 provided on the main surface of the housing 11. The display 12 displays images generated by the main unit 2. In this embodiment, the display 12 is a liquid crystal display (LCD). However, the display 12 may be any type of display device.
[0024] The main device 2 also includes a touch panel 13 on the screen of the display 12. In this embodiment, the touch panel 13 is of a type that allows multi-touch input (for example, a capacitance type). However, the touch panel 13 may be of any type, and may be of a type that allows single-touch input (for example, a resistive type).
[0025] The main unit 2 is provided with a speaker (i.e., speaker 88 shown in FIG. 6) inside the housing 11. As shown in FIG. 3, speaker holes 11a and 11b are formed on the main surface of the housing 11. The output sound of the speaker 88 is output from these speaker holes 11a and 11b, respectively.
[0026] The main unit 2 also has a left terminal 17, which is a terminal for the main unit 2 to communicate with the left controller 3 via a wired connection, and a right terminal 21, which is a terminal for the main unit 2 to communicate with the right controller 4 via a wired connection.
[0027] As shown in FIG. 3, the main unit 2 includes a slot 23. The slot 23 is provided on the upper side of the housing 11. The slot 23 has a shape that allows a predetermined type of storage medium to be inserted therein. The predetermined type of storage medium is, for example, a storage medium (e.g., a dedicated memory card) dedicated to the game system 1 and the same type of information processing device. The predetermined type of storage medium is used, for example, to store data used by the main unit 2 (e.g., application save data, etc.) and / or programs executed by the main unit 2 (e.g., application programs, etc.). The main unit 2 also includes a power button 28.
[0028] The main unit 2 has a lower terminal 27. The lower terminal 27 is a terminal through which the main unit 2 communicates with the cradle. In this embodiment, the lower terminal 27 is a USB connector (more specifically, a female connector). When the all-in-one device or the main unit 2 alone is placed on the cradle, the game system 1 can display images generated and output by the main unit 2 on a stationary monitor. In this embodiment, the cradle also has the function of charging the all-in-one device or the main unit 2 alone that is placed on it. The cradle also has the function of a hub device (specifically, a USB hub).
[0029] FIG. 4 is a six-sided view showing an example of the left controller 3. As shown in FIG. 4, the left controller 3 includes a housing 31. In this embodiment, the housing 31 has a vertically long shape, that is, a shape that is long in the up-down direction (i.e., the y-axis direction shown in FIGS. 1 and 4). The left controller 3 can also be held in a vertically long orientation when detached from the main unit 2. The housing 31 has a shape and size that allows it to be held in one hand, particularly the left hand, when held in a vertically long orientation. The left controller 3 can also be held in a horizontally long orientation. When the left controller 3 is held in a horizontally long orientation, it may be held with both hands.
[0030] The left controller 3 includes an analog stick 32. As shown in FIG. 4, the analog stick 32 is provided on the main surface of the housing 31. The analog stick 32 can be used as a direction input unit that can input directions. By tilting the analog stick 32, the user can input a direction corresponding to the tilt direction (and input a magnitude corresponding to the tilt angle). Note that instead of an analog stick, the left controller 3 may be equipped with a cross key or a slide stick that can perform slide inputs as a direction input unit. In this embodiment, input can be made by pressing the analog stick 32.
[0031] The left controller 3 is equipped with various operation buttons. The left controller 3 is equipped with four operation buttons 33-36 (specifically, a right button 33, a down button 34, an up button 35, and a left button 36) on the main surface of the housing 31. The left controller 3 also is equipped with a record button 37 and a - (minus) button 47. The left controller 3 is equipped with a first L button 38 and a ZL button 39 on the upper left of the side of the housing 31. The left controller 3 is also equipped with a second L button 43 and a second R button 44 on the side of the housing 31 that is attached to the main unit 2. These operation buttons are used to issue instructions according to various programs (for example, OS programs and application programs) executed on the main unit 2.
[0032] The left controller 3 also includes a terminal 42 for wired communication between the left controller 3 and the main unit 2.
[0033] FIG. 5 is a six-sided view showing an example of the right controller 4. As shown in FIG. 5, the right controller 4 includes a housing 51. In this embodiment, the housing 51 has a vertically long shape, that is, a shape that is long in the up-down direction. The right controller 4 can also be held in a vertically long orientation when detached from the main unit 2. The housing 51 has a shape and size that allows it to be held in one hand, particularly the right hand, when held in a vertically long orientation. The right controller 4 can also be held in a horizontally long orientation. When the right controller 4 is held in a horizontally long orientation, it may be held with both hands.
[0034] Like the left controller 3, the right controller 4 is equipped with an analog stick 52 as a directional input unit. In this embodiment, the analog stick 52 has the same configuration as the analog stick 32 of the left controller 3. The right controller 4 may also be equipped with a cross key or a slide stick capable of slide input, instead of an analog stick. Like the left controller 3, the right controller 4 is equipped with four operation buttons 53-56 (specifically, an A button 53, a B button 54, an X button 55, and a Y button 56) on the main surface of the housing 51. The right controller 4 is also equipped with a + (plus) button 57 and a home button 58. The right controller 4 is also equipped with a first R button 60 and a ZR button 61 on the upper right side of the housing 51. Like the left controller 3, the right controller 4 is also equipped with a second L button 65 and a second R button 66.
[0035] The right controller 4 also includes a terminal 64 for wired communication between the right controller 4 and the main unit 2.
[0036] Fig. 6 is a block diagram showing an example of the internal configuration of main unit 2. In addition to the configuration shown in Fig. 3, main unit 2 includes components 81-85, 87, 88, 91, 97, and 98 shown in Fig. 6. Some of these components 81-85, 87, 88, 91, 97, and 98 may be mounted on an electronic circuit board as electronic components and housed within housing 11.
[0037] The main unit 2 includes a processor 81. The processor 81 is an information processing unit that executes various types of information processing executed in the main unit 2, and may be composed of, for example, only a CPU (Central Processing Unit), or may be composed of an SoC (System-on-a-chip) that includes multiple functions such as a CPU function and a GPU (Graphics Processing Unit) function. The processor 81 executes various types of information processing by executing an information processing program (for example, a game program) stored in a storage unit (specifically, an internal storage medium such as flash memory 84, or an external storage medium inserted into slot 23, etc.).
[0038] The main device 2 includes a flash memory 84 and a DRAM (Dynamic Random Access Memory) 85 as examples of internal storage media built into the main device 2. The flash memory 84 and the DRAM 85 are connected to the processor 81. The flash memory 84 is a memory used primarily to store various types of data (which may be programs) saved in the main device 2. The DRAM 85 is a memory used to temporarily store various types of data used in information processing.
[0039] The main device 2 includes a slot interface (hereinafter abbreviated as "I / F") 91. The slot I / F 91 is connected to the processor 81. The slot I / F 91 is connected to the slot 23, and reads and writes data from and to a predetermined type of storage medium (e.g., a dedicated memory card) inserted into the slot 23 in accordance with instructions from the processor 81.
[0040] The processor 81 reads and writes data from and to the flash memory 84, DRAM 85, and the above-mentioned storage media as appropriate, to execute the above-mentioned information processing.
[0041] The main unit 2 includes a network communication unit 82. The network communication unit 82 is connected to the processor 81. The network communication unit 82 communicates with external devices via a network (specifically, wireless communication). In this embodiment, the network communication unit 82 connects to a wireless LAN and communicates with external devices using a method conforming to the Wi-Fi standard as a first communication mode. The network communication unit 82 also performs wireless communication with other main units 2 of the same type using a predetermined communication method (e.g., communication using a proprietary protocol or infrared communication) as a second communication mode. Note that wireless communication using the second communication mode enables wireless communication with other main units 2 located within a closed local network area, and realizes a function that enables so-called "local communication," in which data is transmitted and received by direct communication between multiple main units 2.
[0042] The main unit 2 is equipped with a controller communication unit 83. The controller communication unit 83 is connected to the processor 81. The controller communication unit 83 performs wireless communication with the left controller 3 and / or right controller 4. Any communication method may be used between the main unit 2 and the left controller 3 and right controller 4, but in this embodiment, the controller communication unit 83 performs communication with the left controller 3 and right controller 4 in accordance with the Bluetooth (registered trademark) standard.
[0043] The processor 81 is connected to the left terminal 17, right terminal 21, and lower terminal 27. When performing wired communication with the left controller 3, the processor 81 transmits data to the left controller 3 via the left terminal 17 and receives operation data from the left controller 3 via the left terminal 17. When performing wired communication with the right controller 4, the processor 81 transmits data to the right controller 4 via the right terminal 21 and receives operation data from the right controller 4 via the right terminal 21. When performing wired communication with the right controller 4, the processor 81 transmits data to the cradle via the lower terminal 27. As described above, in this embodiment, the main unit 2 can perform both wired and wireless communication with the left controller 3 and the right controller 4. When an integrated device in which the left controller 3 and the right controller 4 are attached to the main unit 2 or the main unit 2 alone is attached to the cradle, the main unit 2 can output data (e.g., image data and audio data) to a stationary monitor or the like via the cradle.
[0044] Here, the main unit 2 can communicate simultaneously (in other words, in parallel) with multiple left controllers 3. The main unit 2 can also communicate simultaneously (in other words, in parallel) with multiple right controllers 4. Therefore, multiple users can simultaneously input to the main unit 2 using their own sets of left controllers 3 and right controllers 4. For example, a first user can input to the main unit 2 using a first set of left controllers 3 and right controllers 4, while a second user can simultaneously input to the main unit 2 using a second set of left controllers 3 and right controllers 4.
[0045] The display 12 is also connected to the processor 81. The processor 81 displays on the display 12 an image generated (for example, by executing the above-described information processing) and / or an image acquired from the outside.
[0046] The main unit 2 includes a codec circuit 87 and speakers (specifically, a left speaker and a right speaker) 88. The codec circuit 87 is connected to the speakers 88 and the audio input / output terminal 25, and is also connected to the processor 81. The codec circuit 87 is a circuit that controls the input and output of audio data to and from the speakers 88 and the audio input / output terminal 25.
[0047] The main device 2 includes a power control unit 97 and a battery 98. The power control unit 97 is connected to the battery 98 and the processor 81. Although not shown, the power control unit 97 is also connected to each part of the main device 2 (specifically, each part that receives power from the battery 98, the left terminal 17, and the right terminal 21). The power control unit 97 controls the power supply from the battery 98 to each of the above parts based on instructions from the processor 81.
[0048] Furthermore, battery 98 is connected to lower terminal 27. When an external charging device (e.g., a cradle) is connected to lower terminal 27 and power is supplied to main device 2 via lower terminal 27, battery 98 is charged with the supplied power.
[0049] Figure 7 is a block diagram showing an example of the internal configuration of the main unit 2, left controller 3, and right controller 4. Note that details of the internal configuration of the main unit 2 are omitted in Figure 7 because they are shown in Figure 6.
[0050] The left controller 3 is equipped with a communication control unit 101 that communicates with the main unit 2. As shown in FIG. 7 , the communication control unit 101 is connected to each component, including the terminal 42. In this embodiment, the communication control unit 101 can communicate with the main unit 2 both via wired communication via the terminal 42 and via wireless communication without using the terminal 42. The communication control unit 101 controls the method of communication between the left controller 3 and the main unit 2. That is, when the left controller 3 is attached to the main unit 2, the communication control unit 101 communicates with the main unit 2 via the terminal 42. When the left controller 3 is detached from the main unit 2, the communication control unit 101 communicates wirelessly with the main unit 2 (specifically, with the controller communication unit 83). Wireless communication between the controller communication unit 83 and the communication control unit 101 is performed in accordance with, for example, the Bluetooth (registered trademark) standard.
[0051] The left controller 3 also includes a memory 102, such as a flash memory. The communication control unit 101 is configured, for example, by a microcomputer (also called a microprocessor), and executes firmware stored in the memory 102 to perform various processes.
[0052] The left controller 3 has buttons 103 (specifically, buttons 33-39, 43, 44, and 47). The left controller 3 also has an analog stick (referred to as "stick" in FIG. 7) 32. Each button 103 and analog stick 32 repeatedly outputs information related to operations performed on the button 103 and analog stick 32 to the communication control unit 101 at appropriate timing.
[0053] The communication control unit 101 acquires information related to the input (specifically, information related to the operation or the detection results from the sensor) from each input unit (specifically, each button 103 and analog stick 32). The communication control unit 101 transmits operation data including the acquired information (or information obtained by performing a predetermined process on the acquired information) to the main unit 2. The operation data is repeatedly transmitted once every predetermined time. The interval at which the information related to the input is transmitted to the main unit 2 may or may not be the same for each input unit.
[0054] By transmitting the above operation data to the main unit 2, the main unit 2 can obtain the input made to the left controller 3. In other words, the main unit 2 can determine the operation of each button 103 and analog stick 32 based on the operation data.
[0055] The left controller 3 is equipped with a power supply unit 108. In this embodiment, the power supply unit 108 has a battery and a power control circuit. Although not shown, the power control circuit is connected to the battery and to each part of the left controller 3 (specifically, each part that receives power from the battery).
[0056] As shown in FIG. 7, the right controller 4 is equipped with a communication control unit 111 that communicates with the main unit 2. The right controller 4 also has a memory 112 that is connected to the communication control unit 111. The communication control unit 111 is connected to each component, including the terminal 64. The communication control unit 111 and memory 112 have the same functions as the communication control unit 101 and memory 102 of the left controller 3. Therefore, the communication control unit 111 can communicate with the main unit 2 both via wired communication via the terminal 64 and via wireless communication that does not use the terminal 64 (specifically, communication in accordance with the Bluetooth (registered trademark) standard), and controls the method of communication between the right controller 4 and the main unit 2.
[0057] The right controller 4 has input units similar to those of the left controller 3. Specifically, it has buttons 113 and an analog stick 52. These input units have the same functions as those of the left controller 3 and operate in the same manner.
[0058] The right controller 4 is equipped with a power supply unit 118. The power supply unit 118 has the same functions as the power supply unit 108 of the left controller 3 and operates in the same manner.
[0059] [2. Overview of processing in the game system] The following describes a game image generation process executed by the game system 1. In this embodiment, the game system 1 places objects in a three-dimensional virtual space, which is the game space, and generates and displays a game image showing the virtual space in which shadows are cast on the objects. FIG. 8 is a diagram showing an example of a game image. As shown in FIG. 8, in this embodiment, a predetermined type of object placed in the virtual space is displayed with a shadow cast (i.e., the shadowed area is darkened). In the example shown in FIG. 8, shadows 203 and 204 are cast on two objects 201 and 202, respectively. In this embodiment, the predetermined type of object includes a player character operated by a player and a non-player character whose action is controlled by the game system 1. The game system 1 may cast a shadow on any object placed in the virtual space, or may cast a shadow on all objects.
[0060] FIG. 9 is a diagram showing an example of a predetermined type of object placed in a virtual space. In this embodiment, the predetermined type of object has a flat shape, such as object 201 shown in FIG. 9. Specifically, object 201 has a main body portion (specifically, a portion including a head, torso, and legs) 211, a right arm portion 212, and a left arm portion 213. Each of portions 211-213 has a planar shape. Note that while FIG. 9 shows each of portions 211-213 as having a slight thickness, each of portions 211-213 may not have a thickness. Also, in this embodiment, each of portions 211-213 is disposed with a shift in the thickness direction (see FIG. 9). Therefore, object 201 as a whole has a slight thickness. Note that in other embodiments, the object may have a planar shape as a whole. Also, in other embodiments, the object may have a non-flat shape.
[0061] In this embodiment, when casting shadows on a plurality of predetermined types of objects placed in a virtual space, the game system 1 executes a process of calculating a shadow area for each object. This process will be described below with reference to FIGS. 10 to 16.
[0062] In this embodiment, the game system 1 sets a subspace for each of the predetermined types of objects, and generates a shadow map for each object (hereinafter referred to as a "partial shadow map") using the subspace. Fig. 10 is a diagram showing an example of the subspace set for each object. In the example shown in Fig. 10, a subspace 221 is set for object 201, and a subspace 222 is set for object 202.
[0063] A subspace is set so as to contain the corresponding object (i.e., the object to be shadowed using that subspace) (see FIG. 10). The size of the subspace may be any size that contains the corresponding object. As long as the subspace contains the corresponding object, there is no need to set a large subspace that contains, for example, multiple objects. This makes it possible to prevent the partial shadow map from becoming too large, and to prevent an increase in the memory area used for the partial shadow map.
[0064] In this embodiment, the subspace has a rectangular parallelepiped shape with sides aligned with the light ray direction of the light source (more specifically, sides parallel to the light ray direction) (see FIG. 10). As will be described in detail later, by making the subspace have the above shape, calculations for generating a partial shadow map for the range corresponding to the subspace become easier. In this embodiment, the light source for casting shadows is a parallelepiped light source. Therefore, the subspaces set for each object have the same orientation (see FIG. 10). The shape of the subspace is arbitrary, and in other embodiments, it may be a shape other than a rectangular parallelepiped.
[0065] FIG. 11 is a diagram showing an example of a subspace in a modified example of this embodiment. In the modified example shown in FIG. 11, a point light source is used as a light source for casting shadows. In this case, the game system 1 may set frustum-shaped subspaces 225 and 226 for each of the objects 201 and 202, respectively, based on the position of the point light source. Specifically, the subspaces 225 and 226 are frustums obtained by removing, from a square pyramid whose apex is the position of the point light source, a square pyramid with the same apex but reduced similarly to the square pyramid. When a point light source is used, a partial shadow map for each object can be generated by setting the above subspace.
[0066] In this embodiment, a partial shadow map is generated for each subspace based on the subspace (see FIG. 10). The partial shadow map indicates the depth (in other words, the depth) of each position within the subspace when viewed from the light ray direction. Since a parallel light source is used in this embodiment, the depth is calculated as the distance in the light ray direction from a predetermined reference position (i.e., the position of the light source) to the position in question. Note that the reference position may be any position.
[0067] The depth of the partial shadow map is calculated only for the object corresponding to the subspace. That is, for a position in the partial shadow map where an object exists when viewed from the light ray direction, the depth is calculated as the distance in the light ray direction from a predetermined reference position to the position of the object. Furthermore, for a position in the partial shadow map where no object exists when viewed from the light ray direction, the depth is set to the maximum value. Therefore, in this embodiment, even if another object is located in front of or behind the object when viewed from the light ray direction, the depth of the partial shadow map is calculated without taking the other object into consideration.
[0068] The game system 1 generates a partial shadow map for each object for which a subspace is set. In this embodiment, after generating a partial shadow map for one object, the game system 1 performs a process of updating the shadow buffer based on the partial shadow map (details of which will be described later), and then generates a partial shadow map for another object. In other words, the game system 1 repeatedly performs the process of generating a partial shadow map and the process of updating the shadow buffer based on the partial shadow map for each object. This allows only one partial shadow map to be stored in the memory area at the same time, thereby conserving memory space for the partial shadow map. In other embodiments, the order in which the process of generating a partial shadow map and the process of updating the shadow buffer are performed is arbitrary, and the game system 1 may generate a partial shadow map for each object and then perform the process of updating the shadow buffer based on each partial shadow map.
[0069] The game system 1 updates the shadow buffer based on the generated partial shadow map. The shadow buffer is a buffer that stores the shadow density (in other words, brightness) for each pixel of the game image. The game system 1 calculates the shadow density of each pixel in the shadow buffer that corresponds to a subspace (i.e., a pixel whose position within the subspace is displayed) using the partial shadow map for that subspace. In other words, in the shadow buffer update process based on one partial shadow map, the shadow density is updated for pixels that correspond to an area within the subspace that corresponds to that partial shadow map.
[0070] In this embodiment, the shadow intensity is calculated using a distributed shadow map technique. In this distributed shadow map technique, the probability that a position corresponding to a pixel will be in shadow is expressed using Chebyshev's inequality, and the shadow intensity is calculated so that the intensity corresponds to this probability (i.e., the shadow will be darker in areas with a high probability of being in shadow, and lighter in areas with a low probability of being in shadow). Specifically, in this embodiment, a variable P indicating the shadow intensity at a pixel is calculated according to the following equation (1). P=σ 2 / {σ 2 +(tE(x)) 2} …(1) Details will be described later, but the smaller the value of the variable P, the deeper (ie, darker) the shadow.
[0071] FIG. 12 is a diagram showing an example of the positional relationship between a light source, an object, and a surface onto which the shadow of the object is cast (for example, the ground in a virtual space). The variable t in the above equation (1) is the depth of a position corresponding to the pixel (for example, position A shown in FIG. 12). Here, the depth in the above equation (1) is the depth when the light source is used as a reference (that is, the depth from the position of the light source to the position corresponding to the pixel). The variable t is obtained by converting the depth d based on the virtual camera into the depth based on the light source (see FIG. 12). Note that the depth d based on the virtual camera is stored in a depth buffer. The depth value stored in the depth buffer may be calculated by a conventional method.
[0072] The variable x in the above formula (1) is the depth at the position corresponding to the pixel, which is stored in the partial shadow map. That is, the variable x is the depth when the light source is used as the reference, and if an object exists between the position of the light source and the position corresponding to the pixel (for example, position A shown in FIG. 12), the variable x is the distance from the position of the light source to the position of the object (for example, position B shown in FIG. 12).
[0073] The function E(x) in the above equation (1) represents a value obtained by applying a predetermined smoothing filter to the depth x. 2 is the variance of the depth at the position corresponding to the pixel (more specifically, the local variance around the pixel). 2 is calculated by the following formula (2): σ 2 = E(x 2 )-E(x) 2 …(2) In this embodiment, the function E(x) in the above equations (1) and (2) is a function that represents the result of applying a smoothing filter to the depth, but in other embodiments, the function E(x) may be a function that represents the average value of the depth (for example, the average value of the depth for pixels within a predetermined range including the pixel in question).
[0074] Here, if an object exists on the line from the light source to the pixel in question, the variable t will be greater than E(x) (see FIG. 12). In this case, the pixel in question will be a pixel where the object's shadow is drawn. On the other hand, if no object exists on the line from the light source to the pixel in question, the variable t will be equal to or less than E(x). In this case, the pixel in question will be a pixel where the object's shadow is not drawn. Therefore, if the variable t is greater than E(x), the game system 1 calculates the variable P using the above formula (1). On the other hand, if the variable t is equal to or less than E(x), the game system 1 does not calculate the variable P. In this case, the value of the pixel in the shadow buffer will not be updated. Note that in another embodiment, the game system 1 may compare the variable t with the variable x instead of comparing the variable t with E(x).
[0075] FIG. 13 is a diagram showing an example of an object and an area cast in shadow by the object. In FIG. 13, an area 231 of the ground in the virtual space is assumed to be an area where the shadow of the object 201 is drawn. Here, the variable P calculated by the above formula (1) is a variable indicating that the larger the value, the brighter the image (in other words, the lighter the shadow). According to the above formula (1), at a position near the edge of the area 231 cast in shadow by the object 201, the variance σ 2 Since the value of variable P increases, the variance σ 2The reason why becomes large is that the surroundings of the position include positions where the variable x is the depth from the light source to the object (i.e., positions where the shadow is cast) and positions where the variable x is the depth from the light source to the ground (i.e., positions where the shadow is not cast), and therefore the variance of the value of the variable x becomes large. As described above, the shadow becomes lighter at positions near the edge of the region 231 where the shadow of the object 201 is cast (see FIG. 13). On the other hand, at positions inside the region 231 away from the edge, the variable x becomes the depth from the light source to the object around the position, and therefore the variance σ 2 becomes smaller, the value of the variable P becomes smaller. Therefore, the shadow becomes darker at positions inside the region 231, away from the edge (see FIG. 13). As described above, the distributed shadow map technique blurs the outline of the shadow, making it less likely that jagged edges will occur at the edge of the shadow, and making it possible to display a natural-looking shadow.
[0076] In addition, with the distributed shadow map technique, the edge of a shadow area of an object tends to be lighter (i.e., brighter). Therefore, when the shadows of two objects overlap, a phenomenon known as light bleeding may occur in which a portion of the edge that should be dark appears bright. FIG. 14 is a diagram illustrating an example of a game image in which the shadows of two objects overlap. The example illustrated in FIG. 14 illustrates a situation in which the shadow 203 of object 201 and the shadow 204 of object 202 overlap. In such a situation, the edge of the shadow 204 area may appear bright, and the outline of the shadow 204 may appear bright at the boundary between the shadows 203 and 204, resulting in an unnatural display. For example, light bleeding may occur when a single shadow map is generated for the entire rendering range in the virtual space and the shadow density is calculated using the distributed shadow map technique using that shadow map (as opposed to generating multiple partial shadow maps for each object as in this embodiment). In this embodiment, in order to reduce the possibility of the above-described unnatural shadow being displayed, the game system 1 performs the following processing.
[0077] Fig. 15 is a diagram showing an example of updating the shadow buffer, in which a shadow density value based on a partial shadow map for a first object 201 is stored in the shadow buffer, and then the shadow buffer is updated using a partial shadow map for a second object 202.
[0078] The state shown in Figure 15 (a) is the state before the shadow buffer is updated using the partial shadow map for the second object 202, i.e., the state in which only the shadow 241 of the first object 201 is drawn in the shadow buffer.
[0079] When the shadow buffer is updated using the partial shadow map for the second object 202, it is determined whether to update the shadow intensity for each pixel in the shadow buffer within region 242 corresponding to the subspace of that object 202. Specifically, the game system 1 does not update pixels within region 242 that are outside the shadow region of object 202 (i.e., pixels where variable t is equal to or smaller than E(x)), as described above. Furthermore, for pixels within region 242 that are within the shadow region of object 202 (i.e., pixels where variable t is greater than E(x)), the game system 1 updates the value of the shadow buffer if the variable P calculated according to the above formula (1) is smaller than the value stored in the shadow buffer (i.e., if the calculated shadow intensity is greater than the intensity stored in the shadow buffer). Therefore, if a pixel in the shadow 241 of the first object 201 is located within the shadow 243 of the second object 202, the value of that pixel is updated if the darkness in the shadow 243 is darker than the darkness in the shadow 241, and the value of that pixel is not updated if the darkness in the shadow 243 is lighter than the darkness in the shadow 241. According to the above, for example, even if the shadow is calculated to be light at a pixel on the edge of the shadow 243 of the second object 202, if the value stored in the shadow buffer (i.e., the value indicating the darkness of the shadow 241 of the first object 201) indicates a dark shadow, the value indicating a dark shadow remains stored in that pixel.
[0080] According to the above, it is possible to reduce the risk of light bleeding occurring when the shadows of two objects are displayed overlapping each other. FIG. 16 is a diagram showing an example of a game image when the shadows of two objects are displayed overlapping each other, generated by processing in this embodiment. In the example shown in FIG. 16, unlike the example shown in FIG. 14, the boundary between the shadow 203 of object 201 and the shadow 204 of object 202 is displayed dark. In this way, in this embodiment, the shadow buffer is updated for each partial shadow map, and an update is performed when the shadow is darker than the value stored in the shadow buffer, thereby reducing the risk of light bleeding occurring.
[0081] Even when multiple objects are included in one subspace, if the depth from the light source is significantly different between a certain position and its surrounding positions, the above-mentioned variance σ 2 As a result of increasing σ, there is a risk of light bleeding occurring at that position. In this regard, in this embodiment, as described above, the depth of the partial shadow map is calculated only for the object corresponding to the partial space. This also reduces the possibility that the difference between the depths in the partial shadow map will be large, so the variance σ 2 As a result, the risk of light bleeding occurring can be reduced.
[0082] In this embodiment, the predetermined type of object to be shaded has a flat shape. Therefore, the depth in the partial shadow map changes continuously, or the depth does not change significantly between a certain position and its surrounding positions. Therefore, the variance σ 2is unlikely to become large. In this embodiment, this also reduces the risk of light bleeding. Furthermore, when a flat object is oriented nearly parallel to the light ray direction, the amount of change in depth in the partial shadow map becomes large. However, in this embodiment, since the object is flat, the shadow becomes thin in this state, and it can be said that the problem of the shadow looking unnatural is unlikely to occur.
[0083] The game system 1 updates the shadow buffer by sequentially updating the shadow buffer using a partial shadow map for each object.The updated shadow buffer is then used to perform lighting processing on the game image drawn in the frame buffer, thereby generating a game image with shadows.The specific details of the lighting processing are arbitrary, and any conventional method may be used.
[0084] [3. Specific examples of processing in information processing systems / game systems] Next, a specific example of information processing in the game system 1 will be described with reference to FIGS.
[0085] FIG. 17 is a diagram showing an example of a storage area that stores various data used for information processing in the game system 1. Each storage area shown in FIG. 17 is provided in a storage medium accessible by the main unit 2 (for example, the flash memory 84, the DRAM 85, and / or a memory card inserted in the slot 23). As shown in FIG. 17, the storage medium is provided with a game program area in which a game program is stored. The game program is for executing the game processing in this embodiment (specifically, the game processing shown in FIG. 18). The storage medium is also provided with a frame buffer, a depth buffer, a G buffer, a shadow buffer, and a partial shadow map area (see FIG. 17).
[0086] 18 is a flowchart showing an example of the flow of game processing executed by the game system 1. The execution of the game processing is started, for example, when the game is started in response to an instruction from the player during execution of the game program.
[0087] In the present embodiment, the processor 81 of the main unit 2 executes the game program stored in the game system 1 to perform the processing of each step shown in FIG. 18. However, in other embodiments, some of the processing of each step may be performed by a processor (e.g., a dedicated circuit) other than the processor 81. Furthermore, if the game system 1 is capable of communicating with another information processing device (e.g., a server), some of the processing of each step shown in FIG. 18 may be performed in the other information processing device. Furthermore, the processing of each step shown in FIG. 18 is merely an example, and the processing order of each step may be reversed, or another process may be performed in addition to (or instead of) the processing of each step, as long as similar results are obtained.
[0088] 18 using a memory (for example, DRAM 85). That is, the processor 81 stores information (in other words, data) obtained by each processing step in the memory, and when using the information in a subsequent processing step, reads the information from the memory and uses it.
[0089] 18, processor 81 obtains the operation data indicating an instruction from the player. That is, processor 81 obtains the operation data received from each controller via controller communication unit 83 and / or each of terminals 17 and 21. Following step S1, the process of step S2 is executed.
[0090] In step S2, processor 81 controls the actions of objects placed in the virtual space. For example, processor 81 controls the actions of a player character based on the operation data acquired in step S1, or controls the actions of non-player characters in accordance with an algorithm defined in the game program. Following step S2, the process of step S3 is executed.
[0091] In step S3, processor 81 executes rendering processing including processing for applying shadows to predetermined types of objects. In the rendering processing in step S3, rendering related to the predetermined types of objects and the like is performed in the virtual space reflecting the processing result of step S2. Hereinafter, the rendering processing in step S3 will be described in detail with reference to FIG. 19.
[0092] Fig. 19 is a sub-flowchart showing an example of the detailed flow of the rendering process in step S3 shown in Fig. 18. In the rendering process, first in step S11, processor 81 specifies an object to be drawn. In step S11, an object that has not yet been processed in the current processing loop of steps S11-S16 is specified. Following step S11, the process of step S12 is executed.
[0093] In step S12, processor 81 designates polygons to be rendered from among the polygons of the object designated in step S11. In step S12, polygons that have not yet been processed in the current processing loop of steps S12-S15 are designated. Following step S12, the processing of step S13 is executed.
[0094] In step S13, processor 81 performs a depth test on the polygon specified in step S12 and updates the depth buffer. That is, if the depth value for each pixel stored in the depth buffer is greater than the depth value of the polygon at the position of that pixel, processor 81 updates the depth buffer to the depth value of that polygon. Following step S12, the processing of step S13 is executed.
[0095] In step S14, the processor 81 updates the G buffer (geometry buffer) for the polygon specified in step S12. That is, the processor 81 writes information used for drawing the pixels corresponding to the polygon (for example, information on the position, normal, color, etc. of the polygon) into the G buffer. Following step S14, the process of step S15 is executed.
[0096] In step S15, processor 81 determines whether the series of processes in steps S12-S14 has been completed for each polygon of the object specified in step S11. If the determination result in step S15 is positive, the process in step S16 is executed. On the other hand, if the determination result in step S15 is negative, the process in step S12 is executed again.
[0097] In step S16, processor 81 determines whether the series of processes in steps S11-S15 has been completed for each object to be rendered. If the determination result in step S16 is positive, the process in step S17 is executed. On the other hand, if the determination result in step S16 is negative, the process in step S11 is executed again.
[0098] In step S17, processor 81 executes a shadow buffer update process to update the shadow buffer. The shadow buffer update process is a process for updating the values in the shadow buffer to indicate the shadows of the predetermined types of objects. The shadow buffer update process in step S17 will be described in detail below with reference to FIG. 20.
[0099] Figure 20 is a sub-flowchart showing an example of the detailed flow of the shadow buffer update process in step S17 shown in Figure 19. In the shadow buffer update process, first in step S21, processor 81 specifies an object for which a shadow is to be drawn. In step S21, an object of a predetermined type that has not yet been the target of processing in the current processing loop of steps S21-S29 is specified. Following step S21, the process of step S22 is executed.
[0100] In step S22, processor 81 generates a partial shadow map for the object specified in step S21. That is, processor 81 sets the above-mentioned subspace for the object (see FIG. 10), and generates a partial shadow map based on the set subspace. Note that in this embodiment, if a partial shadow map indicating values relating to a subspace other than the set subspace is stored in the above-mentioned partial shadow map area, the partial shadow map area is overwritten and updated to contain the contents of the newly generated partial shadow map. Following step S22, the process of step S23 is executed.
[0101] In step S23, processor 81 executes distributed shadow map processing to calculate the shadow density using the distributed shadow map method described above. In the distributed shadow map processing, the shadow density is calculated for each pixel of the object specified in step S21, and the shadow buffer is updated according to the calculated shadow density. The distributed shadow map processing in step S23 will be described in detail below with reference to FIG. 21.
[0102] Figure 21 is a sub-flowchart showing an example of the detailed flow of the distributed shadow map processing in step S23 shown in Figure 20. In the distributed shadow map processing, first in step S31, the processor 81 designates one pixel to be processed from among the pixels in the shadow buffer. In step S31, a pixel that has not yet been the target of processing in the current processing loop of steps S31-S38 is designated. Following step S31, the processing of step S32 is executed.
[0103] In step S32, the processor 81 determines whether the pixel designated in step S31 corresponds to the subspace set for the object designated in step S21. Note that a pixel corresponding to a subspace is a pixel indicating a position within the subspace, or a pixel such that the subspace is located in front of the position indicated by the pixel when viewed from the light source direction. If the determination result in step S32 is positive, the process proceeds to step S33. On the other hand, if the determination result in step S32 is negative, the process proceeds to step S38, which will be described later.
[0104] In step S33, the processor 81 calculates the depth based on the light source for the pixel specified in step S31. That is, the processor 81 converts the depth based on the virtual camera (d shown in FIG. 12) stored in the depth buffer into the depth based on the light source (t shown in FIG. 12). Following step S33, the process of step S34 is executed.
[0105] In step S34, the processor 81 determines whether the depth t calculated in step S33 is greater than E(x) based on the depth x stored in the partial shadow map. If the determination result in step S34 is positive, the process proceeds to step S35. On the other hand, if the determination result in step S34 is negative, the process proceeds to step S38, which will be described later.
[0106] In step S35, processor 81 calculates the shadow density for the pixel specified in step S31. Specifically, processor 81 calculates variable P indicating the shadow density in accordance with the above equation (1). Following step S35, the process of step S36 is executed.
[0107] In step S36, processor 81 determines whether the value indicating the shadow density calculated in step S35 for the pixel designated in step S31 is smaller than the value for that pixel stored in the shadow buffer (i.e., whether the calculated shadow density indicates a value greater than the density stored in the shadow buffer). If the determination result in step S36 is positive, the process proceeds to step S37. On the other hand, if the determination result in step S36 is negative, the process proceeds to step S38, which will be described later.
[0108] In step S37, the processor 81 updates the value stored in the shadow buffer for the pixel designated in step S31 to the value calculated in step S35. After step S37, the process proceeds to step S38.
[0109] In step S38, the processor 81 determines whether the series of processes in steps S31-S37 has been completed for each pixel in the shadow buffer. If the determination result in step S38 is negative, the process of step S31 is executed again. On the other hand, if the determination result in step S38 is positive, the processor 81 ends the distributed shadow map process.
[0110] Returning to the explanation of FIG. 20, after the distributed shadow map process (step S23), the process of step S24 is executed. In step S24, the processor 81 determines whether or not the series of processes of steps S21-S23 has been completed for each object for which a shadow is to be drawn. If the determination result of step S24 is negative, the process of step S21 is executed again. On the other hand, if the determination result of step S24 is positive, the processor 81 ends the shadow buffer update process.
[0111] Returning to the explanation of FIG. 19, after the shadow buffer update process (step S17), the process of step S18 is executed. In step S18, the processor 81 executes lighting process. In the lighting process, the pixel value of each pixel is calculated taking into account the light source in the virtual space. Hereinafter, the lighting process of step S18 will be described in detail with reference to FIG. 22.
[0112] Fig. 22 is a sub-flowchart showing an example of the detailed flow of the lighting process in step S18 shown in Fig. 19. In the lighting process, first, in step S41, processor 81 specifies a pixel from among the pixels in the frame buffer, the pixel value of which is to be calculated. In step S41, a pixel that has not yet been processed in the current processing loop of steps S41-S44 is specified. Following step S41, the processing of step S42 is executed.
[0113] In step S42, the processor 81 calculates the pixel value of the pixel specified in step S41 based on the depth buffer and G buffer. The pixel value calculated here is the pixel value before the shadow cast by the shadow buffer is reflected. If a light source other than the light source corresponding to the subspace of a predetermined type of object (in this embodiment, the directional light source described above) is set in the virtual space, the processor 81 may calculate the pixel value taking the other light source into account in the processing of step S42. The processor 81 updates the frame buffer to store the calculated pixel value. Following step S42, the processing of step S43 is executed.
[0114] In step S43, processor 81 performs shadowing, which applies a shadow to the image in the frame buffer, based on the shadow buffer described above. That is, for the pixel specified in step S41, processor 81 calculates a pixel value that reflects the darkness of the shadow of that pixel stored in the shadow buffer, based on the pixel value calculated in step S42. Processor 81 updates the frame buffer to store the calculated pixel value. Following step S43, the process of step S44 is executed.
[0115] In step S44, the processor 81 determines whether the series of processes in steps S41-S43 has been completed for each pixel in the frame buffer. If the determination result in step S44 is negative, the process of step S41 is executed again. On the other hand, if the determination result in step S44 is positive, the processor 81 ends the lighting process. The end of the lighting process ends the rendering process shown in FIG. 19. Note that in this embodiment, the rendering process shown in FIG. 19 is performed by deferred rendering using a G buffer, but in other embodiments, the rendering process may be performed by forward rendering. That is, in this embodiment, the processor 81 performs drawing in the G buffer in the rendering process (see FIG. 19), and also performs drawing of a shadowed image in the frame buffer based on the G buffer and the shadow buffer in the lighting process (see FIG. 22). However, in other states, the processor 81 may perform drawing in the frame buffer in the rendering process, and also perform drawing of a shadow on the image in the frame buffer based on the frame buffer and the shadow buffer in the lighting process.
[0116] Returning to the explanation of FIG. 18, after the rendering process (step S3), the process of step S4 is executed. In step S4, the processor 81 executes the rendering process for an object (for example, a background) that is not drawn in the rendering process of step S3. For example, the rendering process of step S3 may be executed by deferred rendering, and the rendering process of step S4 may be executed by forward rendering. After step S4, the process of step S5 is executed.
[0117] In step S5, processor 81 executes post-processing. The specific content of the post-processing is arbitrary. Processor 81 may apply effects using a filter to the game image generated by the processing of steps S3 and S4, or adjust brightness, saturation, etc. Following step S5, the processing of step S6 is executed.
[0118] In step S6, processor 81 outputs the game image after the processing of step S5 to the display device. As a result, the game image is displayed on the display device. Note that the display device to which the game image is output may be display 12 of main unit 2, or the above-mentioned stationary monitor connected to main unit 2. Following step S6, the processing of step S7 is executed.
[0119] In step S7, processor 81 determines whether or not to end the game processing. For example, processor 81 determines to end the game when a predetermined operation input for ending the game is performed by the player. If the determination result in step S7 is negative, the processing of step S1 is executed again. Thereafter, the series of processing from steps S1 to S7 is repeatedly executed until it is determined in step S7 that the game should be ended. On the other hand, if the determination result in step S7 is positive, processor 81 ends the game processing shown in FIG. 18.
[0120] [4. Effects and Modifications of the Present Embodiment] In the above embodiment, the image processing program (for example, a game program) is configured to cause the computer of the information processing device (for example, the processor 81 of the main body device 2) to execute the following processes. A process of drawing objects in the virtual space to the frame buffer or G buffer while performing a depth test using the depth buffer (step S14). A process of setting a partial space that is a part of the virtual space and that includes each of the first type of objects for each of the first type of objects (step S22). A process of setting a virtual light source for the subspace for each of the above objects and generating a subshadow map that is a shadow map of the first type of object in the subspace based on the virtual light source (step S22). For each object, the shadow density of the first type object is determined for each pixel corresponding to the pixel within the range of the subspace based on the depth of the depth buffer and the depth of the partial shadow map (step S35). If the shadow density of the pixel is darker than the value stored in the shadow buffer that stores the shadow density, the shadow buffer is overwritten and stored (step S37). A process of drawing a shadow on the image in the frame buffer based on the frame buffer and the shadow buffer, or drawing a shadowed image on the frame buffer based on the G buffer and the shadow buffer (step S43).
[0121] According to the above configuration, by using a partial shadow map for each object, it is not necessary to generate a shadow map for the entire drawing range, which reduces the memory area required for the shadow map and the processing load on the computer.
[0122] In the above embodiment, a game program that generates a game image is used as an example of an image processing program that generates an image of a virtual space with a shadow, but the image processing program is not limited to a game program. The image processing in the above embodiment can be applied to any information processing program that generates an image showing a virtual space.
[0123] In the above embodiment, the shadow density for each pixel is calculated based on the distributed shadow map technique, but the specific method for calculating the shadow density is not limited to this, and the shadow density may be calculated using any method. Note that, according to the above embodiment, by using a partial shadow map, the above-mentioned light bleeding can be suppressed even when the distributed shadow map technique is used. Therefore, there is no need to perform additional processing to suppress light bleeding, and natural-looking shadows can be displayed.
[0124] In the above embodiment, when a process is executed using data (which means including a program) in an information processing device, part of the data required for the process may be transmitted from another information processing device different from the information processing device. In this case, the information processing device may execute the process using the data received from the other information processing device and the data stored in the information processing device itself.
[0125] In other embodiments, the information processing system may not have some of the configurations in the above embodiments, or may not execute some of the processes executed in the above embodiments. For example, in order to achieve some specific effects in the above embodiments, the information processing system may have the configurations for achieving those effects and execute the processes for achieving those effects, but may not have other configurations or may not execute other processes. [Industrial Applicability]
[0126] The above-described embodiment can be used in, for example, a game system or a game program, with the aim of reducing the processing load on a computer. [Explanation of symbols]
[0127] 1. Game System 2 Main unit 81 processors 201,201 objects 221,222 subspace
Claims
1. The computer of the information processing device For objects in virtual space, a depth test is performed using the depth buffer, and rendering is performed in the frame buffer or G buffer. For each of a plurality of first type objects among the objects, setting a partial space that is a part of the virtual space and that contains the first type object; setting a virtual light source for the subspace and generating a partial shadow map that is a shadow map of the first type object in the subspace based on the virtual light source; determining a shadow density of the first type object for each pixel corresponding to the pixel within the range of the subspace based on the depth of the depth buffer and the depth of the partial shadow map, and if the shadow density of the pixel is a shadow value that is darker than a value stored in a shadow buffer that stores shadow density, overwriting the shadow buffer and storing the shadow density; An image processing program that draws a shadow on an image in the frame buffer based on the frame buffer and the shadow buffer, or draws a shadowed image on the frame buffer based on the G buffer and the shadow buffer.
2. The computer, 2. The image processing program according to claim 1, wherein the shadow density for each pixel corresponding to the range of the subspace is determined based on a distributed shadow map technique using the depth of the depth buffer and the depth of the partial shadow map.
3. 3. The image processing program according to claim 2, wherein the first type of object is a flat-shaped object.
4. The virtual light source is a directional light source, The image processing program according to claim 1 , wherein the subspace has a rectangular parallelepiped shape having sides aligned with the direction of light from the parallel light source.
5. For objects in virtual space, a depth test is performed using the depth buffer while rendering to the frame buffer or G buffer. For each of the first type of objects, a partial space is set as a part of the virtual space, the partial space including the first type object; setting a virtual light source for the subspace and generating a partial shadow map that is a shadow map of the first type object in the subspace based on the virtual light source; determining a shadow density of the first type object for each pixel corresponding to the pixel within the range of the subspace based on the depth of the depth buffer and the depth of the partial shadow map, and if the shadow density of the pixel is a shadow value that is darker than a value stored in a shadow buffer that stores shadow density, overwriting the shadow buffer and storing the shadow density; An information processing system that draws a shadow on an image in the frame buffer based on the frame buffer and the shadow buffer, or draws a shadowed image on the frame buffer based on the G buffer and the shadow buffer.
6. 6. The information processing system according to claim 5, wherein the shadow density for each pixel corresponding to the range of the subspace is determined based on a distributed shadow map technique using the depth of the depth buffer and the depth of the partial shadow map.
7. 7. The information processing system according to claim 6, wherein the first type of object is a flat-shaped object.
8. The virtual light source is a directional light source, The information processing system according to claim 5 , wherein the subspace has a rectangular parallelepiped shape having sides aligned with the direction of light from the parallel light source.
9. For objects in virtual space, a depth test is performed using the depth buffer while rendering to the frame buffer or G buffer. For each of the first type of objects, a partial space is set as a part of the virtual space, the partial space including the first type object; setting a virtual light source for the subspace and generating a partial shadow map that is a shadow map of the first type object in the subspace based on the virtual light source; determining a shadow density of the first type object for each pixel corresponding to the pixel within the range of the subspace based on the depth of the depth buffer and the depth of the partial shadow map, and if the shadow density of the pixel is a shadow value that is darker than a value stored in a shadow buffer that stores shadow density, overwriting the shadow buffer and storing the shadow density; An information processing device that draws a shadow on an image in the frame buffer based on the frame buffer and the shadow buffer, or draws a shadowed image on the frame buffer based on the G buffer and the shadow buffer.
10. The information processing apparatus according to claim 9 , wherein the shadow density for each pixel corresponding to the range of the subspace is determined based on a distributed shadow map technique using the depth of the depth buffer and the depth of the partial shadow map.
11. The information processing apparatus according to claim 10 , wherein the first type of object is a flat-shaped object.
12. The virtual light source is a directional light source, The information processing apparatus according to claim 9 , wherein the partial space has a rectangular parallelepiped shape having sides aligned with the direction of light from the parallel light source.
13. An image processing method executed by an information processing system, comprising: The information processing system includes: For objects in virtual space, a depth test is performed using the depth buffer while rendering to the frame buffer or G buffer. For each of the first type of objects, a partial space is set as a part of the virtual space, the partial space including the first type object; setting a virtual light source for the subspace and generating a partial shadow map that is a shadow map of the first type object in the subspace based on the virtual light source; determining a shadow density of the first type object for each pixel corresponding to the pixel within the range of the subspace based on the depth of the depth buffer and the depth of the partial shadow map, and if the shadow density of the pixel is a shadow value that is darker than a value stored in a shadow buffer that stores shadow density, overwriting the shadow buffer and storing the shadow density; An image processing method for drawing a shadow on an image in the frame buffer based on the frame buffer and the shadow buffer, or drawing a shadowed image on the frame buffer based on the G buffer and the shadow buffer.
14. The image processing method according to claim 13, wherein the information processing system determines the shadow density for each pixel corresponding to the range of the subspace based on a distributed shadow map technique using the depth of the depth buffer and the depth of the partial shadow map.
15. 15. The image processing method according to claim 14, wherein the first type of object is a flat-shaped object.
16. The virtual light source is a directional light source, 14. The image processing method according to claim 13, wherein the subspace has a rectangular parallelepiped shape having sides aligned with the direction of light from the parallel light source.