Search

CN-121999109-A - Method, apparatus, device, medium and program product for rendering pixelated effects

CN121999109ACN 121999109 ACN121999109 ACN 121999109ACN-121999109-A

Abstract

The present disclosure relates to the technical field of computer graphics, and provides a method, a device, equipment, a medium and a program product for rendering a pixelated effect, wherein the method for rendering the pixelated effect of the present disclosure includes obtaining first texture coordinate data corresponding to a target texture of a virtual object surface; the method comprises the steps of performing discretization processing on first texture coordinate data to obtain second texture coordinate data distributed in a step shape, obtaining disturbance data, wherein the disturbance data are used for representing noise offset aiming at the second texture coordinate data, performing offset operation on the second texture coordinate data by utilizing the disturbance data to obtain third texture coordinate data, and finally sampling a target texture according to the third texture coordinate data to generate a rendering result with dynamic pixelated visual characteristics. According to the technical scheme, pixelation and dynamic disturbance of texture sampling can be realized, and the artistic expression of rendering is improved.

Inventors

  • WANG MINJIE
  • Lin Zizhou

Assignees

  • 网易(杭州)网络有限公司

Dates

Publication Date
20260508
Application Date
20251225

Claims (12)

  1. 1. A method of rendering pixelated effects, the method comprising: Acquiring first texture coordinate data corresponding to a target texture of the surface of the virtual object; Discretizing the first texture coordinate data to obtain second texture coordinate data; Obtaining disturbance data, and carrying out offset disturbance on the second texture coordinate data through the disturbance data to obtain third texture coordinate data, wherein the disturbance data is used for representing noise offset aiming at the second texture coordinate data; And sampling the target texture through the third texture coordinate data to generate a rendering result with a pixelated effect.
  2. 2. The method of claim 1, wherein discretizing the first texture coordinate data to obtain second texture coordinate data comprises: Acquiring preset quantization step parameters; Multiplying the first texture coordinate data by the quantization step parameter to obtain intermediate coordinate data; Performing upward rounding operation on the intermediate coordinate data to obtain rounded coordinate data; and dividing the rounded coordinate data by the quantization step parameter to obtain the second texture coordinate data.
  3. 3. The method of claim 1, wherein the obtaining disturbance data comprises: acquiring a preset noise texture; and sampling the preset noise texture based on the second texture coordinate data to obtain the disturbance data.
  4. 4. A method according to claim 3, wherein said sampling the predetermined noise texture based on the second texture coordinate data comprises: acquiring preset time parameters and speed parameters; determining a first offset according to the time parameter and the speed parameter; The first offset is added to the second texture coordinate data to generate sampling coordinate data; And sampling the noise texture by using the sampling coordinate data.
  5. 5. The method of claim 1, wherein said offset perturbing said second texture coordinate data by said perturbation data comprises: mapping the disturbance data to a preset numerical interval to generate a second offset with positive and negative directions; multiplying the second offset by a preset disturbance intensity parameter to obtain a noise offset; And adding the noise offset to the second texture coordinate data to obtain the third texture coordinate data.
  6. 6. The method according to any one of claims 1 to 5, wherein the step of generating a rendering result with a pixelated effect further comprises: Calculating a gradient value of the disturbance data in a screen space; And when the gradient value is larger than a preset edge threshold value, generating the tracing data, and adding the tracing data into the rendering result.
  7. 7. The method of claim 6, wherein the calculating gradient values of the perturbation data in screen space comprises: calculating horizontal partial derivatives and vertical partial derivatives of the disturbance data in a screen space; and obtaining the gradient value according to the absolute value of the horizontal partial derivative and the absolute value of the vertical partial derivative.
  8. 8. The method according to claim 1, wherein the method further comprises: acquiring mask data corresponding to the target texture; Generating a weight mask according to the mask data, and carrying out interpolation mixing on the original color of the target texture and the rendering result with the pixelation effect through the weight mask so as to control the pixelation rendering degree of the rendering result.
  9. 9. A pixelated effect rendering apparatus, the apparatus comprising: The acquisition module is used for acquiring first texture coordinate data corresponding to the target texture of the virtual object surface; the discretization module is used for discretizing the first texture coordinate data to obtain second texture coordinate data; the disturbance module is used for acquiring disturbance data, and carrying out offset disturbance on the second texture coordinate data through the disturbance data to obtain third texture coordinate data, wherein the disturbance data is used for representing noise offset aiming at the second texture coordinate data; and the rendering module is used for sampling the target texture through the third texture coordinate data so as to generate a rendering result with a pixelation effect.
  10. 10. An electronic device, comprising: A memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of rendering pixelated effects of any of claims 1 to 8.
  11. 11. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the method of rendering a pixelated effect according to any of claims 1 to 8.
  12. 12. A computer program product comprising computer instructions for causing a computer to perform the method of rendering pixelated effects of any one of claims 1 to 8.

Description

Method, apparatus, device, medium and program product for rendering pixelated effects Technical Field The present disclosure relates to the field of computer graphics technology, and in particular, to a method, apparatus, device, medium, and program product for rendering pixelated effects. Background In the existing texture rendering and image processing technology, in order to achieve a specific visual style or texture effect, linear interpolation, simple noise dissolution, basic image downsampling and other modes are generally adopted. However, the existing linear interpolation mode is smooth and single in visual performance and lacks of unique stylized tension, and the conventional pixelation processing technology is usually only used for carrying out simple static quantization on texture coordinates or carrying out low-resolution resampling on images, so that the generated pixelation effect presents mechanical and stiff square arrangement, lacks of natural dynamic change and abundant detail levels, and is difficult to meet the requirements of high-quality stylized art rendering. Therefore, a method for rendering a pixelated effect is needed to solve the problems of stiffness, lack of dynamic variation and single visual expression of the pixelated rendering effect in the related art. Disclosure of Invention The present disclosure provides a method, apparatus, device, medium and program product for rendering pixelated effects to solve the problems of stiffness, lack of dynamic variation and single visual expressive force of pixelated rendering effects in the related art. In a first aspect, the present disclosure provides a method of rendering a pixelated effect, the method comprising: Acquiring first texture coordinate data corresponding to a target texture of the surface of the virtual object; discretizing the first texture coordinate data to obtain second texture coordinate data; Obtaining disturbance data, and carrying out offset disturbance on the second texture coordinate data through the disturbance data to obtain third texture coordinate data; And sampling the target texture through the third texture coordinate data to generate a rendering result with a pixelation effect. According to the method for rendering the pixelized effect, the first texture coordinate data of the virtual object is obtained and discretized, and the original continuous smooth coordinate mapping is converted into the stepped second texture coordinate data, so that visual mosaic or pixel blocking is directly achieved from the bottom data in the texture sampling stage, the smooth feeling of traditional rendering is broken, further, offset disturbance is conducted on the discretized coordinates through the introduction of disturbance data, and the generated pixel blocks are not dead static grids any more, but can display dynamic dislocation effects similar to signal interference or data flow. The discretization and disturbance technology combination ensures that the final sampling result presents the visual effect with the style of antique pixels and the natural dynamic change, thereby improving the expressive force and interactive texture of the rendered picture. In an alternative embodiment, discretizing the first texture coordinate data to obtain second texture coordinate data includes: Acquiring preset quantization step parameters; multiplying the first texture coordinate data by the quantization step parameters to obtain intermediate coordinate data; performing upward rounding operation on the intermediate coordinate data to obtain rounded coordinate data; dividing the rounded coordinate data by the quantization step parameter to obtain second texture coordinate data. The present disclosure is also capable of precisely dividing continuous texture coordinates into uniformly sized grid cells, with the density of the grid being directly controlled by quantization step parameters. The size of the pixel block can be changed in real time by only adjusting one parameter, so that the art requirements of different accuracies are met. In an alternative embodiment, obtaining disturbance data includes: acquiring a preset noise texture; and sampling a preset noise texture based on the second texture coordinate data to obtain disturbance data. The present disclosure samples the noise texture by based on the discretized second texture coordinate data. Since the second texture coordinate data is constant within the same pixel block, the sampled perturbation data is also consistent within the same pixel block. The method ensures that the disturbance is performed by taking the whole pixel block as a unit, and avoids the damage to the integrity of the pixel block caused by the change of disturbance data in the block, thereby ensuring that the final rendering result presents a tidy and clear mosaic style instead of messy noise points. In an alternative embodiment, sampling the preset noise texture based on the second texture coordinate data inc