CN109242758A - A kind of storage of material parameters, material parameters acquisition methods and device - Google Patents

A kind of storage of material parameters, material parameters acquisition methods and device Download PDF

Info

Publication number
CN109242758A
CN109242758A CN201811087967.2A CN201811087967A CN109242758A CN 109242758 A CN109242758 A CN 109242758A CN 201811087967 A CN201811087967 A CN 201811087967A CN 109242758 A CN109242758 A CN 109242758A
Authority
CN
China
Prior art keywords
material parameters
buffer
index information
acquired
parameter list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811087967.2A
Other languages
Chinese (zh)
Inventor
程佳
黄衫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Xishanju Shiyou Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Original Assignee
Chengdu Xishanju Shiyou Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Xishanju Shiyou Technology Co Ltd, Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Chengdu Xishanju Shiyou Technology Co Ltd
Priority to CN201811087967.2A priority Critical patent/CN109242758A/en
Publication of CN109242758A publication Critical patent/CN109242758A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Abstract

The embodiment of the invention provides a kind of storage of material parameters, material parameters acquisition methods and devices, this method comprises: obtaining the material parameters of image to be rendered;Obtain the index information of the parameter list for storing acquired material parameters;According to acquired index information, acquired material parameters are stored into the parameter list, and acquired index information is stored into geometry buffer area G-Buffer.The material that can include in image to be rendered using technical solution provided in an embodiment of the present invention can also store whole material parameters when more.

Description

A kind of storage of material parameters, material parameters acquisition methods and device
Technical field
The present invention relates to computer application technologies, obtain more particularly to a kind of storage of material parameters, material parameters Method and device.
Background technique
With the development of video card technology, delay rendering is gradually expanded as a kind of 3D method for rendering graph.Delay rendering Specifically include that geometry stage and tinting stage.In the geometry stage, GPU (Graphics Processing Unit, at figure Manage device) material parameters of image are obtained, such as: roughness, normal direction parameter, and the material parameters storage that will acquire is to G- In buffer (Geometric Buffer, geometry buffer area);In tinting stage, GPU is utilized and is cached in G-buffer Material parameters carry out illumination calculation to the pixel in image, the image after being rendered.
However, inventor has found in the implementation of the present invention: as the material parameters stored in G-buffer increase, The working performance of GPU can reduce;Also, by that can include that different material and each material are equal in the image to be rendered Possess one group of material parameters, then then will lead to the material to be stored when the material that the image to be rendered includes is more Parameter, which may exceed in G-buffer, can store the upper limit of the number of material parameters, that is, cannot store in G-buffer complete Portion's material parameters cause the image quality of the image obtained after rendering that cannot meet expection.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of storage of material parameters, material parameters acquisition methods and device, with Whole material parameters can be also stored when the material that image to be rendered includes is more.Specific technical solution is as follows:
The one side that the present invention is implemented provides a kind of material parameters storage method, which comprises
Obtain the material parameters of image to be rendered;
Obtain the index information of the parameter list for storing acquired material parameters;
According to acquired index information, acquired material parameters are stored into the parameter list, and will be acquired Index information store into geometry buffer area G-Buffer.
Optionally, before the step of index information of the parameter list in the acquisition for storing acquired material parameters, Further include:
The parameter list is created in CPU;
For the parameter list distribution index information.
It is optionally, described by acquired index information storage to the step in geometry buffer area G-Buffer, comprising:
The post-processing object for storing acquired index information is determined in the post-processing object for including in G-Buffer;
By acquired index information storage to the channel Alpha of determined post-processing object.
Optionally, the index information according to acquired in stores acquired material parameters into the parameter list The step of, comprising:
Judge whether the quantity of acquired material parameters exceeds the upper limit of the number of the storage material parameters of the G-Buffer;
If so, by the storage of the first quantity material parameters into the G-Buffer, by the second quantity material parameters It stores in the parameter list, wherein first quantity is less than the upper limit of the number, and second quantity is acquired material Difference between the quantity of matter parameter and first quantity.
Optionally, described to store the first quantity material parameters into the G-Buffer, by the second quantity material parameters Store the step in the parameter list, comprising:
Determine the shared material parameters in acquired material parameters, wherein the shared material parameters are described to wash with watercolours Identical material parameters in the material parameters that each material that dye image includes possesses;
Whether the quantity of shared material parameters determined by judgement is less than the upper limit of the number;
If so, identified shared material parameters storage will be arrived the G- except storage into the G-Buffer Material parameters except material parameters in Buffer are stored into the parameter list;
If not, choosing the first quantity material parameters storage in identified shared material parameters to the G- In Buffer, the material parameters in addition to storage is to the material parameters in the G-Buffer are stored into the parameter list.
The another aspect that the present invention is implemented additionally provides a kind of material parameters acquisition methods, which comprises
The index information for storing the parameter list of the material parameters of image to be rendered is obtained from G-Buffer;
According to acquired index information, the material parameters of the image to be rendered are obtained from the parameter list.
Optionally, described to obtain the rope obtained from G-Buffer for storing the parameter list of the material parameters of image to be rendered The step of fuse ceases, comprising:
It determines in the G-Buffer for storing the post-processing object of the index information;
The index information is obtained from the channel Alpha of identified post-processing object.
Optionally, the index information according to acquired in obtains the material of the image to be rendered from the parameter list The step of matter parameter, comprising:
In the case where being stored with material parameters in the G-Buffer, obtains and store material ginseng in the G-Buffer Number, and the material parameters stored in the parameter list are obtained according to acquired index information.
The another aspect that the present invention is implemented, additionally provides a kind of material parameters storage device, and described device includes:
First obtains module, for obtaining the material parameters of image to be rendered;
Second obtains module, for obtaining the index information of the parameter list for storing acquired material parameters;
Memory module, for according to acquired index information, acquired material parameters to be stored to the parameter list In, and acquired index information is stored into geometry buffer area G-Buffer.
Optionally, described device further include:
Creation module, for creating the parameter list in CPU;
Distribution module, for being the parameter list distribution index information.
Optionally, the memory module, comprising:
First determines submodule, determines in the post-processing object for including in G-Buffer for storing acquired index The post-processing object of information;
First sub-module stored, for storing acquired index information to the channel Alpha of determined post-processing object.
Optionally, the memory module, comprising:
Judging submodule, for judging whether the quantity of acquired material parameters exceeds the storage material of the G-Buffer The upper limit of the number of parameter, and the second sub-module stored is triggered when the judgment result is yes;
Second sub-module stored, for into the G-Buffer, second being counted the storage of the first quantity material parameters A material parameters storage is measured into the parameter list, wherein first quantity is less than the upper limit of the number, second quantity For the difference between the quantity and first quantity of acquired material parameters.
Optionally, second sub-module stored, comprising:
Determination unit, for determining the shared material parameters in acquired material parameters, wherein the shared material ginseng Identical material parameters in the material parameters that number possesses for each material that the image to be rendered includes;
Whether judging unit, the quantity for shared material parameters determined by judging are less than the upper limit of the number, and Judging result is to trigger the first storage unit when being, triggers the second storage unit when the judgment result is No;
First storage unit, for identified shared material parameters storage into the G-Buffer, will to be removed storage Material parameters except to the material parameters in the G-Buffer are stored into the parameter list;
Second storage unit is deposited for choosing the first quantity material parameters in identified shared material parameters It stores up in the G-Buffer, the material parameters in addition to storage is to the material parameters in the G-Buffer is stored to described In parameter list.
The another aspect that the present invention is implemented, additionally provides a kind of material parameters acquisition device, and described device includes:
Third obtains module, for obtaining the parameter list for storing the material parameters of image to be rendered from G-Buffer Index information;
4th obtains module, for obtaining the figure to be rendered from the parameter list according to acquired index information The material parameters of picture.
Optionally, the third obtains module, comprising:
Second determines submodule, for determining in the G-Buffer for storing the post-processing object of the index information;
Acquisition submodule, for obtaining the index information from the channel Alpha of identified post-processing object.
Optionally, the described 4th module is obtained, be specifically used for
In the case where being stored with material parameters in the G-Buffer, obtains and store material ginseng in the G-Buffer Number, and the material parameters stored in the parameter list are obtained according to acquired index information.
The another aspect that the present invention is implemented additionally provides a kind of electronic equipment, including processor, communication interface, memory And communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any of the above-described material parameters storage method.
The another aspect that the present invention is implemented additionally provides a kind of electronic equipment, including processor, communication interface, memory And communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any of the above-described material parameters acquisition methods.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described material parameters storage Method.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described material parameters and obtains Method.
The embodiment of the invention also provides a kind of computer program products comprising instruction, when it runs on computers When, so that computer executes any of the above-described material parameters storage method.
The embodiment of the invention also provides a kind of computer program products comprising instruction, when it runs on computers When, so that computer executes any of the above-described material parameters acquisition methods.
A kind of storage of material parameters, material parameters acquisition methods and device provided in an embodiment of the present invention, can will be to wash with watercolours The material parameters storage of dye image can not store material parameters or storage section material ginseng into parameter list, in G-Buffer Number, it is thus possible to reduce the working performance that the demand to memory space in G-buffer improves GPU, also, in image to be rendered Also whole material parameters can be stored when the material for including is more, to guarantee the image quality of the image obtained after rendering.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of material parameters storage method provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of material parameters acquisition methods provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of material parameters storage device provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of material parameters acquisition device provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, a kind of flow diagram of material parameters storage method provided in an embodiment of the present invention, the party are shown Method includes:
S100 obtains the material parameters of image to be rendered.
Material parameters can be understood as the used parameter when rendering to image.Specifically, material parameters can be with Include: roughness, diffusing reflection color, method phase direction, etc. parameters.
In a kind of implementation, the material ginseng of image to be rendered can be obtained by rasterizing to image to be rendered Number.
S110 obtains the index information of the parameter list for storing acquired material parameters.
In a kind of implementation, parameter list can be created in CPU in advance before S110, be then the parameter list of creation Distribution index information.Wherein, index information can be understood as the information for capableing of unique id parameter table.
Index information can obtain in the following manner:
Mode one is based on this since image rendering process is completed in GPU, and after CPU creates parameter list, CPU can be with Index information is sent to GPU, so that GPU obtains index information and during follow-up rendering, according to the index information of acquisition Material parameters are stored into the concordance list into CPU;
Mode two after GPU obtains the material parameters of image to be rendered during rendering, can send to CPU and obtain The request of index information, index information is sent to GPU after receiving the request for obtaining index information by CPU, so that GPU is rear Material parameters are stored by the concordance list into CPU according to the index information of acquisition in continuous render process.
S120 stores acquired material parameters into parameter list according to acquired index information, and will be acquired Index information store into geometry buffer area G-Buffer.
In a kind of implementation, can by acquired material parameters, all storage is into parameter list, at this point, G-Buffer In only need to store index information, so as to it is least occupy G-Buffer memory space.
In another implementation, a part of material parameters in acquired material parameters can also be stored to G- In Buffer, by the storage of another part material parameters into parameter list.Specifically, in storing process, it can be determined that acquired Whether the quantity of material parameters exceeds the upper limit of the number of the storage material parameters of G-Buffer;If so, by the first quantity material Matter parameter is stored into G-Buffer, by the storage of the second quantity material parameters into parameter list, wherein due in G-Buffer The space of reserved storage index information is needed, so the first quantity is less than in the quantity of storage material parameters of G-Buffer Limit, correspondingly, the second quantity are the difference between the quantity and the first quantity of acquired material parameters.For example, acquired The quantity of material parameters is 20, and the upper limit of the number of the storage material parameters of G-Buffer is 8, it is possible to will acquire 6 storages in material parameters are into G-Buffer, and 14 storages are into parameter list.
There can be identical material parameters in the material parameters possessed due to each material that image to be rendered includes, also It is in acquired material parameters there are part material parameters is parameter common to each material, we are normally referred to as shared Material parameters.Specifically, shared material parameters generally include: the parameters such as normal parameter, diffusing reflection color.Based on this, Yi Zhongshi In existing mode, during by acquired material parameters storage to G-Buffer and parameter list, it can determine acquired Shared material parameters in material parameters, then whether the quantity of shared material parameters determined by judgement is less than G-Buffer's Store the upper limit of the number of material parameters;
If so, by identified shared material parameters storage into G-Buffer, it will be except storage be into G-Buffer Material parameters except material parameters are stored into parameter list.It is stored in namely G-Buffer and shares material parameters, parameter list Material parameters specific to each material that middle storage image to be rendered includes.
If not, choosing the storage of the first quantity material parameters in identified shared material parameters to G-Buffer In, the material parameters in addition to storing the material parameters into G-Buffer are stored into parameter list.
It include multiple RT (render target, post-processing object) in practical application, in G-Buffer, each RT includes Color channel and a channel Alpha, color channel generally comprise R (Red, red), G (Green, green), B (Blue, blue) three Channel.A RT first can be arbitrarily chosen during by acquired index information storage to G-Buffer based on this, Then a channel is arbitrarily chosen in the channel that selected RT includes to be stored;In the RT that can also include in G-Buffer After first determining a RT for storing acquired index information, acquired index information is stored to determined RT's In the channel Alpha.Also, it can recorde the storage location of index information, such as RT2, the channel Alpha after storing index information; So that subsequent can directly obtain in channel from RT2, Alpha during obtaining index information according to the storage location of record Index information.
In each scheme provided in an embodiment of the present invention, material parameters of the material parameters storage method due to image to be rendered It is stored in parameter list, material parameters can not be stored in G-Buffer or storage section material parameters therefore can Reduce the working performance that GPU is improved to the occupancy of memory space in G-buffer, also, the material for including in image to be rendered compared with Also whole material parameters can be stored when more, by parameter list to guarantee the image quality of the image obtained after rendering.
Referring to fig. 2, a kind of flow diagram of material parameters acquisition methods provided in an embodiment of the present invention, the party are shown Method includes:
S200 obtains the index information for storing the parameter list of the material parameters of image to be rendered from G-Buffer.
In a kind of implementation, the parameter list for storing the material parameters of image to be rendered is obtained from G-Buffer When index information, can first it determine for storing the post-processing object of index information in G-Buffer, then from identified rendering The channel Alpha of target obtains the index information.
In a kind of implementation, in the case where the storage location of no pre-recorded index information, poll can be used Mode check whether the channel of each RT in G-Buffer is stored with index information one by one, realized with this and obtained from G-Buffer Take index information.
S210 obtains the material parameters of image to be rendered according to acquired index information from parameter list.
It, can be according to index information from parameter specifically, in the case where not being stored with material parameters in G-Buffer Whole material parameters of image to be rendered are obtained in table.
And in the case where being stored with material parameters in G-Buffer, it can first obtain and store material ginseng in G-Buffer Then number gets parms the material parameters stored in table further according to index information.
In each scheme provided in an embodiment of the present invention, material parameters acquisition methods can be by being stored in G-buffer Index information obtain the material parameters that store in concordance list, then material parameters can not be stored in G-buffer or deposited Part material parameters are stored up, therefore, the working performance for improving GPU to the occupancy of memory space in G-buffer can be reduced, also, Whole material parameters can be stored, by parameter list also when the material that image to be rendered includes is more to guarantee to obtain after rendering The image quality of the image arrived.
Below with a specific embodiment come to material parameters provided in an embodiment of the present invention storage, acquisition methods say It is bright:
Image to be rendered is rasterized, obtain image to be rendered material parameters include: Diffuse.xyz, Roughness、Normal.xyz、Specular.xyz、Param41、Param42、Param43、Param44、A、B、C。
And in Gbuffer including 4 RT, each RT includes color channel and a channel Alpha, it is seen then that in Gbuffer It is not enough to store whole material parameters.
Therefore, it is necessary to obtain the index information for the parameter list established in CPU in advance, then according to index information, by institute A, B, C in the material parameters of acquisition are stored into parameter list, and include by index information storage RT2 into G-Buffer In the channel Alpha.Storage result difference in final Gbuffer and parameter list is as follows:
Index
0 A0 B0 C0
1 A1 B1 C1
2 A2 B2 C2
Specifically, during by A, B, C storage in material parameters to parameter list, it is corresponding for index Index Parameter Ai, Bi, Ci, corresponding void EncodeParam (int I, var Ai, var Bi, var Ci) are accomplished by
Correspondingly, during the material parameters stored in the table that gets parms, first reading RT2 in G-Buffer includes In the channel Alpha " ParamShare (MatType | ID) ", " Index " of parameter list is obtained, to read in parameter list Parameter, specific solution parameter Ai, Bi, Ci process are accomplished by
Referring to Fig. 3, a kind of structural schematic diagram of material parameters storage device provided in an embodiment of the present invention, the dress are shown It sets and includes:
First obtains module 300, for obtaining the material parameters of image to be rendered;
Second obtains module 310, for obtaining the index information of the parameter list for storing acquired material parameters;
Memory module 320, for according to acquired index information, acquired material parameters to be stored to the parameter In table, and acquired index information is stored into geometry buffer area G-Buffer.
In a kind of implementation of the embodiment of the present invention, material parameters storage device further include:
Creation module, for creating the parameter list in CPU;
Distribution module, for being the parameter list distribution index information.
In a kind of implementation of the embodiment of the present invention, memory module 320, comprising:
First determines submodule, determines in the post-processing object for including in G-Buffer for storing acquired index The post-processing object of information;
First sub-module stored, for storing acquired index information to the channel Alpha of determined post-processing object.
In a kind of implementation of the embodiment of the present invention, memory module 320, comprising:
Judging submodule, for judging whether the quantity of acquired material parameters exceeds the storage material of the G-Buffer The upper limit of the number of parameter, and the second sub-module stored is triggered when the judgment result is yes;
Second sub-module stored, for into the G-Buffer, second being counted the storage of the first quantity material parameters A material parameters storage is measured into the parameter list, wherein first quantity is less than the upper limit of the number, second quantity For the difference between the quantity and first quantity of acquired material parameters.
In a kind of implementation of the embodiment of the present invention, the second sub-module stored, comprising:
Determination unit, for determining the shared material parameters in acquired material parameters, wherein the shared material ginseng Identical material parameters in the material parameters that number possesses for each material that the image to be rendered includes;
Whether judging unit, the quantity for shared material parameters determined by judging are less than the upper limit of the number, and Judging result is to trigger the first storage unit when being, triggers the second storage unit when the judgment result is No;
First storage unit, for identified shared material parameters storage into the G-Buffer, will to be removed storage Material parameters except to the material parameters in the G-Buffer are stored into the parameter list;
Second storage unit is deposited for choosing the first quantity material parameters in identified shared material parameters It stores up in the G-Buffer, the material parameters in addition to storage is to the material parameters in the G-Buffer is stored to described In parameter list.
In each scheme provided in an embodiment of the present invention, material parameters of the material parameters storage device due to image to be rendered It is stored in parameter list, material parameters can not be stored in G-Buffer or storage section material parameters therefore can Reduce the working performance that GPU is improved to the occupancy of memory space in G-buffer, also, the material for including in image to be rendered compared with Also whole material parameters can be stored when more, by parameter list to guarantee the image quality of the image obtained after rendering.
Referring to fig. 4, a kind of structural schematic diagram of material parameters acquisition device provided in an embodiment of the present invention, the dress are shown It sets and includes:
Third obtains module 400, for obtaining the ginseng for storing the material parameters of image to be rendered from G-Buffer The index information of number table;
4th obtains module 410, for obtaining from the parameter list described to be rendered according to acquired index information The material parameters of image.
In a kind of implementation of the embodiment of the present invention, third obtains module 400, comprising:
Second determines submodule, for determining in the G-Buffer for storing the post-processing object of the index information;
Acquisition submodule, for obtaining the index information from the channel Alpha of identified post-processing object.
In a kind of implementation of the embodiment of the present invention, the 4th obtains module 410, is specifically used for
In the case where being stored with material parameters in the G-Buffer, obtains and store material ginseng in the G-Buffer Number, and the material parameters stored in the parameter list are obtained according to acquired index information.
In each scheme provided in an embodiment of the present invention, material parameters acquisition device can be by being stored in G-buffer Index information obtain the material parameters that store in concordance list, then material parameters can not be stored in G-buffer or deposited Part material parameters are stored up, therefore, the working performance for improving GPU to the occupancy of memory space in G-buffer can be reduced, also, Whole material parameters can be stored, by parameter list also when the material that image to be rendered includes is more to guarantee to obtain after rendering The image quality of the image arrived.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 5, include processor 001, communication interface 002, Memory 003 and communication bus 004, wherein processor 001, communication interface 002, memory 003 are complete by communication bus 004 At mutual communication,
Memory 003, for storing computer program;
Processor 001 when for executing the program stored on memory 003, realizes material described in the embodiment of the present invention Matter parameter storage method.
Specifically, above-mentioned material parameters storage method, comprising:
Obtain the material parameters of image to be rendered;
Obtain the index information of the parameter list for storing acquired material parameters;
According to acquired index information, acquired material parameters are stored into the parameter list, and will be acquired Index information store into geometry buffer area G-Buffer.
It should be noted that above-mentioned processor 001, which executes the program stored on memory 003, realizes material parameters storage The other embodiments of method, identical as the embodiment that preceding method embodiment part provides, which is not described herein again.
In each scheme provided in an embodiment of the present invention, electronic equipment is stored in due to the material parameters of image to be rendered Material parameters or storage section material parameters can not be stored in parameter list, in G-Buffer, therefore, can be reduced to G- The occupancy of memory space improves the working performance of GPU in buffer, also, also can when the material that image to be rendered includes is more Material parameters enough whole by parameter list storage, to guarantee the image quality of the image obtained after rendering.
The embodiment of the invention also provides a kind of electronic equipment, as shown in fig. 6, include processor 011, communication interface 012, Memory 013 and communication bus 014, wherein processor 011, communication interface 012, memory 013 are complete by communication bus 014 At mutual communication,
Memory 013, for storing computer program;
Processor 011 when for executing the program stored on memory 013, realizes material described in the embodiment of the present invention Matter parameter acquiring method.
Specifically, above-mentioned material parameters acquisition methods, comprising:
The index information for storing the parameter list of the material parameters of image to be rendered is obtained from G-Buffer;
According to acquired index information, the material parameters of the image to be rendered are obtained from the parameter list.
It should be noted that above-mentioned processor 011, which executes the program stored on memory 013, realizes that material parameters obtain The other embodiments of method, identical as the embodiment that preceding method embodiment part provides, which is not described herein again.
In each scheme provided in an embodiment of the present invention, electronic equipment can be believed by the index being stored in G-buffer Breath obtains the material parameters stored in concordance list, then can not store material parameters or storage section material in G-buffer Therefore matter parameter can reduce the working performance that GPU is improved to the occupancy of memory space in G-buffer, also, to be rendered Also whole material parameters can be stored when the material that image includes is more, by parameter list to guarantee the image obtained after rendering Image quality.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described material parameters storage Method.
Specifically, above-mentioned material parameters storage method includes:
Obtain the material parameters of image to be rendered;
Obtain the index information of the parameter list for storing acquired material parameters;
According to acquired index information, acquired material parameters are stored into the parameter list, and will be acquired Index information store into geometry buffer area G-Buffer.
It should be noted that realizing other implementations of material parameters storage method by above-mentioned computer readable storage medium Example, identical as the embodiment that preceding method embodiment part provides, which is not described herein again.
In each scheme provided in an embodiment of the present invention, computer readable storage medium is joined due to the material of image to be rendered Number is stored in parameter list, and material parameters or storage section material parameters, therefore, energy can not be stored in G-Buffer It is enough to reduce the working performance that GPU is improved to the occupancy of memory space in G-buffer, also, the material for including in image to be rendered Also whole material parameters can be stored when more, by parameter list to guarantee the image quality of the image obtained after rendering.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described material parameters and obtains Method.
Specifically, above-mentioned material parameters acquisition methods include:
The index information for storing the parameter list of the material parameters of image to be rendered is obtained from G-Buffer;
According to acquired index information, the material parameters of the image to be rendered are obtained from the parameter list.
It should be noted that realizing other implementations of material parameters acquisition methods by above-mentioned computer readable storage medium Example, identical as the embodiment that preceding method embodiment part provides, which is not described herein again.
In each scheme provided in an embodiment of the present invention, computer readable storage medium can be by being stored in G-buffer In index information obtain the material parameters that store in concordance list, then can not be stored in G-buffer material parameters or Therefore storage section material parameters can reduce the working performance that GPU is improved to the occupancy of memory space in G-buffer, and And whole material parameters can be also stored by parameter list when the material that image to be rendered includes is more, to guarantee to render The image quality of the image obtained afterwards.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced Product, when run on a computer, so that computer executes any of the above-described material parameters storage method.
Specifically, above-mentioned material parameters storage method includes:
Obtain the material parameters of image to be rendered;
Obtain the index information of the parameter list for storing acquired material parameters;
According to acquired index information, acquired material parameters are stored into the parameter list, and will be acquired Index information store into geometry buffer area G-Buffer.
It should be noted that the other embodiments of material parameters storage method are realized by above-mentioned computer program product, Identical as the embodiment that preceding method embodiment portion provides, which is not described herein again.
In each scheme provided in an embodiment of the present invention, computer program product is due to the material parameters of image to be rendered It is stored in parameter list, material parameters or storage section material parameters can not be stored in G-Buffer, therefore, can subtract Few occupancy to memory space in G-buffer improves the working performance of GPU, also, more in the material that image to be rendered includes When can also pass through the whole material parameters of parameter list storage, to guarantee the image quality of the image obtained after rendering.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced Product, when run on a computer, so that computer executes any of the above-described material parameters acquisition methods.
Specifically, above-mentioned material parameters acquisition methods include:
The index information for storing the parameter list of the material parameters of image to be rendered is obtained from G-Buffer;
According to acquired index information, the material parameters of the image to be rendered are obtained from the parameter list.
It should be noted that the other embodiments of material parameters acquisition methods are realized by above-mentioned computer program product, Identical as the embodiment that preceding method embodiment part provides, which is not described herein again.
In each scheme provided in an embodiment of the present invention, computer program product can be by being stored in G-buffer Index information obtains the material parameters stored in concordance list, then can not store material parameters or storage in G-buffer Part material parameters, therefore, can reduce in G-buffer memory space occupancy improve GPU working performance, also, Also whole material parameters can be stored when the material that image to be rendered includes is more, by parameter list to guarantee to obtain after rendering Image image quality.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For equipment, computer readable storage medium, computer program product embodiments, since it is substantially similar to the method embodiment, So being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (20)

1. a kind of material parameters storage method, which is characterized in that the described method includes:
Obtain the material parameters of image to be rendered;
Obtain the index information of the parameter list for storing acquired material parameters;
According to acquired index information, acquired material parameters are stored into the parameter list, and by acquired rope Fuse breath storage is into geometry buffer area G-Buffer.
2. the method as described in claim 1, which is characterized in that in the parameter obtained for storing acquired material parameters Before the step of index information of table, further includes:
The parameter list is created in CPU;
For the parameter list distribution index information.
3. method as described in claim 1, which is characterized in that described by acquired index information storage to geometry buffer Step in area G-Buffer, comprising:
The post-processing object for storing acquired index information is determined in the post-processing object for including in G-Buffer;
By acquired index information storage to the channel Alpha of determined post-processing object.
4. method as claimed in any one of claims 1-3, which is characterized in that the index information according to acquired in, it will Acquired material parameters are stored to the step in the parameter list, comprising:
Judge whether the quantity of acquired material parameters exceeds the upper limit of the number of the storage material parameters of the G-Buffer;
If so, the storage of the first quantity material parameters is stored the second quantity material parameters into the G-Buffer Into the parameter list, wherein first quantity is less than the upper limit of the number, and second quantity is that acquired material is joined Difference between several quantity and first quantity.
5. method as claimed in claim 4, which is characterized in that described by the first quantity material parameters storage to the G- In Buffer, by the second quantity material parameters storage to the step in the parameter list, comprising:
Determine the shared material parameters in acquired material parameters, wherein the shared material parameters are the figure to be rendered As comprising the material parameters that possess of each material in identical material parameters;
Whether the quantity of shared material parameters determined by judgement is less than the upper limit of the number;
If so, identified shared material parameters storage will be arrived the G-Buffer except storage into the G-Buffer In material parameters except material parameters store into the parameter list;
If not, choosing the first quantity material parameters storage in identified shared material parameters to the G- In Buffer, the material parameters in addition to storage is to the material parameters in the G-Buffer are stored into the parameter list.
6. a kind of material parameters acquisition methods, which is characterized in that the described method includes:
The index information for storing the parameter list of the material parameters of image to be rendered is obtained from G-Buffer;
According to acquired index information, the material parameters of the image to be rendered are obtained from the parameter list.
7. method as claimed in claim 6, which is characterized in that described obtain obtains from G-Buffer for storing figure to be rendered The step of index information of the parameter list of the material parameters of picture, comprising:
It determines in the G-Buffer for storing the post-processing object of the index information;
The index information is obtained from the channel Alpha of identified post-processing object.
8. method as claimed in claim 6, which is characterized in that the index information according to acquired in, from the parameter list The step of middle material parameters for obtaining the image to be rendered, comprising:
In the case where being stored with material parameters in the G-Buffer, obtains and store material parameters in the G-Buffer, and The material parameters stored in the parameter list are obtained according to acquired index information.
9. a kind of material parameters storage device, which is characterized in that described device includes:
First obtains module, for obtaining the material parameters of image to be rendered;
Second obtains module, for obtaining the index information of the parameter list for storing acquired material parameters;
Memory module, for according to acquired index information, acquired material parameters to be stored into the parameter list, and Acquired index information is stored into geometry buffer area G-Buffer.
10. device as claimed in claim 9, which is characterized in that described device further include:
Creation module, for creating the parameter list in CPU;
Distribution module, for being the parameter list distribution index information.
11. device as claimed in claim 9, which is characterized in that the memory module, comprising:
First determines submodule, determines in the post-processing object for including in G-Buffer for storing acquired index information Post-processing object;
First sub-module stored, for storing acquired index information to the channel Alpha of determined post-processing object.
12. such as the described in any item devices of claim 9-11, which is characterized in that the memory module, comprising:
Judging submodule, for judging whether the quantity of acquired material parameters exceeds the storage material parameters of the G-Buffer The upper limit of the number, and trigger the second sub-module stored when the judgment result is yes;
Second sub-module stored, for storing the first quantity material parameters into the G-Buffer, by the second quantity Material parameters are stored into the parameter list, wherein first quantity is less than the upper limit of the number, and second quantity is institute Difference between the quantity of the material parameters of acquisition and first quantity.
13. device as claimed in claim 12, which is characterized in that second sub-module stored, comprising:
Determination unit, for determining the shared material parameters in acquired material parameters, wherein the shared material parameters are Identical material parameters in the material parameters that each material that the image to be rendered includes possesses;
Judging unit for judging whether the quantity of identified shared material parameters is less than the upper limit of the number, and is judging As a result to trigger the first storage unit when being, the second storage unit is triggered when the judgment result is No;
First storage unit, for identified shared material parameters storage into the G-Buffer, will to be arrived institute except storage The material parameters except the material parameters in G-Buffer are stated to store into the parameter list;
Second storage unit is arrived for choosing the first quantity material parameters storage in identified shared material parameters In the G-Buffer, by the material parameters storage in addition to storage is to the material parameters in the G-Buffer to the parameter In table.
14. a kind of material parameters acquisition device, which is characterized in that described device includes:
Third obtains module, for obtaining the rope for storing the parameter list of the material parameters of image to be rendered from G-Buffer Fuse breath;
4th obtains module, for obtaining the image to be rendered from the parameter list according to acquired index information Material parameters.
15. device as claimed in claim 14, which is characterized in that the third obtains module, comprising:
Second determines submodule, for determining in the G-Buffer for storing the post-processing object of the index information;
Acquisition submodule, for obtaining the index information from the channel Alpha of identified post-processing object.
16. device as claimed in claim 14, which is characterized in that the described 4th obtains module, is specifically used for
In the case where being stored with material parameters in the G-Buffer, obtains and store material parameters in the G-Buffer, and The material parameters stored in the parameter list are obtained according to acquired index information.
17. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-5.
18. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes method and step as claimed in claim 6 to 8.
19. a kind of computer readable storage medium, it is stored with instruction in the computer readable storage medium, when it is in computer When upper operation, so that computer perform claim requires any method and step of 1-5.
20. a kind of computer readable storage medium, it is stored with instruction in the computer readable storage medium, when it is in computer When upper operation, so that computer perform claim requires any method and step of 6-8.
CN201811087967.2A 2018-09-18 2018-09-18 A kind of storage of material parameters, material parameters acquisition methods and device Pending CN109242758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811087967.2A CN109242758A (en) 2018-09-18 2018-09-18 A kind of storage of material parameters, material parameters acquisition methods and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811087967.2A CN109242758A (en) 2018-09-18 2018-09-18 A kind of storage of material parameters, material parameters acquisition methods and device

Publications (1)

Publication Number Publication Date
CN109242758A true CN109242758A (en) 2019-01-18

Family

ID=65059693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811087967.2A Pending CN109242758A (en) 2018-09-18 2018-09-18 A kind of storage of material parameters, material parameters acquisition methods and device

Country Status (1)

Country Link
CN (1) CN109242758A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106846238A (en) * 2017-03-01 2017-06-13 北京趣酷科技有限公司 A kind of cross-platform automotive engine system of Elf3D
CN110211023A (en) * 2019-07-04 2019-09-06 珠海金山网络游戏科技有限公司 A kind of data processing method, calculates equipment and storage medium at device
CN111340924A (en) * 2020-02-25 2020-06-26 网易(杭州)网络有限公司 Image rendering method, device and equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030210248A1 (en) * 2002-05-08 2003-11-13 Wyatt David A. Method and system for optimally sharing memory between a host processor and graphics processor
US20060133494A1 (en) * 2004-12-17 2006-06-22 Rahul Saxena Image decoder with context-based parameter buffer
CN103886547A (en) * 2012-12-20 2014-06-25 辉达公司 Technique For Storing Shared Vertices
CN105556565A (en) * 2013-06-10 2016-05-04 索尼电脑娱乐公司 Fragment shaders perform vertex shader computations
CN106254489A (en) * 2016-08-16 2016-12-21 王淼 A kind of cloud rendering system without file transmission and method thereof
CN107909538A (en) * 2017-12-07 2018-04-13 北京像素软件科技股份有限公司 Topographic data processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030210248A1 (en) * 2002-05-08 2003-11-13 Wyatt David A. Method and system for optimally sharing memory between a host processor and graphics processor
US20060133494A1 (en) * 2004-12-17 2006-06-22 Rahul Saxena Image decoder with context-based parameter buffer
CN103886547A (en) * 2012-12-20 2014-06-25 辉达公司 Technique For Storing Shared Vertices
CN105556565A (en) * 2013-06-10 2016-05-04 索尼电脑娱乐公司 Fragment shaders perform vertex shader computations
CN106254489A (en) * 2016-08-16 2016-12-21 王淼 A kind of cloud rendering system without file transmission and method thereof
CN107909538A (en) * 2017-12-07 2018-04-13 北京像素软件科技股份有限公司 Topographic data processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
陈密密: "基于顶点索引的三维建模与可视化方法研究", 《影像技术》 *
陈密密: "基于顶点索引的三维建模与可视化方法研究", 《影像技术》, no. 02, 15 April 2011 (2011-04-15) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106846238A (en) * 2017-03-01 2017-06-13 北京趣酷科技有限公司 A kind of cross-platform automotive engine system of Elf3D
CN110211023A (en) * 2019-07-04 2019-09-06 珠海金山网络游戏科技有限公司 A kind of data processing method, calculates equipment and storage medium at device
CN110211023B (en) * 2019-07-04 2023-06-02 珠海金山数字网络科技有限公司 Data processing method, device, computing equipment and storage medium
CN111340924A (en) * 2020-02-25 2020-06-26 网易(杭州)网络有限公司 Image rendering method, device and equipment and storage medium
CN111340924B (en) * 2020-02-25 2024-02-09 网易(杭州)网络有限公司 Image rendering method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11481952B2 (en) Allocation of primitives to primitive blocks
CN109242758A (en) A kind of storage of material parameters, material parameters acquisition methods and device
CN109741181B (en) Transaction matching method, system, server and medium based on intelligent contract
US8237710B1 (en) Methods and apparatus for fill rule evaluation over a tessellation
CN107291802B (en) Relation map methods of exhibiting and device
US7425967B2 (en) Device for processing pixel rasterization and method for processing the same
CN112433657B (en) Electronic book simulation page turning method, electronic equipment and computer storage medium
CN108122238A (en) Image processing method, device, equipment and computer readable storage medium
US9626285B2 (en) Storage resource allocation to dataflows based on data requirements and attributes
CN109214833A (en) Merchandise return request processing method and Related product based on video
CN107317853A (en) Method, device and system for displaying dynamic effect of message popup window
CN107426490A (en) A kind of photographic method and terminal
CN109508571A (en) A kind of empty localization method, device, electronic equipment and storage medium
CN109308386A (en) The recognition methods of engineering drawing wall, device and electronic equipment
CN106156132B (en) Picture loading display method and device
CN112433795A (en) Electronic book simulation page turning method, electronic equipment and computer storage medium
DE102015115576A1 (en) Graphics processing unit, a graphics processing system with the same, and an anti-aliasing method using the same
CN111897660A (en) Model deployment method, model deployment device and terminal equipment
CN111932438A (en) Image style migration method, equipment and storage device
CN105740293B (en) Data export method and device
CN109255187A (en) Analysis method and device
CN107679180A (en) Data display method and device
CN109903261A (en) A kind of image processing method, device and electronic equipment
CN115760543B (en) Thread processing method, device, equipment and storage medium for rasterizer ordered view
CN113628286B (en) Video color gamut detection method, device, computing equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination