CN-122006236-A - Method, apparatus, device, storage medium and program product for controlling special effect patch
Abstract
The application discloses a control method, a device, equipment, a storage medium and a program product of a special effect patch, and relates to the technical field of computers. The method comprises the steps of responding to a first view field angle, obtaining a changed second view field angle, determining a second distance between a target special effect surface patch and a virtual camera under the second view field angle based on the second view field angle and a reference height, and controlling movement of the target special effect surface patch based on the offset between the second distance and the first distance. By implementing the technical scheme of the application, when the angle of the visual field of the virtual camera is changed, the position of the target special effect patch can be automatically adjusted to keep the effect of filling the screen, the picture expression effect is improved, and the manual adjustment workload is reduced.
Inventors
- WANG XIANGKUN
Assignees
- 网易(杭州)网络有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251204
Claims (11)
- 1. A method for controlling a special effect dough sheet, the method comprising: acquiring a first distance between a target special effect surface patch and a virtual camera, a first view field angle corresponding to the virtual camera and a reference height corresponding to the target special effect surface patch; responding to the change of the first view field angle, and acquiring a changed second view field angle; Determining a second distance of the target special effect patch from the virtual camera at the second field of view angle based on the second field of view angle and the reference height; and controlling the movement of the target special effect patch based on the offset between the second distance and the first distance.
- 2. The method of claim 1, wherein obtaining the reference height corresponding to the target special effects patch comprises: And determining the reference height corresponding to the target special effect patch based on the position relation between the first distance and the first view field angle.
- 3. The method of claim 2, wherein the determining the reference height corresponding to the target special effect patch based on the positional relationship between the first distance and the first field of view angle comprises: obtaining a first vision parameter value characterized by a first tangent value of the first field of view angle; And determining the reference height of the target special effect patch based on the fusion result of the first distance and the first vision parameter value.
- 4. The method of any of claims 1-3, wherein the determining a second distance of the target special effects patch from the virtual camera at the second field of view angle based on the second field of view angle and the reference height comprises: obtaining a second vision parameter value characterized by a second tangent value of the second field of view angle; a ratio between the reference height and the second vision parameter value is determined, the second distance being characterized by the ratio.
- 5. The method of claim 1, wherein controlling movement of the target effect patch based on an offset between the second distance and the first distance comprises: Determining a moving direction of the target special effect patch based on an offset between the second distance and the first distance; And controlling the target special effect patch to move a third distance according to the moving direction, wherein the third distance is the same as the offset.
- 6. The method according to claim 1, wherein the method further comprises: judging whether the target special effect patch comprises a plurality of sub special effect patches or not; When the target special effect patches comprise a plurality of sub special effect patches, a first target distance between each sub special effect patch and the virtual camera and a first target reference height corresponding to each sub special effect patch are obtained; Determining a second target distance of each of the sub-special effect patches from the virtual camera at a second field of view angle in response to the first field of view angle changing to the second field of view angle; And controlling the movement of each sub-special effect patch based on a first target offset between the second target distance and each first target distance.
- 7. The method of claim 6, wherein the method further comprises: if the position difference of the plurality of sub-effect patches in the depth direction is smaller than a preset threshold value, determining the plurality of sub-effect patches as an overall effect patch; Acquiring a third target distance between the whole special effect patch and the virtual camera and a second target reference height corresponding to the whole special effect patch; determining a fourth target distance of the overall special effect patch from the virtual camera at the second field of view angle in response to the first field of view angle changing to the second field of view angle; And controlling the movement of the whole special effect patch based on a second target offset between the fourth target distance and the third target distance.
- 8. A control device for a special effect dough sheet, the device comprising: The first acquisition module is used for acquiring a first distance between a target special effect patch and a virtual camera, a first view field angle corresponding to the virtual camera and a reference height corresponding to the target special effect patch; The second acquisition module is used for responding to the change of the first view field angle and acquiring a changed second view field angle; the first determining module is used for determining a second distance between the target special effect patch and the virtual camera under the second view field angle based on the second view field angle and the reference height; and the first control module is used for controlling the movement of the target special effect patch based on the offset between the second distance and the first distance.
- 9. An electronic device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of controlling the special effects patch of any one of claims 1 to 7.
- 10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the control method of the special effect patch according to any one of claims 1 to 7.
- 11. A computer program product comprising computer instructions for causing a computer to perform the method of controlling the special effects patch of any one of claims 1 to 7.
Description
Method, apparatus, device, storage medium and program product for controlling special effect patch Technical Field The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for controlling a special effect patch. Background In virtual scenes such as games, in order to enhance visual impact and immersion of a screen, developers often set special effect tiles such as shock waves, knife light, environmental dust, and the like at positions close to a screen (virtual camera). One of the core design goals of such pre-screen special effects is to fill specific areas of the screen stably and plump at different viewing angles and states to achieve the desired artistic performance. In the related art, when the angle of view of the virtual camera is fixed, by presetting the distance between the special effect patch and the camera, it is possible to make it exhibit a stable and properly sized visual effect on the screen. However, in practical application scenarios, in order to create a specific dramatic effect, such as highlighting a Boss unit or switching the viewing angle, the viewing angle of the virtual camera often needs to be dynamically adjusted. Once the angle of view changes, the display proportion of the original special effect face piece on the screen changes according to the perspective principle, so that unexpected enlargement or reduction phenomenon occurs, and the current screen window cannot be continuously and perfectly adapted, thereby destroying the consistency and the integrity of visual manifestation. Disclosure of Invention In view of the above, the present application provides a method, apparatus, device, storage medium and program product for controlling a special effect patch to solve the problem of unstable special effect display effect. In a first aspect, the application provides a control method of a special effect patch, which comprises the steps of obtaining a first distance between a target special effect patch and a virtual camera, a first view field angle corresponding to the virtual camera and a reference height corresponding to the target special effect patch, obtaining a changed second view field angle in response to the change of the first view field angle, determining a second distance between the target special effect patch and the virtual camera under the second view field angle based on the second view field angle and the reference height, and controlling movement of the target special effect patch based on the offset between the second distance and the first distance. In an alternative embodiment, obtaining the reference height corresponding to the target special effect patch includes determining the reference height corresponding to the target special effect patch based on a positional relationship between the first distance and the first field of view angle. In an alternative embodiment, determining the reference height corresponding to the target special effect patch based on the positional relationship between the first distance and the first field of view angle includes obtaining a first visual parameter value characterized by a first tangent value of the first field of view angle, and determining the reference height of the target special effect patch based on a fusion result of the first distance and the first visual parameter value. In an alternative embodiment, determining a second distance of the target special effect patch from the virtual camera at the second field of view angle based on the second field of view angle and the reference height includes obtaining a second visual parameter value characterized by a second tangent to the second field of view angle, determining a ratio between the reference height and the second visual parameter value, and characterizing the second distance as the ratio. In an alternative embodiment, controlling the movement of the target effect patch based on the offset between the second distance and the first distance includes determining a movement direction of the target effect patch based on the offset between the second distance and the first distance, and controlling the target effect patch to move a third distance in the movement direction, the third distance being the same as the offset. In an alternative implementation, whether the target special effect surface patch comprises a plurality of sub special effect surface patches is judged, when the target special effect surface patch comprises the plurality of sub special effect surface patches, a first target distance between each sub special effect surface patch and the virtual camera and a first target reference height corresponding to each sub special effect surface patch are obtained, a second target distance between each sub special effect surface patch and the virtual camera under a second view field angle is determined in response to the change of the first view fie