Resource rendering method, device, equipment and storage medium

文档序号:1207248 发布日期:2020-09-04 浏览:8次 中文

阅读说明:本技术 一种资源渲染方法、装置、设备及存储介质 (Resource rendering method, device, equipment and storage medium ) 是由 刘毅 于 2020-05-28 设计创作,主要内容包括:本申请实施例公开了一种资源渲染方法、装置、设备及存储介质,其中,该方法包括:确定待编辑的目标场景范围以及待渲染的目标资源,该目标资源包括背景资源和装饰元素资源;在该目标场景范围内整体渲染该背景资源;在该目标场景范围覆盖的单元格中确定目标单元格,在目标单元格中渲染该装饰元素资源。该方法将背景资源与装饰元素资源拆分开来,在目标场景范围内分别采用不同的渲染模式渲染背景资源和装饰元素资源;对于背景资源在目标场景范围内进行一次性整体渲染,对于装饰元素资源在目标场景范围内的目标单元格中单独渲染,如此减少因单独渲染每个单元格、拼接合并相邻单元格中的单元模型而造成的处理资源浪费。(The embodiment of the application discloses a resource rendering method, a device, equipment and a storage medium, wherein the method comprises the following steps: determining a target scene range to be edited and a target resource to be rendered, wherein the target resource comprises a background resource and a decoration element resource; rendering the background resource in the target scene range in a whole manner; and determining a target cell in the cells covered by the target scene range, and rendering the decoration element resource in the target cell. The method separates background resources from decoration element resources, and renders the background resources and the decoration element resources in different rendering modes within a target scene range; the background resources are integrally rendered in a target scene range at one time, and the decoration element resources are independently rendered in the target cells in the target scene range, so that the waste of processing resources caused by independently rendering each cell and splicing and merging cell models in adjacent cells is reduced.)

1. A method of resource rendering, the method comprising:

determining a target scene range to be edited and a target resource to be rendered; the target resource comprises a background resource and a decoration element resource;

rendering the background resource within the target scene;

and determining a target cell in the cells covered by the target scene range, and rendering the decoration element resource in the target cell.

2. The method of claim 1, wherein the determining a target cell among the cells covered by the target scene range comprises:

and judging whether resources rendered in peripheral cells around the cells are the same as the resources rendered in the cells or not for each cell in the target scene range, and if at least one peripheral cell in the peripheral cells around the cells is different from the resources rendered in the cells, determining the cells as the target cells.

3. The method of claim 2, wherein the step of determining a target cell among the cells covered by the target scene further comprises:

setting corresponding weights for four peripheral cells positioned around the cell; the weights corresponding to the four peripheral cells are not zero and are different from each other, the sum of any two weights in the weights corresponding to the four peripheral cells is different from each other, and the sum of any three weights in the weights corresponding to the four peripheral cells is different from each other;

for each peripheral cell in the four peripheral cells, judging whether the resources rendered in the peripheral cells are the same as the resources rendered in the cells, if so, determining the weight corresponding to the peripheral cells as the reference weight of the peripheral cells relative to the cells, and if so, determining zero as the reference weight of the peripheral cells relative to the cells;

calculating the sum of the reference weights of the four peripheral cells relative to the cell, and taking the sum as a target weight corresponding to the cell;

and if the target weight value corresponding to the cell is not zero, determining the cell as the target cell.

4. The method of claim 3, wherein the decoration element resource is a border decoration element resource, and the rendering the decoration element resource in the target cell comprises:

determining a deployment mode corresponding to the boundary decoration element resource according to the target weight;

rendering the border decoration element resource in the target cell based on the deployment style.

5. The method of claim 4, wherein the border decoration element resource comprises a plurality of base border decoration resources; the determining a deployment mode corresponding to the boundary decoration element resource according to the target weight includes:

selecting a target decoration element resource from the multiple basic boundary decoration resources according to the target weight;

determining a rotation angle corresponding to the target decoration element resource according to the target weight;

then the rendering the border decoration element resource in the target cell based on the deployment mode comprises:

and performing rotation processing on the target decoration element resource based on the rotation angle, and rendering the target decoration element after the rotation processing in the target cell.

6. The method of claim 4, wherein the border decoration element resource comprises a basic one-sided decoration resource; the determining a deployment mode corresponding to the boundary decoration element resource according to the target weight includes:

determining the number n of the basic unilateral decoration resources needing to be rendered in the target cell according to the target weight, wherein the n is an integer greater than or equal to 1;

determining rotation angles corresponding to m basic unilateral decorative resources in the n basic unilateral decorative resources according to the target weight, wherein m is an integer which is greater than or equal to 0 and less than or equal to n;

then the rendering the border decoration element resource in the target cell based on the deployment mode comprises:

performing rotation processing on the m basic single-sided decoration resources based on the rotation angles corresponding to the m basic single-sided decoration resources respectively;

rendering the m basic single-sided decoration resources subjected to the rotation processing in the target cell, and rendering the basic single-sided decoration resources except the m basic single-sided decoration resources in the n basic single-sided decoration resources.

7. The method of claim 1, wherein determining a target cell among the cells covered by the target scene range, and rendering the decoration element resource in the target cell comprises:

determining the target cells in the target scene range based on user-triggered decoration element deployment operations;

rendering the decoration element resource in the target cell.

8. The method of claim 1, wherein the determining the target scene range to be edited comprises:

when the target scene range positioning operation is determined to be triggered, the position of the control point is used as a starting point;

determining the position of the control point as a termination point when the target scene range positioning operation is finished;

and determining a rectangular range according to the starting point and the end point as the target scene range.

9. The method of claim 1, wherein the determining the target scene range to be edited comprises:

determining a target track of movement of a control point in the process of executing target scene range positioning operation;

and determining the range covered by the cell passed by the target track as the target scene range.

10. An apparatus for resource rendering, the apparatus comprising:

the determining module is used for determining a target scene range to be edited and a target resource to be rendered; the target resource comprises a background resource and a decoration element resource;

a background rendering module for rendering the background resource within the target scene;

and the decoration rendering module is used for determining a target cell in the cells covered by the target scene range and rendering the decoration element resource in the target cell.

11. The apparatus of claim 10, wherein the decoration rendering module comprises:

and the target cell determining unit is used for judging whether resources rendered in peripheral cells around the cell are the same as the resources rendered in the cell or not for each cell in the target scene range, and if at least one peripheral cell in the peripheral cells around the cell is different from the resources rendered in the cell, determining the cell as the target cell.

12. The apparatus according to claim 11, wherein the target cell determining unit is specifically configured to:

setting corresponding weights for four peripheral cells positioned around the cell; the weights corresponding to the four peripheral cells are not zero and are different from each other, the sum of any two weights in the weights corresponding to the four peripheral cells is different from each other, and the sum of any three weights in the weights corresponding to the four peripheral cells is different from each other;

for each peripheral cell in the four peripheral cells, judging whether the resources rendered in the peripheral cells are the same as the resources rendered in the cells, if so, determining the weight corresponding to the peripheral cells as the reference weight of the peripheral cells relative to the cells, and if so, determining zero as the reference weight of the peripheral cells relative to the cells;

calculating the sum of the reference weights of the four peripheral cells relative to the cell, and taking the sum as a target weight corresponding to the cell;

and if the target weight value corresponding to the cell is not zero, determining the cell as the target cell.

13. The apparatus of claim 12, wherein the decoration element resource is a border decoration element resource, and the decoration rendering module comprises:

the decoration rendering unit is used for determining a deployment mode corresponding to the boundary decoration element resource according to the target weight; rendering the border decoration element resource in the target cell based on the deployment style.

14. An apparatus, comprising a processor and a memory;

the memory is used for storing a computer program;

the processor is configured to execute the resource rendering method of any one of claims 1 to 9 in accordance with the computer program.

15. A computer-readable storage medium for storing a computer program for executing the resource rendering method of any one of claims 1 to 9.

26页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种游戏数据处理方法以及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类