Game program, game system, game processing method, and game device
Patent Information
- Application Number
- JP2024230741
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2026-09-18
AI Technical Summary
【0018】 本開示によれば、正射影による画像を用いるゲームにおいて、2Dゲーム風の影を描画 できる。
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to image processing in game processing. [Background technology]
[0002] Shadows have been expressed in virtual three-dimensional space in game processing and the like. Among them, shadow volume techniques are also known for expressing shadows (e.g. For example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2004-280596 A Summary of the Invention [Problem to be solved by the invention]
[0004] The above technologies were based on the assumption that the game would be expressed using perspective projection. As described above, this method is not suitable for expressing game images using orthogonal projection. [Means for solving the problem]
[0005] In view of the above, the following configuration example is given.
[0006] (Configuration 1) In the first aspect, a computer of an information processing device includes a player character object and At least a rear object is disposed behind the player character object. In the virtual space, the player controls at least a player character object and a virtual camera. Then, using orthogonal projection and depth testing, the virtual space is rendered onto the frame buffer. In addition, the occlusion determination method based on SSAO is also The depth values of multiple sample points set around the corresponding position in the virtual space and the corresponding depth are calculated. When comparing the depth of the position in the preview buffer, the sample point position is The degree of occlusion for each pixel is determined based on the occlusion determination method that adds an offset to the Then, the image in the frame buffer corresponding to the part that is determined to be highly occluded is Draw additional shadows on the element.
[0007] According to the above configuration example, the shadow of the player character object is drawn on the back object. When doing so, it can draw 2D-style shadows.
[0008] (Configuration 2) In the configuration 2, in the above configuration 1, in the virtual space, the rear object is The occlusion determination method may further include the steps of: In the comparison, the occlusion determination method does not attenuate the occlusion degree based on the depth difference. This is also fine.
[0009] According to the above configuration example, the back object is displayed at a depth different from the appearance by orthogonal projection. Even if objects are placed, the shadows look natural when playing 2D games. can be drawn.
[0010] (Configuration 3) Configuration 3 is the above-mentioned configuration 2, wherein in the virtual space, there is provided an object further back than the rear object. A background object may be arranged on the side of the object. Alternatively, the shadow may be drawn while excluding pixels corresponding to the object.
[0011] According to the above configuration example, a shadow is cast on a background object that is farther away than a rear object. Can be prevented from being drawn, making it possible to distinguish between back and background objects It can be expressed as follows.
[0012] (Configuration 4) Configuration 4 is the above configuration 1, further comprising: In drawing, for a given object, the normal vector is set to the position of the virtual camera. The drawing may be performed by deforming the shape so as to approximate the direction in which the shape is facing.
[0013] According to the above configuration example, not only the shadow but also the object itself can be rendered in a 2D style. This allows for a uniform look.
[0014] (Configuration 5) The configuration 5 is the configuration 4, further comprising: a computer that calculates a depth direction of the normal vector. The direction component is scaled by a predetermined factor and the length of the normal vector is normalized. In this way, the image may be deformed so as to approach the direction in which the virtual camera is facing.
[0015] According to the above configuration example, the normal vector can be transformed using a simple calculation method, thereby reducing the processing load. It is possible to do so.
[0016] (Configuration 6) Configuration 6 is the above-mentioned configuration 2, further comprising: a computer that is further configured to display a play arranged in the virtual space. For multiple character objects including ear character objects, When drawing to the buffer, a second object is added so that each character object has a different depth value. An offset may be added for rendering.
[0017] According to the above configuration example, a plurality of character objects are arranged on the same axis in the virtual space. Even if the character objects are in the same position, they may appear to be embedded in each other when drawn. This can prevent such an expression from occurring. Also, the degree of occlusion is not attenuated by the difference in depth. Therefore, even if the depth value is changed, it does not affect the method of drawing the shadow. Effect of the Invention
[0018] According to the present disclosure, in a game that uses images based on orthogonal projection, it is possible to draw 2D game-like shadows. can. [Brief description of the drawings]
[0019] [Figure 1] A block diagram showing the hardware configuration of the game device 2. [Diagram 2] A diagram to explain the imposed expression of a 3D model [Diagram 3] A diagram to explain the imposed expression of a 3D model [Figure 4] A diagram to explain the imposed expression of a 3D model [Diagram 5] A diagram to explain the imposed expression of a 3D model [Figure 6] A diagram to explain the imposed expression of a 3D model [Figure 7] A diagram for explaining adjustment of the character's depth value [Figure 8] A diagram for explaining adjustment of the character's depth value [Figure 9] A diagram for explaining adjustment of the character's depth value [Figure 10] Diagram to explain SSAO-related processing [Figure 11] Diagram to explain SSAO-related processing [Figure 12] Diagram to explain SSAO-related processing [Figure 13]Diagram to explain SSAO-related processing [Figure 14] Diagram to explain SSAO-related processing [Figure 15] Diagram to explain SSAO-related processing [Figure 16] Diagram to explain SSAO-related processing [Figure 17] Diagram to explain SSAO-related processing [Figure 18] Diagram to explain SSAO-related processing [Figure 19] Diagram to explain SSAO-related processing [Figure 20] Diagram to explain SSAO-related processing [Figure 21] Diagram to explain SSAO-related processing [Figure 22] A memory map showing an example of various data stored in the storage unit 22 of the game device 2. [Diagram 23] Flowchart showing details of drawing process [Figure 24] A detailed flow chart of pixel shader processing [Diagram 25] A detailed flowchart of the post process [Figure 26] A flowchart showing the details of SSAO processing DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] Hereinafter, one embodiment of the present invention will be described.
[0021] [Hardware configuration of game device 2] FIG. 1 is a block diagram showing an example of the hardware configuration of a game device 2 according to this embodiment. In FIG. 1, the game device 2 includes a processor 21. The processor 21 The information processing unit 2 executes various information processes executed in the home device 2. The processor 21 is a CPU (Central Processing Unit). functions and GPU (Graphics Processing Unit) functions It is composed of an SoC (System-on-a-chip) that includes at least In other embodiments, the CPU and the GPU may be separate. The contents of this disclosure are also applicable to a configuration in which graphics processing is performed by a CPU. The processor 21 executes an information processing program (e.g., a game program) stored in the storage unit 22. The memory unit 22 executes various information processing by executing the program. For example, flash memory and DRAM (Dynamic Random Access Memory) The memory may be an internal storage medium such as a memory card, or an external storage medium inserted in a slot (not shown). A configuration using a storage medium, etc. may also be used.
[0022] The game device 2 also includes a communication unit 23 for communicating with other game devices and a predetermined server. Equipped with.
[0023] In addition, the game device 2 is connected to the controller 26 via wired or wireless communication. The controller 24 is provided for this purpose.
[0024] The game device 2 also receives a display unit 27 (for example, a television) via an image and sound output unit 25. The processor 21, for example, outputs an image generated by executing the above information processing. The images and sounds are output to the display unit 27 via the image and sound output unit 25 .
[0025] [Processing assumed in this embodiment] Next, an overview of the processing assumed in this embodiment will be described. Let us assume that the game uses game images captured by orthogonal projection. For example, In this game, the player uses the controller 26 to The layer character can be moved. Also, the player character's movement The virtual camera is controlled to move in the same way as the screen scrolls horizontally (or vertically). In this embodiment, the game image is expressed by orthogonal projection in a 2D game. In order to make it look like a movie, various techniques have been used for the drawing process. The darting itself is done using 3DCG techniques, but the appearance is more like a 2D game. The 2D game-like appearance is, for example, the appearance of 3D model characters. A way of showing the image with less three-dimensionality and depth than when it is drawn using normal processing. In this embodiment, specifically, the following processing is devised. The combined effect of these processes makes it possible to create a more 2D game-like appearance. (1) Imposing a 3D model (2) Adjusting the character's depth value in the depth test (3) SSAO-related processing for character shadow expression An overview of each process will be explained below.
[0026] [3D model imposition] In this embodiment, each character is created as a 3D model. When you draw without touching the model, the resulting image has shading based on the model's contours, creating a three-dimensional effect. In this embodiment, in the processing of the vertex shader, the vertex normal is expressed as By deforming the 3D model, it appears as if the 3D model is pressed onto the screen. An example of a part of a model before and after transforming the vertex normals is shown in Figure 2. The left side shows an example before deformation, and the right side shows an example after deformation. 1 is a diagram showing a cross section of a part of a 3D model having a curved surface, the cross section being parallel to the Z axis. In Figure 2, the vertex normals on the virtual camera side (the side closest to the viewpoint) are approximately radial. In this embodiment, the vertex shader process is performed as shown in FIG. As shown in the figure, the direction of each vertex normal is set to face the virtual camera position (the front direction of the virtual camera). The Z axis is the horizontal axis. The components are scaled by a certain factor and their lengths are normalized. For example, Let us assume that we have a normal vector as shown in Figure 3. Let us take the Z-axis component as an example, as shown in Figure 4. For example, we double the size and normalize the length as shown in Figure 5. By transforming the normal vector, the direction of the normal vector is moved closer to the virtual camera. This makes it possible to reduce shadows even when lighting is applied. This gives the image a more flat appearance. Also, in this case, when viewed from the virtual camera, The 3D model appears to have a flat shape as shown in Figure 6. The normal transformation may be applied to the entire 3D model or to only a part of it. For example, a 3D model's head may be transformed using normals, but the torso may not. It is also possible to not perform any transformation. In this example, the 3D model is relatively small in size. I don't want to add too much shading to the head, because I want to make it easier to see the changes in facial expressions. This is useful in such cases.
[0027] [Adjusting the character's depth value (Z coordinate) in the depth test] As described above, in the game of this embodiment, the three-dimensional virtual space is expressed by orthogonal projection. Therefore, models that are aligned on the same depth axis in the virtual space are drawn as they are. If you do this, it may appear that part of one model is embedded in another model. For example, consider a multiplayer game with four players. As shown above, the four player characters are in the Z direction, which is the depth direction (the direction of the virtual camera). The distance between the two points is the same on the axis, but close to each other on the left-right axis (X-axis in Fig. 7). In this case, a part of one player's character may be blocking the other player's character. There is a possibility that the image may appear to be embedded in the character (see Figure 8 for example). In this example, during the so-called depth test (also called Z test), An offset value that makes the depth value (Z coordinate) of each player character different. and write it to the depth buffer (also called the Z buffer). The offset value used in the depth test is called the "depth test offset value." This is called the "Z value." As a result, the position of each player character on the Z axis is The pixel drawing process is carried out after constructing a positional relationship so that there is no overlap. In addition, the occurrence of the above-mentioned sinking expression is avoided. The Z-axis position in virtual space before the offset is applied is used as the reference. In other words, the main game processing is performed based on the actual Z-axis position in the virtual space. When drawing the game image that is the result of game processing, add the offset value as shown above. This means that the depth values are changed and then the image is drawn.
[0028] In addition, the above offset value for depth testing can be used only by the player character. It may be used for other character objects as well. All character objects that appear in the scene have different depth values. A suitable offset value for the depth test may be set in advance. Then, the depth buffer is calculated using the offset value for the depth test set for each character. Alternatively, the information may be written to the
[0029] [SSAO-related processing for character shadow expression] Next, let us consider the Screen Space Ambient Occlusion (SSAO) in this embodiment. This section provides an overview of the SSAO process. Since SSAO itself is a known technique, a detailed explanation is not provided. I won’t go into detail here, but this is how the amount of ambient light changes depending on the surrounding obstructions at a certain point of interest. Ambient Occlusion (AO) is a feature that shows how much of a light is being attenuated by the screen. This is a method of calculating only the area of the screen. This is a method for approximately calculating the degree of occlusion from the surrounding environment for a position in a virtual space. There are several known algorithms for SSAO, but the basic The algorithm is as follows: First, SSAO is performed as a post-process. As a preliminary step, depth information is used when rendering a given scene. In SSAO processing, the following is done for each pixel: The following process is performed: First, a pixel is selected as the point of interest, and the surrounding positions are calculated. Random sampling is performed. The number of samples is arbitrary, but The more the number of points, the higher the accuracy, but the higher the computation load. For example, the position of the sampling point projected onto the clipping space is calculated. Then, the depth value of the sampling point and the depth information of the sampling point are calculated. The depth value of the coordinates corresponding to the ring points is compared with the depth value of the ring points. For example, it is possible to determine whether the sampling point is located at a depth value If is smaller than the depth value in the depth information, the sampling point is not occluded. Such a comparison is performed for each sampling point, and the occluded Based on the ratio of the number of sampling points that are blocked, a "blocking coefficient" is determined. Based on the coefficient, it determines whether to draw a shadow at the point of interest and the strength of the shadow at the point of interest. do.
[0030] In this embodiment, for example, a positional relationship as shown in FIG. Assume that the shadow of the player character is drawn on a rear object behind the player character. In such a case, when expressing the shadow of the player character, the above SSAO The processing is further controlled as follows to render shadows in a 2D game style. (A) Sampling point offset control (B) Control that ignores light attenuation due to distance in the depth direction
[0031] [About offset control of sampling points] In this embodiment, after sampling points around the point of interest are taken, the depth value of the depth information is calculated. When comparing, a certain offset value is added to the position of the sampling point before the comparison. Below, the offset value used in the SSAO processing is referred to as the "SSAO offset value." For example, suppose that the sampling points are determined at the positions shown in FIG. is a diagram showing the positional relationship between the attention point, sampling points, and light source in a virtual space. In FIG. 11, the Z axis corresponds to the depth direction of the screen. For the ring points, add the SSAO offset value toward the light source direction as shown in Figure 12. Then, based on the offset sampling points, the depth information is compared with the depth value. Therefore, in the example of Figure 12, the sampling point is offset, resulting in Let the ring point be closer to the obstruction (e.g., the player character in Figure 10). As a result, the comparison is more likely to be "occluded" than in the case of Figure 11. This results in a larger percentage of sampling points being treated. Regarding points of interest (pixels) where shadows are not drawn using normal SSAO processing, In particular, the shadow of the player character and the back object as shown above can be drawn. When considering the relative position of the target, the shading coefficient is set low in normal SSAO processing. The shielding coefficient can be set higher for the point of interest. This allows the shadow of the player character reflected on the object to be more clearly displayed. It can render shadows like those in 2D games. For example, in normal SSAO processing, the shadows are as shown in Figure 13. In Figure 13, the shadow of the player character is assumed to be The figure shows an example of a shadow, and in the upper left corner is an enlarged view of the area around the head. As you can see, in the example in Figure 13, no shadow is drawn on the pixel of interest. In contrast, in this embodiment, the sampling points are offset to process SSAO. By doing this, it is possible to add shadows as shown in Fig. 14. In Fig. 14, The result is that the shadow is drawn on the cell. This is because the sampling point for the point of interest It is determined that the percentage of the points that are "shielded" is high, and as a result, the shielding coefficient for this point of interest is This is because the shadows created by the normal drawing method are not as clear as those created by the normal drawing method. Compared to the previous version, the shadow width is thicker, and the player character looks more It can be made to look like a 2D game.
[0032] [Control to ignore attenuation of occlusion degree due to distance in the depth direction] Next, a control that ignores the attenuation of the degree of occlusion due to the distance in the depth direction will be described. As described above, in this embodiment, the three-dimensional space is rendered using orthogonal projection, so the game image has no perspective. For example, on the screen, the following is displayed as in Figure 15: Even if the images appear to overlap at the same depth, As shown in Figure 16, the positions on the depth (imaging) axis are different. Even in images where two background objects appear to be side-by-side, This is, for example, in terms of ease of game development (level design and map design). For reasons of game processing, etc., the configuration of the virtual space of the game is based on orthogonal projection. A virtual space with rear object arrangement as shown in FIG. 16 may also be used.
[0033] For example, in the virtual space, two players are placed in the positional relationship shown in FIG. In Fig. 17, we assume that there is a player character B and a back character C. Object B is close to the player character B in terms of the distance in the depth direction. The positional relationship is such that the rear object B is directly behind the player. Character A and back object A are far apart in terms of the distance in the depth direction. In this positional relationship, normal rendering processing ( When normal SSAO processing is performed, the shadow of the player character is, for example, as shown in Figure 18. In other words, for player character B, The shadow is cast on the back object B. In other words, the back object B A part of the scene is considered to be highly obscured by player character B. On the other hand, for the player character A, the distance between the player character A and the rear object A is There is a distance in the direction of travel. In normal SSAO processing, the distance between the sample point and the occluding object is If the difference is large, the degree of occlusion is attenuated to reduce the shadow of occlusion by objects at a distance. Since it is common to make the object less susceptible to noise, the rear object A is the player character. As a result, the back object A is not occluded by the back object B. The shadow of character A is not drawn in the image. In other words, with the general SSAO processing, takes into account the difference in depth between the position of the occluding object and the position of the shadow of that occluding object, Shadows are expressed by reducing the degree of occlusion.
[0034] In this respect, in the present embodiment, the degree of occlusion is not attenuated based on the difference in depth. In other words, the difference in depth is ignored when performing SSAO processing. As a result, the shadow representation shown in Figure 19 is obtained. In Figure 19, the actual depth in the virtual space is Regardless of the difference in the direction, the shadow of player character A is drawn on the back object A. In addition, in Fig. 19, the offset for the above sampling point is This shows the results of adding the background color, which is strange when you think of it as a 2D game. In addition, the above back objects are arranged to have multiple layers (depth). In this case, the object may be placed multiple times in the virtual space. Each back object can have a shadow drawn on it, and these multiple back objects can be used to It can be made to appear as if they are on the same level.
[0035] In addition, in this embodiment, the shadow rendering based on the SSAO is further performed. For example, as shown in FIG. 20, Assume that a background object and a back object are placed. In this case, the rear object appears to be directly behind the player character, The background objects are in the distance, not just behind the player character. In this case, the shadow (of the player character) is drawn on the back object. However, by not drawing the shadow on the background object, this perspective can be achieved. For example, if the difference in depth is ignored, If only the control is performed, shadows will be drawn on the background objects as well. In this mode, pixels corresponding to background objects are excluded from the SSAO-based shadow drawing. In this embodiment, pixels where a shadow should not be drawn are designated as "mask pixels." This control is done in the form of ". In other words, the pixel where you want to draw the shadow ( In the case of Figure 20, the mask image is covered except for the pixels where the back object is drawn. Then, when drawing the shadows determined based on SSAO, this mask image is used. By using this function, the shadow is not drawn in the masked area. An example of a screen where shadows are not drawn in the background is shown in Figure 21. The shadow of the object is drawn on the back object (the corresponding pixel), but the background object The object (its corresponding pixels) are shown as not being painted.
[0036] [Details of the processing in this embodiment] Next, the drawing process in this embodiment will be described in more detail with reference to FIGS. Reveal.
[0037] [About data usage] First, various data used in the processing of this embodiment will be described. 1 is a memory map showing an example of various data stored in the memory unit 22 of the device 2. 2 stores a game program 601 and object data 602. The program 601 is a program for executing game processing including image processing according to this embodiment. The object data 602 includes the player character, the back object, This is data for various objects that appear in the game, such as background objects. For example, It includes data on 3D models of each object, etc.
[0038] The storage unit 22 also includes a frame buffer used as a memory area dedicated to image processing. The frame buffer 603 includes a primary buffer 604, a back buffer 605, and a A buffer 605, a depth buffer 606, a stencil buffer 607, etc. may be stored. The primary buffer 604 stores the image that will ultimately be output as the game image. The back buffer 605 stores the gain during the rendering process (rendering pipeline). In other words, when a scene is drawn, the drawing process requires a background image. The image is written to the back buffer 605, and the final completed image in the back buffer 605 is The image is transferred to the primary buffer 604 and output as a game image. The buffer 606 is a temporary memory for storing depth data for each pixel of the game image. The depth buffer 606 represents the distance from the virtual camera for each pixel. The stencil buffer 607 can also be used as the depth information displayed by the stencil. The above code is used to determine which pixels should or shouldn't have AO-based character shadows. This is a temporary memory area for holding data corresponding to the mask image.
[0039] Next, the details of the processing in this embodiment will be described. Here, the processing will be mainly performed in the drawing process described above. The process will be described below, and other details of the game process will be omitted. In the embodiment, one or more processors read a program stored in one or more memories. By executing the above, the following flowchart is realized. The above is just one example of a process. If you can get similar results, The order of processing each step may be changed. Also, the values of variables and The threshold values shown are merely examples, and other values may be used as necessary.
[0040] FIG. 23 is a flowchart showing the details of the drawing process according to this embodiment. In order to draw an image captured by a virtual camera in a virtual space in which various objects are placed, This process is repeated multiple times per second depending on the frame rate.
[0041] First, in step S1, the processor 21 executes a vertex shader process. This is a coordinate conversion process that determines where each vertex of a polygon is drawn on the game image (main In this example, an orthogonal projection matrix is used), the process of determining the color of each vertex (lighting process), Then, a process for determining the position of the texture to be pasted is performed. In the processing of the vertex shader, for a given object, using the above-mentioned Figs. 2 to 6, The process of transforming vertex normals as described above is also performed. The Z component of the vertex normal is then scaled and normalized. The vertex shader process also performs lighting processing, but at this point, Lighting is performed using the original depth values without adding the test offset values. It can be done.
[0042] Next, in step S2, the processor 21 executes the process of the rasterizer. Since the process of the isa is already known, we will not go into detail here. The process of generating triangles that make up polygons from the processed vertex data and filling them with pixels The process is carried out.
[0043] Next, in step S3, the processor 21 executes the pixel shader process. FIG. 24 is a flowchart showing the details of the pixel shader process. First, in step S11, the processor 21 executes a depth test process. The depth value of each pixel determines whether it is hidden by other pixels. The depth test process is performed to prevent pixels that are not drawn. To determine whether a pixel is occluded, the pixel's depth value is written to the depth buffer 606. At this time, in this embodiment, the process described with reference to FIGS. The depth test offset value is added to the character object's depth value before the depth test. The data is written to the buffer 606 .
[0044] Next, in step S12, the processor 21 executes the processing of other pixel shaders. For example, the processor 21 may perform pixel processing such as texture mapping, alpha testing, etc. After that, the processor 21 finishes the pixel shader processing. Complete.
[0045] Returning to FIG. 23, next, in step S4, the processor 21 executes a post-process. In the post-processing, various operations are performed on the image generated as a result of the pixel shader processing. The image effects are added to the image. Figure 25 shows the details of the post-processing. 1 is a flowchart.
[0046] In FIG. 25, first, in step S21, the processor 21 executes the SSAO process. As mentioned above, there are several known SSAO algorithms. As an example, we will show an example of processing based on a technique called Alchemy AO. FIG. 26 is a flowchart showing the details of the SSAO process. In step S31, the processor 21 determines a pixel to be a point of interest.
[0047] Next, in step S32, the processor 21 selects a plurality of sampling points based on the point of interest. For example, consider a hemisphere in the normal direction of the point of interest, and determine a randomly selected position within this hemisphere. The sampling points are determined as the world space (cl The distance is determined within the space (which may be the ripping space).
[0048] Next, in step S33, the processor 21 calculates each of the determined sampling points as Using the depth buffer 606 (i.e., depth information) generated by the pixel shader processing This determines the location of the sampling points in screen space.
[0049] Next, in step S34, the processor 21 calculates each sampling point in the screen space. Add the above SSAO offset value toward the light source. The set value may be any value. For example, it may be a value determined in advance or may be determined by using a predetermined formula. The value may be automatically calculated each time.
[0050] Next, in step S35, the processor 21 calculates vectors from the point of interest to each sampling point. Calculate the coefficient A for each.
[0051] Next, in step S36, the processor 21 calculates the normal vector B of the target point and the calculated Calculate the inner product of each of the vectors A.
[0052] Next, in step S37, the processor 21 calculates the average value of the calculated inner products. The processor 21 then determines the shielding coefficient based on the average value.
[0053] In the normal SSAO process, when determining the shading coefficient based on the above inner product, In order to take into account the attenuation of the degree of occlusion (attenuation of the amount of light) depending on the distance in the direction of travel, However, in this embodiment, the calculation of "divide by the length of the As explained above, there is no attenuation of the occlusion degree based on the difference in depth. I want to draw the character's shadow. To do this, after calculating the above dot product, I calculate the length of vector A. The calculation of "dividing by" is not performed, but the average value is calculated directly.
[0054] Next, in step S38, the processor 21 determines the above based on the determined shielding coefficient. The darkness (strength) of the shadow for the point of interest is determined. The shadow density determined based on the processing is assumed to be constant. In other words, in this example, the result is It's a simple binary decision: add shadow or don't add shadow.
[0055] Next, in step S39, the processor 21 determines the shadow (hereinafter referred to as the shadow) determined by the SSAO processing. We generate an SSAO shadow image, which is a texture image that represents the image of the SSAO shadow (hereinafter referred to as SSAO shadow). When drawing a shadow for a point of interest, the texel corresponding to that point is drawn in black. Therefore, in the SSAO shadow image, for example, only the parts with SSAO shadows are black. The result is a textured image that looks like it has been painted.
[0056] Next, in step S40, the processor 21 performs the above steps for all pixels. It is determined whether the processes in steps S31 to S39 have been performed. If there are any unprocessed pixels, If the result of step S40 is NO, the process returns to step S31 and the process is repeated. When the above process is completed for the pixel (YES in step S40), the processor 21 Ends SSAO processing.
[0057] Returning to FIG. 25, next, in step S22, the processor 21 A stencil buffer 607 is generated with contents that mask the outside. Then, the processor 21 converts the SSAO shadow image into the result of the pixel shader. At this time, the stencil buffer 607 is used to synthesize the SSAO shadow image. This means that, for example, SSAO shadows are drawn on the back object, but , an image may be generated in which SSAO shadows are not drawn on background objects.
[0058] Next, in step S24, the processor 21 executes various processes related to other post-processing. For example, the processor 21 performs the above-mentioned pixel processing (processing for applying various effects). The image generated by the light shader is processed by applying depth of field and anti-aliasing. Then, the processor 21 performs post-processing such as applying astigmatism and blooming. End the process.
[0059] Returning to FIG. 23, next, in step S5, the processor 21 performs The generated final rendered image (stored in the back buffer 605 in this example) ) to the primary buffer 604.
[0060] Next, in step S6, the processor 21 outputs the image in the primary buffer 604 to the display unit. Output to 27.
[0061] After that, the processor 21 ends the drawing process.
[0062] This concludes the detailed description of the drawing process of this embodiment.
[0063] In this way, in this embodiment, the sampling points are offset toward the light source during SSAO processing. In addition, in this embodiment, the occlusion detection based on the depth difference is performed. The system also performs control to ignore the attenuation of the degree of shadow. When drawing on a background object, the range in which the shadow cast on the background object is drawn is specified as This expands the scope of the effect, making it possible to express shadows in a 2D game style.
[0064] In this embodiment, the vertex shader is used to The vertex normals are transformed so that they face the light source direction. The above SSAO processing can be used to create a more flat character. By combining this with the expression of the character's shadow, it is possible to reproduce the 3D model character and its shadow in a 2D game. It is possible to create a unified look as the image is styled after the original.
[0065] In this embodiment, during the depth test, a different depth is assigned to each character object. Add the depth test offset value to the depth buffer so that the value is the desired value. As mentioned above, SSAO processing ignores the difference in depth and draws shadows. Therefore, even if the depth value is changed during the depth test, the effect of the change is not significant. This allows the character's shadow to be drawn without being affected by the orthographic projection. The game has a 2D game look, but also features characters sliding into each other. This allows game images to be drawn without using the mouse, resulting in a greater synergistic effect.
[0066] [Variations] In the above embodiment, the Alchemy AO is used as an example of the SSAO process. This is an example of the process that was used to achieve this. This is not limited to this, and the above process can be used with other SSAO algorithms. You can also offset the sampling points and then compare the depth values. stomach.
[0067] In another embodiment, instead of directly offsetting the sampling points, The sampling point is determined based on the offset point. Good too.
[0068] In the above embodiment, the drawing process is executed in a single game device 2. In another embodiment, these processes are performed by an information processing system consisting of multiple information processing terminals. For example, the present invention may be implemented in a system that includes a terminal device and a network. In an information processing system including a server side device capable of communicating via a A part of the processes may be executed by a server-side device. In this case, the server-side system is composed of multiple information processing terminals, and is executed on the server side. The processing to be performed may be shared and executed by a plurality of information processing terminals. [Explanation of symbols]
[0069] 2. Gaming Devices 21 Processors 22 Memory section 26 Controller 27 Display section
Claims
1. In the computer of the information processing device, In a virtual space in which at least multiple character objects, including a player character object, and multiple back objects arranged in layers behind the multiple character objects at different depths, the player character object and the virtual camera are controlled to at least: By orthographic projection and depth testing, and further by adding an offset to the multiple character objects so that each character object has a different depth value, the virtual space is drawn to the frame buffer. An occlusion determination method based on SSAO (Screen Space Ambient Occlusion), wherein for each pixel, the degree of occlusion is determined based on an occlusion determination method that compares the depth values of multiple sample points set around the position in the virtual space corresponding to the pixel with the depth of the corresponding position in the depth buffer, without attenuating the degree of occlusion based on the difference in depth. Further drawing of shadows on pixels in the frame buffer corresponding to the portion determined to have a high degree of occlusion. Game program.
2. Within the aforementioned virtual space, background objects are placed even further behind the aforementioned back object. To the aforementioned computer, The game program according to claim 1, which causes the shadow to be drawn while excluding pixels corresponding to the background object.
3. The aforementioned computer further: The game program according to claim 1, wherein, in drawing the virtual space to the frame buffer, the normal vector of a predetermined object is deformed to approach the direction facing the virtual camera's position before drawing.
4. To the aforementioned computer, The game program according to claim 3, wherein the normal vector is deformed by scaling the depth component by a predetermined magnification and then normalizing the length of the normal vector so that it approaches the direction that the virtual camera faces a certain position.
5. A game system equipped with a computer, The aforementioned computer, In a virtual space in which at least multiple character objects, including a player character object, and multiple back objects arranged in layers behind the multiple character objects at different depths, the player character object and the virtual camera are at least controlled. By orthographic projection and depth testing, and further by adding an offset to the multiple character objects so that each character object has a different depth value, the virtual space is drawn to the frame buffer. An occlusion determination method based on SSAO (Screen Space Ambient Occlusion), wherein for each pixel, the degree of occlusion is determined based on an occlusion determination method that compares the depth values of multiple sample points set around the position in the virtual space corresponding to the pixel with the depth of the corresponding position in the depth buffer, without attenuating the degree of occlusion based on the difference in depth. Further drawing of shadows on pixels in the frame buffer corresponding to the portion determined to have a high degree of occlusion. Game system.
6. Within the aforementioned virtual space, background objects are placed even further behind the aforementioned back object. The aforementioned computer, The game system according to claim 5, wherein the shadow is drawn excluding the pixels corresponding to the background object.
7. The aforementioned computer further, The game system according to claim 5, wherein, in drawing the virtual space to the frame buffer, the normal vector of a predetermined object is deformed to move closer to the direction facing the virtual camera's position before drawing.
8. The aforementioned computer, The game system according to claim 7, wherein the normal vector is deformed by scaling the depth component by a predetermined magnification and then normalizing the length of the normal vector so that it approaches the direction that the virtual camera faces a certain position.
9. A game processing method to be executed by a computer in an information processing device, To the aforementioned computer, In a virtual space in which at least multiple character objects, including a player character object, and multiple back objects arranged in layers behind the multiple character objects at different depths, the player character object and the virtual camera are controlled to at least: By orthographic projection and depth testing, and further by adding an offset to the multiple character objects so that each character object has a different depth value, the virtual space is drawn to the frame buffer. An occlusion determination method based on SSAO (Screen Space Ambient Occlusion), wherein for each pixel, the degree of occlusion is determined based on an occlusion determination method that compares the depth values of multiple sample points set around the position in the virtual space corresponding to the pixel with the depth of the corresponding position in the depth buffer, without attenuating the degree of occlusion based on the difference in depth. Further drawing of shadows on pixels in the frame buffer corresponding to the portion determined to have a high degree of occlusion. Game processing method.
10. Within the aforementioned virtual space, background objects are placed even further behind the aforementioned back object. To the aforementioned computer, The game processing method according to claim 9, wherein the shadow is drawn while excluding pixels corresponding to the background object.
11. The aforementioned computer further: The game processing method according to claim 9, wherein, in drawing the virtual space to the frame buffer, the normal vector of a predetermined object is deformed to approach the direction facing the virtual camera's position before drawing.
12. To the aforementioned computer, The game processing method according to claim 11, wherein the normal vector is deformed by scaling the depth component by a predetermined magnification and then normalizing the length of the normal vector so that it approaches the direction that the virtual camera faces a certain position.
13. A game device equipped with a computer, The aforementioned computer, In a virtual space in which at least multiple character objects, including a player character object, and multiple back objects arranged in layers behind the multiple character objects at different depths, the player character object and the virtual camera are at least controlled. By orthographic projection and depth testing, and further by adding an offset to the multiple character objects so that each character object has a different depth value, the virtual space is drawn to the frame buffer. An occlusion determination method based on SSAO (Screen Space Ambient Occlusion), wherein for each pixel, the degree of occlusion is determined based on an occlusion determination method that compares the depth values of multiple sample points set around the position in the virtual space corresponding to the pixel with the depth of the corresponding position in the depth buffer, without attenuating the degree of occlusion based on the difference in depth. Further drawing of shadows on pixels in the frame buffer corresponding to the portion determined to have a high degree of occlusion. Game device.
14. Within the aforementioned virtual space, background objects are placed even further behind the aforementioned back object. The aforementioned computer, The game device according to claim 13, wherein the shadow is drawn excluding the pixels corresponding to the background object.
15. The aforementioned computer further, The game device according to claim 13, wherein, in drawing the virtual space to the frame buffer, the normal vector of a predetermined object is deformed to approach the direction facing the virtual camera's position before drawing.
16. The aforementioned computer, The game device according to claim 15, wherein the normal vector is deformed by scaling the depth component by a predetermined magnification and then normalizing the length of the normal vector so that it approaches the direction facing a certain position of the virtual camera.