Image processing program, information processing system, information processing apparatus, and image processing method

The image processing program generates partial shadow maps for virtual objects to reduce processing load and light bleeding, achieving efficient shadow rendering in virtual spaces.

JP7698753B1Active Publication Date: 2025-06-25NINTENDO CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024011042
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-06-25
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

The processing load of computers is high when generating images with shadows in virtual spaces using conventional shadow mapping techniques.

Method used

An image processing program that generates partial shadow maps for objects in a virtual space using a partial space and a virtual light source, determines shadow darkness based on depth buffers, and updates shadow buffers to reduce processing load and light bleeding.

Benefits of technology

Reduces processing load on computers and minimizes light bleeding, resulting in natural-looking shadows with reduced memory and computational requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007698753000001_ABST
    Figure 0007698753000001_ABST
Patent Text Reader

Abstract

Reduce the processing load of the computer. 【Solution means】For a plurality of objects of the first type among the objects, for each object, a partial space that is a part of the virtual space and includes the object of the first type is set. For each object, the information processing system sets a virtual light source for the partial space and generates a partial shadow map, which is a shadow map of the object of the first type in the partial space based on the virtual light source. For each object, the information processing system determines the shadow density of the object of the first type for each pixel based on the depth of the depth buffer and the depth of the partial shadow map for the pixels corresponding to the range of the partial space, and when the shadow density of the pixel is darker than the value stored in the shadow buffer that stores the shadow density, it overwrites and stores it in the shadow buffer. An image with shadows is drawn based on the shadow buffer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image processing program, an information processing system, an information processing apparatus, and an image processing method for generating an image with a shadow attached to an object in a virtual space.

Background Art

[0002] Conventionally, there is a technique using a shadow map to generate an image with a shadow attached to an object in a virtual space (see, for example, Non-Patent Document 1).

Prior Art Documents

Non-Patent Documents

[0003]

Non-Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] It is desirable to reduce the processing load of a computer by the process for generating an image with a shadow.

[0005] Therefore, an object of the present invention is to provide an image processing program, an information processing system, an information processing apparatus, and an image processing method capable of reducing the processing load of a computer when generating an image with a shadow.

Means for Solving the Problems

[0006] In order to solve the above problems, the present invention adopts 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. · A process of performing drawing on a frame buffer or a G buffer while performing a depth test using a depth buffer for an object in a virtual space · A process of setting, for each of a plurality of objects of a first type among the objects, a partial space that is a part of the virtual space and includes the object of the first type · A process of setting a virtual light source for the partial space for each of the objects and generating a partial shadow map that is a shadow map of the object of the first type in the partial space based on the virtual light source · For each of the pixels corresponding to the range of the partial space for each of the objects, determining the darkness of the shadow of the object of the first type for each pixel based on the depth of the depth buffer and the depth of the partial shadow map, and when the darkness of the shadow of the pixel is darker than the value stored in the shadow buffer that stores the darkness of the shadow, overwriting and storing it in the shadow buffer · A process of drawing a shadow on the image of the frame buffer based on the frame buffer and the shadow buffer, or drawing an image with a shadow on the frame buffer based on the G buffer and the shadow buffer

[0008] According to the configuration of (1) above, by using the partial shadow map for each object, the processing load on the computer can be reduced.

[0009] (2) In the configuration of (1) above, the image processing program may cause the computer to determine the darkness of the shadow for each pixel corresponding to the range of the partial space based on the method of a variance shadow map using the depth of the depth buffer and the depth of the partial shadow map.

[0010] According to the configuration of (2) above, while suppressing light bleeding, a shadow that looks natural by the variance shadow map can be displayed.

[0011] (3) In the configuration of (2) above, the first type of object may be a flat object.

[0012] According to the configuration of (3) above, the possibility of light bleeding can be further reduced.

[0013] (4) In the configuration of (1) above, the virtual light source may be a parallel light source. The partial space may be in the shape of a rectangular parallelepiped having sides along the direction of the light of the parallel light source.

[0014] According to the configuration of (4) above, the calculation for generating the partial shadow map can be facilitated.

[0015] Note that another example of the present invention may be an information processing apparatus or an information processing system that executes the processes in (1) to (4) above. Further, 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 above image processing program, information processing system, information processing apparatus, and image processing method, the processing load on the computer can be reduced.

Brief Description of the Drawings

[0017]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Figure 20

Figure 21

Figure 22

Best Mode for Carrying Out the Invention

[0018] [1. Configuration of Game System] Hereinafter, a game system according to an example of the present embodiment will be described. An example of the game system 1 in the present embodiment includes a main body device (information processing device; which functions as a game device main body in this embodiment) 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 body device 2. That is, the game system 1 can be used as a device in which the left controller 3 and the right controller 4 are respectively attached to the main body device 2 and integrated. Also, the game system 1 can be used with the main body device 2, the left controller 3, and the right controller 4 separated (see FIG. 2). Hereinafter, the hardware configuration of the game system 1 of the present embodiment will be described, and then the control of the game system 1 of the present embodiment will be described.

[0019] FIG. 1 is a diagram showing an example of a state in which the left controller 3 and the right controller 4 are attached to the main body device 2. As shown in FIG. 1, the left controller 3 and the right controller 4 are respectively attached to the main body device 2 and integrated. The main body device 2 is a device that executes various processes (for example, game processes) in the game system 1. The main body device 2 includes a display 12. The left controller 3 and the right controller 4 are devices provided with operation units for the user to input.

[0020] FIG. 2 is a diagram showing an example of a state in which the left controller 3 and the right controller 4 are respectively removed from the main body device 2. As shown in FIGS. 1 and 2, the left controller 3 and the right controller 4 are detachable from the main body device 2. In the following, the left controller 3 and the right controller 4 may be collectively referred to as the "controller".

[0021] Figure 3 is a six-sided view showing an example of the main body device 2. As shown in Figure 3, the main body device 2 includes a substantially plate-shaped housing 11. In the present embodiment, the main surface of the housing 11 (in other words, the front surface, that is, the surface on which the display 12 is provided) is generally rectangular in shape.

[0022] Note that the shape and size of the housing 11 are arbitrary. As an example, the housing 11 may be of a portable size. Also, the main body device 2 alone or the integrated device with the left controller 3 and the right controller 4 attached to the main body device 2 may be a portable device. Further, the main body device 2 or the integrated device may be a hand-held device. Also, the main body device 2 or the integrated device may be a transportable device.

[0023] As shown in Figure 3, the main body device 2 includes a display 12 provided on the main surface of the housing 11. The display 12 displays the image generated by the main body device 2. In the present embodiment, the display 12 is a liquid crystal display (LCD). However, the display 12 may be any type of display device.

[0024] Also, the main body device 2 includes a touch panel 13 on the screen of the display 12. In the present embodiment, the touch panel 13 is of a type capable of multi-touch input (for example, the capacitance method). However, the touch panel 13 may be of any type, for example, a type capable of single-touch input (for example, the resistive film method).

[0025] The main body device 2 includes a speaker (that is, the speaker 88 shown in Figure 6) inside the housing 11. As shown in Figure 3, speaker holes 11a and 11b are formed on the main surface of the housing 11. Then, the output sound of the speaker 88 is output from these speaker holes 11a and 11b respectively.

[0026] The main body device 2 also includes a left terminal 17 which is a terminal for the main body device 2 to perform wired communication with the left controller 3, and a right terminal 21 for the main body device 2 to perform wired communication with the right controller 4.

[0027] As shown in FIG. 3, the main body device 2 includes a slot 23. The slot 23 is provided on the upper surface of the housing 11. The slot 23 has a shape capable of mounting a storage medium of a predetermined type. The storage medium of the predetermined type is, for example, a storage medium dedicated to the game system 1 and information processing devices of the same type (for example, a dedicated memory card). The storage medium of the predetermined type is used to store, for example, data used in the main body device 2 (such as save data of an application, etc.) and / or programs executed by the main body device 2 (such as application programs, etc.). Also, the main body device 2 includes a power button 28.

[0028] The main body device 2 includes a lower terminal 27. The lower terminal 27 is a terminal for the main body device 2 to communicate with the cradle. In the present embodiment, the lower terminal 27 is a USB connector (more specifically, a female connector). When the integrated device or the main body device 2 alone is placed on the cradle, the game system 1 can display the image generated and output by the main body device 2 on a stationary monitor. Also, in the present embodiment, the cradle has a function of charging the placed integrated device or the main body device 2 alone. Further, the cradle has a function of a hub device (specifically, a USB hub).

[0029] FIG. 4 is an orthographic view showing an example of the left controller 3. As shown in FIG. 4, the left controller 3 includes a housing 31. In the present embodiment, the housing 31 has a vertically long shape, that is, a shape that is long in the vertical direction (i.e., the y-axis direction shown in FIGS. 1 and 4). The left controller 3 can also be gripped in a vertically long orientation when removed from the main body device 2. The housing 31 has a shape and size that can be gripped with one hand, particularly the left hand, when gripped in a vertically long orientation. Further, the left controller 3 can also be gripped in a horizontally long orientation. When the left controller 3 is gripped in a horizontally long orientation, it may be gripped 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 capable of inputting a direction. The user can input a direction corresponding to the tilting direction (and an input of a magnitude corresponding to the tilted angle) by tilting the analog stick 32. Note that the left controller 3 may include, as a direction input unit, a cross key or a slide stick capable of slide input instead of the analog stick. Further, in the present embodiment, it is possible to input by pressing the analog stick 32.

[0031] The left controller 3 is provided with various operation buttons. The left controller 3 is provided with four operation buttons 33-36 (specifically, a right direction button 33, a down direction button 34, an up direction button 35, and a left direction button 36) on the main surface of the housing 31. Further, the left controller 3 is provided with a recording button 37 and a -(minus) button 47. The left controller 3 is provided with a first L button 38 and a ZL button 39 at the upper left of the side surface of the housing 31. Also, the left controller 3 is provided with a second L button 43 and a second R button 44 on the side surface of the housing 31 on the side where it is mounted when mounted on the main body device 2. These operation buttons are used to give instructions according to various programs (for example, an OS program or an application program) executed by the main body device 2.

[0032] Also, the left controller 3 is provided with a terminal 42 for the left controller 3 to perform wired communication with the main body device 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 the present embodiment, the housing 51 has a vertically long shape, that is, a shape that is long in the vertical direction. The right controller 4 can also be gripped in a vertically long orientation when removed from the main body device 2. The housing 51 has a shape and size that can be gripped with one hand, particularly the right hand, when gripped in a vertically long orientation. Also, the right controller 4 can be gripped in a horizontally long orientation. When the right controller 4 is gripped in a horizontally long orientation, it may be gripped with both hands.

[0034] Similar to the left controller 3, the right controller 4 includes an analog stick 52 as a direction input unit. In this embodiment, the analog stick 52 has the same configuration as the analog stick 32 of the left controller 3. Also, instead of the analog stick, the right controller 4 may be provided with a cross key or a slide stick capable of slide input. Further, similar to the left controller 3, the right controller 4 includes 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. Additionally, the right controller 4 includes a + (plus) button 57 and a home button 58. Moreover, the right controller 4 includes a first R button 60 and a ZR button 61 at the upper right of the side surface of the housing 51. Also, similar to the left controller 3, the right controller 4 includes a second L button 65 and a second R button 66.

[0035] Furthermore, the right controller 4 includes a terminal 64 for the right controller 4 to perform wired communication with the main body device 2.

[0036] FIG. 6 is a block diagram showing an example of the internal configuration of the main body device 2. In addition to the configuration shown in FIG. 3, the main body device 2 includes the respective 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 the housing 11.

[0037] The main body device 2 includes a processor 81. The processor 81 is an information processing unit that executes various information processes executed in the main body device 2. For example, it may be composed of only a CPU (Central Processing Unit), or it may be composed of a SoC (System-on-a-chip) including a plurality of functions such as a CPU function and a GPU (Graphics Processing Unit) function. The processor 81 executes various information processes by executing an information processing program (for example, a game program) stored in a storage unit (specifically, an internal storage medium such as a flash memory 84, or an external storage medium mounted on the slot 23, etc.).

[0038] As an example of an internal storage medium built in the main body device 2, the main body device 2 includes a flash memory 84 and a DRAM (Dynamic Random Access Memory) 85. The flash memory 84 and the DRAM 85 are connected to the processor 81. The flash memory 84 is mainly a memory used to store various data (which may be a program) stored in the main body device 2. The DRAM 85 is a memory used to temporarily store various data used in information processing.

[0039] The main body 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 to and from a predetermined type of storage medium (for example, a dedicated memory card) mounted on the slot 23 according to an instruction from the processor 81.

[0040] The processor 81 appropriately reads and writes data between the flash memory 84 and the DRAM 85, and each of the above storage media to execute the above information processes.

[0041] The main body device 2 includes a network communication unit 82. The network communication unit 82 is connected to the processor 81. The network communication unit 82 communicates (specifically, wirelessly) with an external device via a network. In the present embodiment, the network communication unit 82 connects to a wireless LAN and communicates with an external device by a method compliant with the Wi-Fi standard as a first communication mode. Further, the network communication unit 82 performs wireless communication with other main body devices 2 of the same type by a predetermined communication method (for example, communication by a proprietary protocol or infrared communication) as a second communication mode. Note that the wireless communication by the second communication mode enables wireless communication with other main body devices 2 arranged within a closed local network area, and realizes a function enabling so-called "local communication" in which data is transmitted and received by direct communication between a plurality of main body devices 2.

[0042] The main body device 2 includes 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 the right controller 4. The communication method between the main body device 2 and the left controller 3 and the right controller 4 is arbitrary, but in the present embodiment, the controller communication unit 83 communicates with the left controller 3 and the right controller 4 in accordance with the Bluetooth (registered trademark) standard.

[0043] The processor 81 is connected to the above-described left terminal 17, right terminal 21, and lower terminal 27. When the processor 81 performs wired communication with the left controller 3, it 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. Further, when the processor 81 performs wired communication with the right controller 4, it 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. Also, when the processor 81 communicates with the cradle, it transmits data to the cradle via the lower terminal 27. Thus, in the present embodiment, the main body device 2 can perform both wired communication and wireless communication with the left controller 3 and the right controller 4, respectively. Further, when the left controller 3 and the right controller 4 are attached to the main body device 2 as an integrated device or when the main body device 2 alone is attached to the cradle, the main body device 2 can output data (e.g., image data or audio data) to a stationary monitor or the like via the cradle.

[0044] Here, the main body device 2 can communicate with a plurality of left controllers 3 simultaneously (in other words, in parallel). Also, the main body device 2 can communicate with a plurality of right controllers 4 simultaneously (in other words, in parallel). Therefore, a plurality of users can simultaneously input to the main body device 2 using respective sets of the left controller 3 and the right controller 4. As an example, while a first user inputs to the main body device 2 using a first set of the left controller 3 and the right controller 4, it is possible for a second user to input to the main body device 2 using a second set of the left controller 3 and the right controller 4.

[0045] Also, the display 12 is connected to the processor 81. The processor 81 displays an image generated (e.g., by executing the above-described information processing) and / or an image acquired from the outside on the display 12.

[0046] The main body device 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 / output of audio data to / from the speakers 88 and the audio input / output terminal 25.

[0047] The main body 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. Also, although not shown, the power control unit 97 is connected to each part of the main body device 2 (specifically, each part that receives power supply 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 a command from the processor 81.

[0048] Also, the battery 98 is connected to the lower terminal 27. When an external charging device (for example, a cradle) is connected to the lower terminal 27 and power is supplied to the main body device 2 via the lower terminal 27, the supplied power is charged to the battery 98.

[0049] FIG. 7 is a block diagram showing an example of the internal configuration of the main body device 2, the left controller 3, and the right controller 4. Note that the details of the internal configuration regarding the main body device 2 are shown in FIG. 6, so they are omitted in FIG. 7.

[0050] The left controller 3 includes a communication control unit 101 that communicates with the main body device 2. As shown in FIG. 7, the communication control unit 101 is connected to each component including the terminal 42. In the present embodiment, the communication control unit 101 can communicate with the main body device 2 both by wired communication via the terminal 42 and by wireless communication without using the terminal 42. The communication control unit 101 controls the communication method that the left controller 3 performs with respect to the main body device 2. That is, when the left controller 3 is attached to the main body device 2, the communication control unit 101 communicates with the main body device 2 via the terminal 42. Further, when the left controller 3 is removed from the main body device 2, the communication control unit 101 performs wireless communication with the main body device 2 (specifically, the controller communication unit 83). The wireless communication between the controller communication unit 83 and the communication control unit 101 is performed according to, for example, the Bluetooth (registered trademark) standard.

[0051] Further, the left controller 3 includes a memory 102 such as a flash memory. The communication control unit 101 is configured by, for example, a microcomputer (also referred to as a microprocessor) and executes various processes by executing the firmware stored in the memory 102.

[0052] The left controller 3 includes each button 103 (specifically, buttons 33 - 39, 43, 44, and 47). Further, the left controller 3 includes an analog stick (described as "stick" in FIG. 7) 32. Each button 103 and the analog stick 32 output information regarding the operation performed on themselves to the communication control unit 101 repeatedly at an appropriate timing.

[0053] The communication control unit 101 acquires information regarding input (specifically, information regarding operations or detection results by sensors) from each input unit (specifically, each button 103 and the analog stick 32). The communication control unit 101 transmits operation data including the acquired information (or information obtained by performing predetermined processing on the acquired information) to the main body device 2. Note that the operation data is repeatedly transmitted at a rate of once every predetermined time. Note that the intervals at which the information regarding input is transmitted to the main body device 2 may be the same or different for each input unit.

[0054] When the above operation data is transmitted to the main body device 2, the main body device 2 can obtain the input performed on the left controller 3. That is, the main body device 2 can determine operations on each button 103 and the analog stick 32 based on the operation data.

[0055] The left controller 3 includes a power supply unit 108. In the present 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 is also connected to each part of the left controller 3 (specifically, each part that receives power supply from the battery).

[0056] As shown in FIG. 7, the right controller 4 includes a communication control unit 111 that communicates with the main body device 2. The right controller 4 also includes a memory 112 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 the memory 112 have the same functions as the communication control unit 101 and the memory 102 of the left controller 3. Therefore, the communication control unit 111 can communicate with the main body device 2 by both wired communication via the terminal 64 and wireless communication without using the terminal 64 (specifically, communication according to the Bluetooth (registered trademark) standard), and controls the communication method performed by the right controller 4 with respect to the main body device 2.

[0057] The right controller 4 includes each input unit similar to each input unit of the left controller 3. Specifically, it includes each button 113 and the analog stick 52. These input units have the same functions as the input units of the left controller 3 and operate in the same manner.

[0058] The right controller 4 includes a power supply unit 118. The power supply unit 118 has the same function as the power supply unit 108 of the left controller 3 and operates in the same manner.

[0059] [2. Outline of Processing in the Game System] Hereinafter, the game image generation process executed by the game system 1 will be described. In the present embodiment, the game system 1 arranges objects in a three-dimensional virtual space that is the game space, and generates and displays a game image showing the virtual space with shadows attached to the objects. FIG. 8 is a diagram showing an example of a game image. As shown in FIG. 8, in the present embodiment, for a predetermined type of object arranged in the virtual space, it is displayed with a shadow (that is, the shadow area becomes darker). In the example shown in FIG. 8, for two objects 201 and 202, shadows 203 and 204 are attached respectively. In the present embodiment, the predetermined type of object includes a player character operated by the player and a non-player character whose operation is controlled by the game system 1. Note that the game system 1 may attach shadows to any object arranged in the virtual space, or may attach shadows to all objects.

[0060] FIG. 9 is a diagram showing an example of an object of a predetermined type arranged in a virtual space. In the present embodiment, the object of the predetermined type has a flat shape like the object 201 shown in FIG. 9. Specifically, the object 201 has a main body portion (specifically, a portion including a head, a torso, and legs) 211, a right arm portion 212, and a left arm portion 213. Each of the portions 211-213 has a planar shape. In FIG. 9, each of the portions 211-213 is shown as having a certain thickness, but each of the portions 211-213 may not have a thickness. Also, in the present embodiment, each of the portions 211-213 is arranged shifted in the thickness direction (see FIG. 9). Therefore, the object 201 as a whole has a certain thickness. 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 the present embodiment, when attaching a shadow to a plurality of the above-described predetermined types of objects arranged in the virtual space, the game system 1 executes a process of calculating a shadow area for each object. Hereinafter, this process will be described with reference to FIGS. 10-16.

[0062] In the present embodiment, the game system 1 sets a partial space for each of the above-described predetermined types of objects, and generates a shadow map (hereinafter referred to as a "partial shadow map") for each object using the partial space. FIG. 10 is a diagram showing an example of a partial space set for each object. In the example shown in FIG. 10, a partial space 221 is set for the object 201, and a partial space 222 is set for the object 202.

[0063] A partial space is set to enclose a corresponding object (i.e., an object to be shaded using the partial space) (see FIG. 10). The size of the partial space may be any size that encloses the corresponding object. Since the partial space only needs to enclose the corresponding object, for example, there is no need to set a large partial space that encloses a plurality of objects. Therefore, it is possible to suppress an increase in the size of the partial shadow map and suppress an increase in the memory area used for the partial shadow map.

[0064] In the present embodiment, the partial space has a rectangular parallelepiped shape having sides along the light ray direction of the light source (more specifically, sides parallel to the light ray direction) (see FIG. 10). Details will be described later, but by setting the partial space to the above shape, the calculation for generating the partial shadow map of the range corresponding to the partial space becomes easy. In the present embodiment, the light source for shading is a parallel light source. Therefore, the partial spaces set for each object have the same orientation (see FIG. 10). Note that the shape of the partial space is arbitrary, and in other embodiments, it may have a shape other than a rectangular parallelepiped.

[0065] FIG. 11 is a diagram showing an example of a partial space in a modified example of the present embodiment. In the modified example shown in FIG. 11, it is assumed that a point light source is used as the light source for shading. At this time, the game system 1 may set frustum-shaped partial spaces 225 and 226 for the objects 201 and 202 respectively based on the position of the point light source. Specifically, the partial spaces 225 and 226 are frustums obtained by removing, from a quadrangular pyramid having the position of the point light source as the apex, a quadrangular pyramid that is similar to the quadrangular pyramid and has the same apex. When a point light source is used, the partial shadow map for each object can be generated by setting the above partial space.

[0066] In the present embodiment, partial shadow maps are generated for each partial space based on the above partial space (see FIG. 10). The partial shadow map indicates the depth (in other words, the distance) of each position in the partial space when viewed from the light ray direction. Since a parallel light source is used in the present embodiment, the above depth is calculated as the distance in the light ray direction from a predetermined reference position (that is, the position of the light source) to the position. Note that the reference position may be any position.

[0067] Note that the depth of the partial shadow map is calculated only for the object corresponding to the above partial space. That is, in the partial shadow map, for the position 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. Also, in the partial shadow map, for the position where no object exists when viewed from the light ray direction, the depth is set to the maximum value. Therefore, in the present embodiment, even if another object is arranged in front of or behind the above object when viewed from the light ray direction, the depth of the partial shadow map is calculated without considering the other object.

[0068] The game system 1 generates a partial shadow map for each object in which a partial space is set. In this embodiment, when the game system 1 generates a partial shadow map for one object, it executes an update process of the shadow buffer based on the partial shadow map (details will be described later), and then generates a partial shadow map for another object. That is, the game system 1 repeatedly executes the generation process of the partial shadow map and the update process of the shadow buffer based on the partial shadow map for each object. According to this, since only one partial shadow map is stored in the memory area at the same time, the memory area for the partial shadow map can be saved. In other embodiments, the order of executing the generation process of the partial shadow map and the update process of the shadow buffer is arbitrary, and the game system 1 may execute the update process of the shadow buffer based on each partial shadow map after generating the partial shadow map for each object.

[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 at the pixel corresponding to the partial space (that is, the pixel that displays the position within the partial space) among the pixels in the shadow buffer using the partial shadow map for the partial space. That is, in the update process of the shadow buffer based on one partial shadow map, the shadow density is updated for the pixels corresponding to the area within the partial space corresponding to the partial shadow map.

[0070] In this embodiment, the shadow density is calculated using the method of the variance shadow map. In the method of the variance shadow map, the probability that the position corresponding to the pixel becomes a shadow is represented by Chebyshev's inequality, and the shadow density is calculated so as to be the density corresponding to the probability (that is, the shadow is darker where the probability of becoming a shadow is high, and the shadow is lighter where the probability of becoming a shadow is low). Specifically, in this embodiment, the variable P indicating the shadow density at the pixel is calculated according to the following formula (1). P = σ 2 / {σ 2 +(t - E(x)) 2} …(1) Although details will be described later, the smaller the value of the variable P, the darker the shadow (i.e., the darker).

[0071] FIG. 12 is a diagram showing an example of the positional relationship among a light source, an object, and a surface on which the shadow of the object is cast (e.g., the ground in a virtual space). The variable t in the above equation (1) is the depth at the position corresponding to the pixel (e.g., position A shown in FIG. 12). Here, the depth in the above equation (1) is the depth based on the light source (i.e., 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 to the depth based on the light source (see FIG. 12). Note that the depth d based on the virtual camera is stored in the depth buffer. The value of the depth stored in the depth buffer may be calculated by a conventional method.

[0072] The variable x in the above equation (1) is the depth at the position corresponding to the pixel stored in the partial shadow map. That is, the variable x is the depth based on the light source, and when an object exists between the position of the light source and the position corresponding to the pixel (e.g., 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 (e.g., position B shown in FIG. 12).

[0073] The function E(x) in the above equation (1) represents the value obtained by applying a predetermined smoothing filter to the depth x. Also, the variable σ in the above equation (1) 2 is the variance value of the depth at the position corresponding to the pixel (more specifically, the local variance value around the pixel). Specifically, the variable σ 2 is calculated by the following equation (2). σ 2 = E(x 2 ) - E(x) 2 …(2) In this embodiment, the function E(x) in the above equations (1) and (2) represents the result of applying a smoothing filter to the depth. However, in other embodiments, the function E(x) may represent the average value of the above depth (for example, the average value of the depths of the pixels within a predetermined range including the pixel).

[0074] Here, when an object exists on the straight line from the light source to the pixel, the variable t becomes larger than the above E(x) (see FIG. 12). In this case, the pixel becomes a pixel where the shadow of the object is drawn. On the other hand, when no object exists on the straight line from the light source to the pixel, the variable t becomes less than or equal to the above E(x). In this case, the pixel becomes a pixel where the shadow of the object is not drawn. Therefore, when the variable t is larger than E(x), the game system 1 calculates the variable P according to the above equation (1). On the other hand, when the variable t is less than or equal to E(x), the variable P is not calculated. In this case, the value of the pixel in the shadow buffer is not updated. In other embodiments, instead of comparing the variable t with E(x), the game system 1 may compare the variable t with the variable x.

[0075] FIG. 13 is a diagram showing an example of an object and the region that becomes the shadow of the object. In FIG. 13, it is assumed that the region 231 on the ground in the virtual space is the region where the shadow of the object 201 is drawn. Here, the variable P calculated according to the above equation (1) is a variable indicating that the larger the value, the brighter (in other words, the thinner the shadow). According to the above equation (1), at the position near the edge of the region 231 that becomes the shadow of the object 201, the variance σ 2 becomes large, so the value of the variable P becomes large. At the above position, the variance σ 2The reason for the increase is that around the said position, the variable x includes the position where it is the depth from the light source to the object (i.e., the shadow position) and the position where it is the depth from the light source to the ground (i.e., the non-shadow position). Therefore, the variation in the value of the variable x becomes large. From the above, at the position near the edge of the shadow region 231 of the object 201, the shadow becomes thinner (see Fig. 13). On the other hand, at the inner position away from the edge of the said region 231, since the variable x is the depth from the light source to the object around the said position, the variation in the value of the variable x is small, so the variance σ 2 becomes small, and the value of the variable P becomes small. Therefore, at the inner position away from the edge of the said region 231, the shadow becomes darker (see Fig. 13). From the above, according to the variance shadow map method, the outline of the shadow is blurred, so jaggedness is less likely to occur at the edge of the shadow, and a natural-looking shadow can be displayed.

[0076] Note that in the variance shadow map method, the edge part in the shadow region of one object is likely to have a thin (i.e., bright) shadow. Therefore, when the shadows of two objects are displayed overlapping, there is a possibility that a phenomenon (so-called light bleeding) occurs where the part that should be displayed darkly at the edge part is displayed brightly. Fig. 14 is a diagram showing an example of a game image when the shadows of two objects are displayed overlapping. The example shown in Fig. 14 is a situation where the shadow 203 of the object 201 and the shadow 204 of the object 202 are displayed overlapping. In such a situation, there is a possibility of an unnatural display where the edge of the shadow region of the shadow 204 is displayed brightly and the outline of the shadow 204 is displayed brightly at the boundary part between the shadow 203 and the shadow 204. For example, (different from generating a plurality of partial shadow maps for each object as in this embodiment,) when generating a single shadow map for the entire drawing range in the virtual space and calculating the shadow density by the variance shadow map method using the said shadow map, there is a possibility of light bleeding. In this embodiment, in order to reduce the possibility of such unnatural shadows being displayed, the game system 1 performs processing as follows.

[0077] FIG. 15 is a diagram showing an example of updating a shadow buffer. The example shown in FIG. 15 is an example in which, after the value of the shadow density based on the partial shadow map for the first object 201 is stored in the shadow buffer, the shadow buffer is updated using the partial shadow map for the second object 202.

[0078] The state of (a) shown in FIG. 15 is the state before the shadow buffer is updated using the partial shadow map for the second object 202, that is, 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, for each pixel in the shadow buffer, it is determined whether to update the shadow density for the pixels within the region 242 corresponding to the partial space of the object 202. Specifically, the game system 1 does not update the pixels within the region 242 that are outside the shadow region of the object 202 (i.e., the pixels where the variable t is less than or equal to E(x)) as described above. Also, for the pixels within the region 242 that are within the shadow region of the object 202 (i.e., the pixels where the variable t is greater than E(x)), the game system 1 updates the value in the shadow buffer when the variable P calculated according to the above formula (1) is less than the value stored in the shadow buffer (that is, when the calculated shadow density indicates a darker value than the density stored in the shadow buffer). Therefore, when a pixel within the shadow 241 of the first object 201 is at a position within the shadow 243 of the second object 202, if the density in the shadow 243 is darker than the density in the shadow 241, the value of the pixel is updated, and if the density in the shadow 243 is lighter than the density in the shadow 241, the value of the pixel is not updated. According to the above, for example, even if the shadow is calculated to be light at the edge pixels of the shadow 243 of the second object 202, it is not updated when the value stored in the shadow buffer (i.e., the value indicating the density of the shadow 241 of the first object 201) indicates a dark shadow, so the value indicating a dark shadow remains stored in the pixel.

[0080] According to the above, when the shadows of two objects are displayed overlapping, the possibility of the above-mentioned light bleeding can be reduced. FIG. 16 is a game image when the shadows of two objects are displayed overlapping, and is a diagram showing an example of a game image generated by the processing in the present embodiment. In the example shown in FIG. 16, unlike the example shown in FIG. 14, the boundary portion between the shadow 203 of the object 201 and the shadow 204 of the object 202 is displayed dark. Thus, in the present embodiment, by updating the shadow buffer for each partial shadow map and performing the update when the shadow is darker than the value stored in the shadow buffer, the possibility of light bleeding can be reduced.

[0081] Note that even when a plurality of objects are included in one partial space, if the depth with respect to the light source is significantly different between a certain position and its surrounding positions, the above-mentioned variance σ 2 becomes large, and as a result, there is a possibility of light bleeding occurring at that position. Regarding this, in the present embodiment, as described above, the depth of the partial shadow map is calculated only for the objects corresponding to the partial space. Also by this, the possibility that the difference in each depth in the partial shadow map becomes large can be reduced, so that the variance σ 2 becomes large, and the possibility of light bleeding occurring as a result can be reduced.

[0082] Also, in the present embodiment, the predetermined type of object to which a shadow is attached 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, so the variance σ 2It is difficult to grow larger. In the present embodiment, this can also reduce the possibility of light bleeding. Further, when a flat object is in a state where it is nearly parallel to the light ray direction, the amount of change in depth in the partial shadow map becomes large. However, in the present embodiment, since the object is flat, it can be said that the problem that the shadow looks unnatural hardly occurs because the shadow becomes thin in this state.

[0083] The game system 1 updates the shadow buffer by sequentially updating the shadow buffer using the partial shadow map for each object. Then, by performing lighting processing on the game image drawn on the frame buffer using the updated shadow buffer, a game image with shadows is generated. Note that the specific content of the lighting processing is arbitrary, and a conventional method may be used.

[0084] [3. Specific Examples of Processing in Information Processing System / Game System] Next, with reference to FIGS. 17 to 22, specific examples of information processing in the game system 1 will be described.

[0085] FIG. 17 is a diagram showing an example of a storage area for storing various data used in information processing in the game system 1. Each storage area shown in FIG. 17 is provided in a storage medium (for example, flash memory 84, DRAM 85, and / or a memory card mounted in slot 23, etc.) accessible by the main body device 2. As shown in FIG. 17, a game program area for storing a game program is provided in the storage medium. The game program is for executing game processing (specifically, the game processing shown in FIG. 18) in the present embodiment. Further, a frame buffer, a depth buffer, a G buffer, a shadow buffer, and a partial shadow map area are provided in the storage medium (see FIG. 17).

[0086] FIG. 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, in response to the start of the game according to the player's instruction during the execution of the above game program.

[0087] In the present embodiment, the processor 81 of the main body device 2 will be described as executing the processing of each step shown in FIG. 18 by executing the above game program stored in the game system 1. However, in other embodiments, some of the processing of each of the above steps may be executed by a processor (for example, a dedicated circuit or the like) different from the processor 81. Further, when the game system 1 can communicate with another information processing device (for example, a server), a part of the processing of each step shown in FIG. 18 may be executed in the other information processing device. Also, the processing of each step shown in FIG. 18 is merely an example, and if the same result can be obtained, the processing order of each step may be changed, or another processing may be executed in addition to (or instead of) the processing of each step.

[0088] Also, the processor 81 executes the processing of each step shown in FIG. 18 using a memory (for example, DRAM 85). That is, the processor 81 stores the information (in other words, data) obtained by each processing step in the memory, and when using the information in subsequent processing steps, reads out the information from the memory and uses it.

[0089] In step S1 shown in FIG. 18, the processor 81 acquires the operation data indicating the instruction by the player. That is, the processor 81 acquires the operation data received from each controller via the controller communication unit 83 and / or each of the terminals 17 and 21. The processing of step S2 is executed after step S1.

[0090] In step S2, the processor 81 controls the operations of the objects arranged in the virtual space. For example, the processor 81 controls the operations of the player character based on the operation data acquired in step S1, or controls the operations of the non-player characters according to the algorithms defined in the game program. The process of step S3 is executed after step S2.

[0091] In step S3, the processor 81 executes a rendering process including a process of attaching shadows to objects of a predetermined type. In the rendering process of step S3, drawing regarding the virtual space in which the processing result of step S2 is reflected is performed for the objects of the predetermined type and the like. Hereinafter, with reference to FIG. 19, the details of the rendering process of step S3 will be described.

[0092] FIG. 19 is a sub flowchart showing an example of the detailed flow of the rendering process of step S3 shown in FIG. 18. In the rendering process, first, in step S11, the processor 81 designates an object to be drawn. In step S11, an object that has not yet been a processing target in the processing loop of steps S11 - S16 this time is designated. After step S11, the process of step S12 is executed.

[0093] In step S12, the processor 81 designates a polygon to be drawn among the polygons of the object designated in step S11. In step S12, a polygon that has not yet been a processing target in the processing loop of steps S12 - S15 this time is designated. After step S12, the process of step S13 is executed.

[0094] In step S13, the processor 81 performs a depth test on the polygon specified in step S12 to update the depth buffer. That is, when the depth value of each pixel stored in the depth buffer is greater than the depth value of the position of the pixel in the polygon, the processor 81 updates the depth buffer so that it becomes the depth value of the polygon. Next to step S12, the process 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 (for example, information such as the position, normal, and color of the polygon) to the G-buffer for the pixels corresponding to the polygon. Next to step S14, the process of step S15 is executed.

[0096] In step S15, the processor 81 determines whether or not the series of processes of steps S12 - S14 has been completed for each polygon of the object specified in step S11. If the determination result in step S15 is affirmative, the process of step S16 is executed. On the other hand, if the determination result in step S15 is negative, the process of step S12 is executed again.

[0097] In step S16, the processor 81 determines whether or not the series of processes of steps S11 - S15 has been completed for each object to be rendered. If the determination result in step S16 is affirmative, the process of step S17 is executed. On the other hand, if the determination result in step S16 is negative, the process of step S11 is executed again.

[0098] In step S17, the processor 81 executes a shadow buffer update process for updating the shadow buffer. The shadow buffer update process is a process of updating the value of the shadow buffer so as to show the shadow for the object of the above-mentioned predetermined type. Hereinafter, with reference to FIG. 20, the details of the shadow buffer update process in step S17 will be described.

[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, the processor 81 designates an object to be the target of shadow drawing. In step S21, among objects of a predetermined type, an object that has not yet been a processing target in the processing loop of the current steps S21 - S29 is designated. Next to step S21, the process of step S22 is executed.

[0100] In step S22, the processor 81 generates a partial shadow map for the object designated in step S21. That is, the processor 81 sets the above - mentioned partial space for the object (see Figure 10) and generates a partial shadow map based on the set partial space. In the present embodiment, when a partial shadow map indicating values related to another partial space different from the set partial space is stored in the above - mentioned partial shadow map area, the partial shadow map area is overwritten and updated so as to be the content of the newly generated partial shadow map. Next to step S22, the process of step S23 is executed.

[0101] In step S23, the processor 81 executes a distributed shadow map process for calculating the shadow density by the method of the above - mentioned distributed shadow map. In the distributed shadow map process, the shadow density is calculated for each pixel of the object designated in step S21, and the shadow buffer is updated according to the calculated shadow density. Hereinafter, with reference to Figure 21, the details of the distributed shadow map process in step S23 will be described.

[0102] FIG. 21 is a sub flowchart showing an example of a detailed flow of the distributed shadow map process of step S23 shown in FIG. 20. In the distributed shadow map process, 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 a processing target in the current processing loop of steps S31 - S38 is designated. Next to step S31, the process of step S32 is executed.

[0103] In step S32, the processor 81 determines whether the pixel designated in step S31 is a pixel corresponding to the partial space set for the object designated in step S21. Note that a pixel corresponding to a partial space is a pixel indicating a position within the partial space, or a pixel such that the partial space is arranged in front of the position indicated by the pixel when viewed from the light source direction. If the determination result in step S32 is affirmative, the process of step S33 is executed. On the other hand, if the determination result in step S32 is negative, the process of step S38 described later is executed.

[0104] In step S33, the processor 81 calculates the depth with respect to the light source for the pixel designated in step S31. That is, the processor 81 converts the depth (d shown in FIG. 12) with respect to the virtual camera stored in the depth buffer into the depth (t shown in FIG. 12) with respect to the light source. Next to 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 affirmative, the process of step S35 is executed. On the other hand, if the determination result in step S34 is negative, the process of step S38 described later is executed.

[0106] In step S35, the processor 81 calculates the shadow density for the pixel specified in step S31. Specifically, the processor 81 calculates a variable P indicating the shadow density according to the above formula (1). Next to step S35, the process of step S36 is executed.

[0107] In step S36, the processor 81 determines whether the value indicating the shadow density calculated in step S35 for the pixel specified in step S31 is smaller than the value of the pixel stored in the shadow buffer (that is, whether the calculated shadow density indicates a value darker than the density stored in the shadow buffer). If the determination result in step S36 is affirmative, the process of step S37 is executed. On the other hand, if the determination result in step S36 is negative, the process of step S38 described later is executed.

[0108] In step S37, the processor 81 updates the value stored in the shadow buffer for the pixel specified in step S31 to the value calculated in step S35. Next to step S37, the process of step S38 is executed.

[0109] In step S38, the processor 81 determines whether the series of processes of 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 affirmative, the processor 81 ends the distributed shadow map process.

[0110] Returning to the description of FIG. 20, next to the distributed shadow map process (step S23), the process of step S24 is executed. In step S24, the processor 81 determines whether the series of processes of steps S21 - S23 has been completed for each object to be drawn with a shadow. If the determination result in step S24 is negative, the process of step S21 is executed again. On the other hand, if the determination result in step S24 is affirmative, the processor 81 ends the shadow buffer update process.

[0111] Returning to the description 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 a writing process. In the writing process, the pixel value of each pixel considering the light source in the virtual space is calculated. Hereinafter, with reference to FIG. 22, the details of the writing process in step S18 will be described.

[0112] FIG. 22 is a sub flowchart showing an example of the detailed flow of the writing process in step S18 shown in FIG. 19. In the writing process, first, in step S41, the processor 81 designates a pixel whose pixel value is to be calculated from among the pixels in the frame buffer. In step S41, a pixel that has not yet been a processing target in the processing loop of the current steps S41 - S44 is designated. Next, the process of step S42 is executed after step S41.

[0113] In step S42, the processor 81 calculates the pixel value of the pixel designated in step S41 based on the depth buffer and the G buffer described above. The pixel value calculated here is the pixel value before the shadow by the shadow buffer described above is reflected. When a light source different from the light source corresponding to the partial space of a predetermined type of object (in the present embodiment, the above-described parallel light source) is set in the virtual space, the processor 81 may calculate the pixel value in consideration of the other light source in the process of this step S42. The processor 81 updates the frame buffer so as to store the calculated pixel value. Next, the process of step S43 is executed after step S42.

[0114] In step S43, the processor 81 performs shadowing to add a shadow to the image in the frame buffer based on the above-mentioned shadow buffer. That is, for the pixel specified in step S41, the processor 81 calculates a pixel value in which the shadow density at the pixel stored in the shadow buffer is reflected based on the pixel value calculated in step S42. The processor 81 updates the frame buffer to store the calculated pixel value. After step S43, the process of step S44 is executed.

[0115] In step S44, the processor 81 determines whether or not the series of processes of 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 writing process. By ending the writing process, the rendering process shown in FIG. 19 is ended. In the present embodiment, the rendering process shown in FIG. 19 is performed by deferred rendering using the G-buffer. However, in other embodiments, the rendering process may be performed by forward rendering. That is, in the present embodiment, the processor 81 performs drawing to the G-buffer in the above-mentioned rendering process (see FIG. 19), and in the above-mentioned writing process (see FIG. 22), draws a shadowed image to the frame buffer based on the G-buffer and the shadow buffer. However, in other state forms, in the above-mentioned rendering process, drawing may be performed to the frame buffer, and in the above-mentioned writing process, a shadow may be drawn on the image of the frame buffer based on the frame buffer and the shadow buffer.

[0116] Returning to the description of FIG. 18, after the rendering process (step S3), the process of step S4 is executed. In step S4, the processor 81 executes a rendering process for objects (such as backgrounds, etc.) that are 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. Next, the process of step S5 is executed after step S4.

[0117] In step S5, the processor 81 executes post - process processing. The specific content of the post - process processing is arbitrary. The processor 81 applies effects to the game image generated by the processes of steps S3 and S4 using, for example, a filter, or performs adjustments such as brightness and saturation. Next, the process of step S6 is executed after step S5.

[0118] In step S6, the processor 81 outputs the game image after the process of step S5 to the display device. Thereby, the game image is displayed on the display device. Note that the display device to which the game image is output may be the display 12 of the main body device 2, or may be the above - mentioned stationary monitor connected to the main body device 2. Next, the process of step S7 is executed after step S6.

[0119] In step S7, the processor 81 determines whether to end the game process. For example, when a predetermined operation input for ending the game is performed by the player, the processor 81 determines to end the game. If the determination result in step S7 is negative, the process of step S1 is executed again. Thereafter, a series of processes of steps S1 to S7 are repeatedly executed until it is determined to end the game in step S7. On the other hand, if the determination result in step S7 is positive, the processor 81 ends the game process shown in FIG. 18.

[0120] [4. Effects and Modifications of this Embodiment] In the above-described embodiment, the image processing program (for example, a game program) is configured to cause a computer of the information processing apparatus (for example, the processor 81 of the main body device 2) to execute the following processes. · A process of performing drawing on the frame buffer or the G buffer while performing a depth test on an object in the virtual space using the depth buffer (step S14) · A process of setting, for each of a plurality of objects of the first type among the objects, a partial space that is a part of the virtual space and includes the object of the first type for each object (step S22) · A process of setting a virtual light source for the partial space for each of the above objects and generating a partial shadow map that is a shadow map of the object of the first type in the partial space based on the virtual light source (step S22) · For each pixel corresponding to the range of the partial space for each of the above objects, based on the depth of the depth buffer and the depth of the partial shadow map, determining the shadow density of the object of the first type for each pixel (step S35), and when the shadow density of the pixel is darker than the value stored in the shadow buffer that stores the shadow density, overwriting and storing it in the shadow buffer (step S37) · A process of drawing a shadow on the image of the frame buffer based on the frame buffer and the shadow buffer, or drawing an image with a shadow on the frame buffer based on the G buffer and the shadow buffer (step S43)

[0121] According to the above configuration, by using the partial shadow map for each object, it is not necessary to generate a shadow map for the entire drawing range, so that the memory area for the shadow map can be reduced or the processing load on the computer can be reduced.

[0122] In the above embodiment, a game program that generates a game image was used as an example of an image processing program that generates an image of a virtual space with shadows. However, 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 for generating an image showing a virtual space.

[0123] In the above embodiment, the shadow density for each pixel was calculated based on the distributed shadow map method. However, the specific method for calculating the shadow density is not limited to this, and the shadow density may be calculated by any method. According to the above embodiment, by using the partial shadow map, it is possible to suppress the above-mentioned light bleeding even when using the distributed shadow map method. Therefore, it is not necessary to perform additional processing to suppress light bleeding, and a natural-looking shadow can be displayed.

[0124] In the above embodiment, when a process is executed using data (in the sense of including a program) in a certain information processing device, a part of the data necessary for the process may be transmitted from another information processing device different from the certain information processing device. At this time, the certain information processing device may execute the above process using the data received from the other information processing device and the data stored in itself.

[0125] In other embodiments, the information processing system may not include a part of the configuration in the above embodiment, or may not execute a part of the processes executed in the above embodiment. For example, in order for the information processing system to exhibit some specific effects in the above embodiment, it may include a configuration for achieving the effects and execute processes for achieving the effects, and may not include other configurations or execute other processes.

Industrial Applicability

[0126] The above-described embodiment can be used, for example, in a game system or a game program for the purpose of reducing the processing load of a computer or the like.

Explanation of Signs

[0127] 1 Game system 2 Main body device 81 Processor 201, 201 Object 221, 222 Partial space

Claims

1. In the computer of the information processing device, For objects in the virtual space, a depth test is performed using the depth buffer while rendering is performed in the frame buffer or G buffer. For a plurality of objects of a first type among the objects, for each object, 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, the partial shadow map being 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 the shadow density, overwriting and storing the shadow density in the shadow buffer; An image processing program that causes a shadow to be drawn on an image in the frame buffer based on the frame buffer and the shadow buffer, or causes a shadowed image to be drawn on the frame buffer based on the G buffer and the shadow buffer.

2. The computer includes:

2. The image processing program according to claim 1, further comprising: determining a shadow density for each pixel corresponding to the range of the partial space 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 along the light direction of the parallel light source.

5. For objects in virtual space, a depth test is performed using the depth buffer while drawing them to the frame buffer or G buffer. For a plurality of objects of a first type among the objects, for each object, 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 for 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 a 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 the shadow density, overwriting and storing the shadow density in the shadow buffer; 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 in 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 partial space 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 partial space has a rectangular parallelepiped shape having sides aligned along the light direction of the parallel light source.

9. For objects in virtual space, a depth test is performed using the depth buffer while drawing them to the frame buffer or G buffer. For a plurality of objects of a first type among the objects, for each object, 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 for 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 a 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 the shadow density, overwriting and storing the shadow density in the shadow buffer; An information processing apparatus 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 in 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 partial space 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 along the light direction of 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 drawing them to the frame buffer or G buffer. For a plurality of objects of a first type among the objects, for each object, 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 for 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 a 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 the shadow density, overwriting and storing the shadow density in the shadow buffer; An image processing method, comprising: drawing a shadow on an image in the frame buffer based on the frame buffer and the shadow buffer; or drawing a shaded image in 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. 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, The image processing method according to claim 13 , wherein the subspace has a rectangular parallelepiped shape having sides aligned along the light direction of the parallel light source.

Citation Information

Patent Citations

  • Image processing program, image processing system, image processing apparatus, and image processing method

    JP2019144739A

  • Information processing program, information processing system, information processing device, and information processing method

    JP2023127837A

  • Image processing apparatus, image processing method, and program

    JP2023153534A

  • Game program, game system, game processing method, and game device

    JP2023178519A