CN107230249A - Shading Rendering method and apparatus - Google Patents

Shading Rendering method and apparatus Download PDF

Info

Publication number
CN107230249A
CN107230249A CN201710539413.0A CN201710539413A CN107230249A CN 107230249 A CN107230249 A CN 107230249A CN 201710539413 A CN201710539413 A CN 201710539413A CN 107230249 A CN107230249 A CN 107230249A
Authority
CN
China
Prior art keywords
role
shade
bone
pixel
model
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
CN201710539413.0A
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.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software 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 Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN201710539413.0A priority Critical patent/CN107230249A/en
Publication of CN107230249A publication Critical patent/CN107230249A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/60Shadow generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

Shading Rendering method and apparatus provided in an embodiment of the present invention, belong to image processing field.Methods described includes:Obtain the first quantity of whole roles in the application program;The skeleton model of the correspondence application program is set up, wherein, the bone of the second quantity is included in the skeleton model, first quantity is equal to second quantity;The index point of each role is searched, each bone is matched to the index point of a role in multiple roles;Render the whole bone in the skeleton model, the shade of each role of generation.By way of bone is rendered, each bone in skeleton model is matched into a role, the shade of the role is used as.The Shading Rendering of multiple roles in correspondence program can be achieved by rendering whole bones in skeleton model, on the premise of ensureing to render experience, reduce shadow-buffer and render cost, improve rendering speed.

Description

Shading Rendering method and apparatus
Technical field
The present invention relates to image processing field, in particular to Shading Rendering method and apparatus.
Background technology
In a 3d gaming, in order to show the authenticity of three-dimensional scenic, beautify render scenes, it will usually to game Object adds the effect of shade, that is, sheltering from the part of light can seem than dark.Hatching effect generally in game is used ShadowMap technologies are realized.The optical principle of such hatching effect relatively real world, comes for customary personal computer Say also can also load its consumption enough by machine under the premise of ensureing that effect is correct.But in large-scale mobile phone network game In render process, due to some low end machines performance issues, hold and can't stand using the ShadowMap internal memories brought and the speed of service On consumption.
The content of the invention
The present invention provides Shading Rendering method and apparatus, it is intended to improve above mentioned problem.
In a first aspect, a kind of Shading Rendering method that the present invention is provided, the moon for rendering multiple roles in application program Shadow.Methods described includes:Obtain the first quantity of whole roles in the application program;Set up the correspondence application program Skeleton model, wherein, include the bone of the second quantity in the skeleton model, first quantity is equal to the described second number Amount;The index point of each role is searched, each bone is matched to the mark of a role in multiple roles Point;Render the whole bone in the skeleton model, the shade of each role of generation.
Second aspect, one kind that the present invention is provided, the shade for rendering multiple roles in application program.State shade wash with watercolours Dye device includes:Role's quantity acquisition module, model building module, bone matching module and shadow generation module.Role's quantity is obtained Modulus block, the first quantity for obtaining whole roles in the application program.Model building module, for setting up correspondence The skeleton model of the application program, wherein, the bone of the second quantity is included in the skeleton model, first quantity is equal to Second quantity.Each bone is matched to many by bone matching module, the index point for searching each role The index point of a role in the individual role.Shadow generation module, for rendering the whole bone in the skeleton model Bone, the shade of each role of generation.
The Shading Rendering method and apparatus that the embodiments of the present invention are provided, for rendering multiple roles in application program Shade.Obtain in the application program the first quantity of all roles first, obtain to should application program bone mould Type so that the second quantity of the bone that the skeleton model is included and the first quantity of role are consistent, so that each bone A role can be matched to.After the skeleton model for the bone for setting up the second quantity, bone role match is carried out.Search each institute State the index point of role, a bone be matched to the index point of a role, you can complete in skeleton model each bone with The matching of each role.Complete after matching, render the whole bone in the skeleton model, you can each angle of generation The shade of color.By way of bone is rendered, each bone in skeleton model is matched into a role, the moon of the role is used as Shadow.The Shading Rendering of multiple roles in correspondence program can be achieved by rendering whole bones in skeleton model, ensureing wash with watercolours On the premise of dye experience, reduce shadow-buffer and render cost, improve rendering speed.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be attached to what is used required in embodiment Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore is not construed as pair The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this A little accompanying drawings obtain other related accompanying drawings.
Fig. 1 shows the block diagram of application terminal provided in an embodiment of the present invention;
Fig. 2 shows the flow chart of Shading Rendering method provided in an embodiment of the present invention;
Fig. 3 shows the step S204 of Shading Rendering method provided in an embodiment of the present invention flow chart;
Fig. 4 shows step S303 provided in an embodiment of the present invention flow chart;
Fig. 5 shows step S402 provided in an embodiment of the present invention flow chart;
Fig. 6 shows the functional block diagram of Shading Rendering device provided in an embodiment of the present invention.
Embodiment
Those skilled in the art are seeking the instrument or method of a kind of improvement problem always for a long time.
In consideration of it, the designer of the present invention is by long-term exploration and trial, and multiple experiment and effort, constantly Reform and innovation, draw the Shading Rendering method and apparatus shown in this programme.
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.Therefore, The detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit the model of claimed invention below Enclose, but be merely representative of the selected embodiment of the present invention.Based on the embodiment in the present invention, those of ordinary skill in the art are not having There is the every other embodiment made and obtained under the premise of creative work, belong to the scope of protection of the invention.
Fig. 1 is referred to, is the application terminal 100 that Shading Rendering method and apparatus provided in an embodiment of the present invention are applied Block diagram.The application terminal 100 includes Shading Rendering device 101, memory 102, storage control 103, processor 104th, Peripheral Interface 105, input-output unit 106, display unit etc. 107.
It is the memory 102, storage control 103, processor 104, Peripheral Interface 105, input-output unit 106, aobvious Show that each element such as unit 107 is directly or indirectly electrically connected with each other, to realize the transmission or interaction of data.For example, this A little elements can be realized by one or more communication bus or signal wire be electrically connected with each other.The Shading Rendering device 101, which include at least one, can be stored in the memory or be solidificated in described answer in the form of software or firmware (firmware) With the software function module in the operation application program (operating system, OS) of terminal 100.The processor 104 is used The executable module stored in execution memory, such as software function module or meter that described Shading Rendering device 101 includes Calculation machine program.
Wherein, memory 102 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only storage (Read Only Memory, ROM), programmable read only memory (Programmable Read- Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..Wherein, memory 102 is used for storage program, and the processor 104 is performed described after execute instruction is received The method performed by server that the process that any embodiment is disclosed in program, the aftermentioned embodiment of the present invention is defined can apply to In processor 104, or realized by processor 104.
Processor 104 is probably a kind of IC chip, the disposal ability with signal.Above-mentioned processor 104 can To be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;Can also be digital signal processor (DSP), application specific integrated circuit (ASIC), It is ready-made programmable gate array (FPGA) or other PLDs, discrete gate or transistor logic, discrete hard Part component.It can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor Can be microprocessor or the processor can also be any conventional processor etc..
Various input-output units 106 are coupled to processor 104 and memory 102 by the Peripheral Interface 105.One In a little embodiments, Peripheral Interface 105, processor 104 and storage control 103 can be realized in one single chip.At other In some examples, they can be realized by independent chip respectively.
Input-output unit 106 is used to be supplied to user input data to realize interacting for user and the server.It is described Input-output unit 106 may be, but not limited to, mouse and keyboard etc..
Display unit 107 provides an interactive interface between the server and user, such as user interface, or Referred to for display image data to user.In the present embodiment, the display unit 107 can be liquid crystal display or touch-control Display.If touch control display, it can be support single-point and the capacitance type touch control screen or electric resistance touch-control of multi-point touch operation Screen etc..Support single-point and multi-point touch operation refer to that touch control display can be sensed one or more on the touch control display The touch control operation produced simultaneously at position, and transfer to processor to be calculated and handled the touch control operation that this is sensed.
The Shading Rendering method that the present embodiment is provided, the application program run for rendering on application terminal collects multiple angles The shade of color.The specific Shading Rendering that can be used for role in being played on application terminal.Certainly, the specific of the embodiment of the present invention should It is not intended as limiting with scene, other scenes for needing to carry out Shading Rendering can also be applied to the present embodiment.It is to this below The detailed description that inventive embodiments are carried out.
Fig. 2 is referred to, a kind of flow chart of Shading Rendering method provided in an embodiment of the present invention is shown, applied to Fig. 1 Shading Rendering device set by the application terminal.Below in conjunction with Fig. 2, to Shading Rendering side provided in an embodiment of the present invention The implementation process of method is specifically described.
Step S201, obtains the first quantity of whole roles in the application program.
The Shading Rendering method that the present embodiment is provided, for multiple roles in the application program run to application terminal Carry out Shading Rendering.Preferably, role is carried out for multiple roles in the mobile phone games to the application terminal operation of low configuration Shading Rendering.The application terminal of the low configuration, can be GPU (Graphic Processing Unit, graphics process list Member) the relatively low application terminal of rendering capability.The relatively low application terminal of the GPU rendering capabilities, can be defined to be unsatisfactory for standard The application terminal of configuration parameter, the standard configuration parameter can include:Core frequency 400MHz, bandwidth 8.3GB/s, pixel are filled out Fill 3,200,000,000/second of rate, at least one rendered in triangle number 200,000,000 etc. per second.When the corresponding configuration parameter of application terminal is low In or when being similar to parameter in Chinese fir table, the application terminal can be classified as to the application terminal of low configuration, be particularly suitable for use in this The Shading Rendering method that embodiment is provided.
When multiple roles in the application program run on application terminal is needed carry out real-time rendering, it is necessary first to obtain The quantity of role rendered is needed, the quantity of the role is regard as first quantity.Obtaining in the application program needs wash with watercolours The quantity of the role of dye, can directly obtain the quantity of whole roles shown by current display interface.In other embodiment In, viewing area can also be delimited in advance, the quantity of the role in the viewing area is obtained, and be used as first quantity.
Step S202, sets up the skeleton model of the correspondence application program, wherein, the second number is included in the skeleton model The bone of amount, first quantity is equal to second quantity.
After the quantity that the whole roles for needing to carry out Shading Rendering in the application program are obtained according to above-mentioned steps, build The skeleton model of vertical correspondence shade, carries out animation by skinned mesh mode and renders.Covering, refers to cover in body or aerofoil skeleton It is model addition bone on the basis of the plate of aerodynamic configuration, the model created in three-dimensional software needed for outside is constituted.Due to bone Bone is separate with model, in order to allow bone driving model to produce rational motion.Model is tied to the skill on bone Art is to do covering.
Set up and multiple bones are included in the skeleton model of the correspondence application program, skeleton model, the bone mould is set The quantity of bone is the second quantity in type, sets first quantity to be equal to second quantity, so that each bone correspondence one The shadow model of individual role.When being rendered by skinned mesh progress animation, it is possible to achieve the synchronization of whole bones in skeleton model Render, as realize that the synchronization to all roles is rendered.
In other embodiments, it is contemplated that the first quantity of the role in application program may change, in order to Ensure that each role can be assigned to a bone, the second quantity of the bone can also be set to be more than all angles First quantity of color, to ensure when role's quantity increase, also can distribute bone for increased role, carry out part role Shading Rendering.In other embodiments, the skeleton model of the correspondence application program is set up, with obtaining the reference program The tandem of the first quantity of middle role can also be exchanged.Shade wash with watercolours is carried out needing multiple roles to application program During dye, can first set up to should application program skeleton model, the second quantity comprising bone can be in the skeleton model The standard number pre-set, the standard number can have multiple options to supply to be used to be selected according to the classification of the application program Select.Set up after the skeleton model, obtain the first quantity of role in the application program, according to the first number of all roles Amount, from the bone of second quantity, selects the bone of the first quantity, and is matched to the role of the first quantity one by one, Can the role and the bone match.
Step S203, searches the index point of each role, each bone is matched in multiple roles The index point of one role.
In the application program, each role of correspondence sets its index point, position and presence for indicating the role State, the index point can be arranged on geometric center region or agreement region of role etc..In the present embodiment, it is contemplated that Under reality, shade be light projection to human body when be presented on the region of position under human foot, therefore be preferably provided with the mark Point is personage's pin position of the role.
Set up to bone in skeleton model and need to render the one of role should be carried out after the skeleton model of application program One matching.The index point of each role is searched, each bone is matched to the index point of a role, as will be complete Each bone in portion's bone is suspended at personage's placement of foot of a role, and each bone corresponds to the shade mould that it hangs role Type.Above-mentioned steps are that the corresponding shadow model of bone can be achieved to move with personage's pin of role, although without more complete and accurate Shade each position, but can guarantee that user can be with visual understanding to being the role's with the circular shade piece of role Shade, has reached Shading Rendering experience.
Step S204, renders the whole bone in the skeleton model, the shade of each role of generation.
After the bone matching that the whole roles of correspondence are completed according to above-mentioned steps, shadow model is set up according to the bone, entered The Shading Rendering of row role.With reference to Fig. 3, the process shown in step S204 is specifically described.
Step S301, obtains the model of each bone.
Model points when being set up according to bone, obtain the model of each bone.Usually, every bone controls four Model points, then the square model piece that the model of the bone is constituted for its four model points controlled.
Step S302, shade piece is generated according to each model.
After the model for obtaining bone, according to the model of the bone, generate to should bone correspondence role shade piece.Consider To that generally the shadow blur of role can be turned into circular piece, the shade piece for being preferably provided with role is circular shade piece, The square model piece of the bone according to i.e., builds corresponding circular shade piece.Specifically can be directly according to the square model piece Four edges, set up the inscribed circle of the square model piece, inscribed circle overlay area is set to the circular shade panel region of role. In other embodiment, circumscribed circle can also be set up according to four end points of the square model piece, circumscribed circle overlay area is set Or the circular shade panel region that its internal concentric region is role.The shade plate shape and its generating process of role can have A variety of implementations, are not limited herein.
Step S303, renders the shade piece of each role, generates the shade of the role.
After the shade piece for completing each role according to above-mentioned steps is set, you can carry out rendering for role's shade.Preferably, It can influence to render the factor of display effect in view of rendering speed, whole bones in skeleton model can be rendered simultaneously corresponding complete The shade piece of role described in portion, generates the shade of each role, is rendered while can disposably realizing whole roles, very big journey Improve rendering speed in degree ground.
In one embodiment, the generating process of role's shade can be rendered by way of textures are rendered.Under Face will combine Fig. 4, be that the process shown in step of embodiment of the present invention S303 is specifically described.
Step S401, obtains the viewing area where the role, standard textures is matched on the viewing area.
The synchronous real-time rendering of the shade for carrying out multiple roles is needed, the current display area where the role is obtained.Institute It can be the whole viewing areas for showing the role and its environment when application program is run on application terminal to state viewing area, or It is the viewing area that the dominant role position machine periphery certain limit selected by user is constituted.It is pre- in Shading Rendering device Provided with standard textures, the role for the correspondence viewing area on the standard textures carries out role's Shading Rendering.Obtain institute State behind the viewing area where role, standard textures are matched into the viewing area.
Step is 402, rule is set according to default factor value, according to the shade of the role in the viewing area State, sets the factor value of whole pixels on the correspondence standard textures.
The standard textures are covered behind the viewing area, each pixel correspondence mark on viewing area A pixel on quasi- textures.The characteristic point position of each role on viewing area needs to show shade, other clear areas The characteristic point position of domain or non-character need not show shade, record the shadow state of each pixel of viewing area.Mark The pixel on each pixel correspondence viewing area on quasi- textures, according to the shadow state of pixel on viewing area, if Put the factor value of the pixel of the correspondence standard area, by the specific value of the factor value of pixel, judge whether to need into Row Shading Rendering.The factor value includes zero factor value of the pixel of correspondence shadow-free state and to that should have the picture of shadow state The material elements value of vegetarian refreshments.Factor value is preset with the Shading Rendering device rule is set, according in the viewing area The shadow state of the role, sets the factor value of whole pixels on the correspondence standard textures.Pixel on standard textures Factor value can be pixel alpha value, the factor value set-up mode of pixel may refer to Fig. 5, below will be to step S402 implementation process is specifically described.
Step S501, obtains the shadow state of the whole pixel of the viewing area.
Carry out standard textures on Shading Rendering when, first to obtain the shade shape of each pixel of the viewing area State, the shadow state can be:The pixel whether there is role's shade, and there is the pixel distance of role's shade Role characteristic point apart from corresponding shade depth of size etc..Shadow state in the absence of the pixel of role's shade is zero cloudy Shadow, the pixel that there is role's shade is nearer apart from role characteristic point, and shade is deeper, and more remote apart from role characteristic point, shade is got over It is shallow.Range cell on viewing area can be corresponded to the specific distance value of pixel and role characteristic point, by shade depth Quantified.
Step S502, whether the shadow state for judging each pixel is shadow-free state.
If the shadow state of the pixel is shadow-free state, step S503 is performed, by pixel correspondence The alpha value of the pixel of the standard textures is set to 0.
If the shadow state of the pixel performs step S504, according to the pixel and institute to there is shadow state The relative distance of role is stated, the alpha value of pixel of the pixel correspondence standard textures is set between 1-255 Value, wherein, the size of the relative distance of the pixel and the role, with the size of corresponding alpha value into positive correlation.
The shadow state of role on viewing area is obtained according to above-mentioned steps, the factor value of pixel on standard textures is carried out Set, and then Shading Rendering is carried out according to the factor value value of each pixel in standard pixel.Rendered carrying out pixel During operation judges, whether the shadow state for judging pixel is shadow-free state.If the shadow state of the pixel is nothing Shadow state, then prove that role's shade is not present in the pixel of viewing area, then can be corresponding described by the pixel The alpha value of the pixel of standard textures is set to 0, then it represents that the pixel on the standard textures need not be rendered.
If the shadow state of the pixel proves that the pixel of viewing area has role to there is shadow state Shade, according to the size apart from distance value that this has shadow state corresponding with role characteristic point, sets the pixel in standard Specific alpha value on textures.The alpha of pixel represents the transparency of pixel epigraph, and its span is 0-255, The bigger images transparent degree for representing pixel of value is smaller.It is more remote apart from role in view of in practical application, the transparency of shade Relatively bigger, display color is more shallow, nearer apart from role, and the transparency of shade is relatively smaller, and display color is deeper.By each picture The alpha value of vegetarian refreshments is quantified as material elements value, and hypographous local picture pixels Alpha values are set to 1 to 255 value, do not had The place of shade is set to 0, the more remote local alpha value of digression color closer to 0, the nearer local alpha value of digression color closer to 255。
Step S403, according to the factor value of whole pixels on the standard textures, renders the shade of the role.
Obtained according to above-mentioned steps on standard textures after the factor value of pixel, carry out rendering for role's shade.
In one embodiment, it is contemplated that in the Shading Rendering method that the present embodiment is provided, whole shades are drawn in whole On the buffering area of individual standard textures, the size of buffering area can be adjusted according to the performance of application terminal, to adjust conjunction The shade of suitable fine degree.It is more smooth in order to run for the relatively low threshold of some configurations, buffering area can be turned down, Stock size is no more than 512*512.The actual conditions run according to application program, it is 128 to set buffer size, you can realized The textures of shade in whole application program.
The disk shade of the present embodiment is an orthogonal perspective shade, and size can be controlled in 128*128.In gaming world In, any sawtooth is not seen in the visible shadow within 128 meters of surrounding.Because according to project experiences, role's size is generally set It is set to 1 to 2 long measures, then be clear that the scope of picture detail in general game, that is, role at one's side 20 Into 30 distance, 128*128 textures are spread apart from interior at this, then in each unit distance map block, can be with Get nearly 4 pixels to render, shade this element is almost given expression to enough.Institute is covered with 128*128 textures State behind viewing area, it is in the region of radius that can correspond to and render 20 to 30 long measures around role.
On the basis of above-described embodiment, standard textures can control it is minimum, and due to needs shadow information only One Alpha value, so picture format can use Alpha8 forms, i.e., each pixel only accounts for octet, for accounting for for internal memory It is ultimate attainment with having accomplished.Alpha8 is a preferred scheme, because to preserve 8 alpha values here, most saves space-efficient method and is Alpha8, can also include other picture formats.Due to low side machine especially Android machine, GPU is multifarious, to textures form Support be also it is of all kinds have, the GPU being difficult to ensure does not support this form textures of Alpha8, then be ready for next A little textures forms are for selection:RGB565, ARGB4444, if above form is not supported, can also be used most general ARGB32 forms.
The Shading Rendering method that the embodiments of the present invention are provided, the shade for rendering multiple roles in application program. Obtain in the application program the first quantity of all roles first, obtain to should application program skeleton model, make The second quantity of bone for including of the skeleton model and the first quantity of role are consistent so that each bone can with It is assigned to a role.After the skeleton model for the bone for setting up the second quantity, bone role match is carried out.Search each role Index point, a bone is matched to the index point of a role, you can complete each bone and each angle in skeleton model The matching of color.Complete after matching, render the whole bone in the skeleton model, you can the moon of each role of generation Shadow.By way of bone is rendered, each bone in skeleton model is matched into a role, the shade of the role is used as.It is logical Cross and render the Shading Rendering that multiple roles in correspondence program can be achieved in whole bones in skeleton model, ensureing to render experience On the premise of, reduce shadow-buffer and render cost, improve rendering speed.Rendered by the batch of skeleton model one come complete The shade of portion role, improves rendering speed, and then reduce the influence to application terminal operating speed.Both it ensure that shade Intuitive, simplifies to shadow algorithm, and the internal memory of the standard textures occupancy application terminal of shade is optimized, and improves Shade drafting efficiency.
Fig. 6 is referred to, the functional block diagram of the Shading Rendering device provided for second embodiment of the invention.The shade wash with watercolours Dye device 600 is used for the shade for rendering multiple roles in application program, and the application rendering device that the present embodiment is provided can be ibid The Shading Rendering device 101 of embodiment offer is provided.The Shading Rendering device 600 includes:Role's quantity acquisition module 601, mould Type sets up module 602, bone matching module 603 and shadow generation module 604.
Role's quantity acquisition module 601, the first quantity for obtaining whole roles in the application program;
Model building module 602, the skeleton model for setting up the correspondence application program, wherein, the skeleton model In include the bone of the second quantity, first quantity is equal to second quantity;
Each bone is matched to multiple by bone matching module 603, the index point for searching each role The index point of a role in the role;
Shadow generation module 604, for rendering the whole bone in the skeleton model, each role of generation Shade.
On the basis of above-described embodiment, the shadow generation module 604 is used for:
Obtain the model of each bone;
According to each model generation shade piece;
The shade piece of each role is rendered, the shade of the role is generated.
The Shading Rendering device that the embodiments of the present invention are provided, the shade for rendering multiple roles in application program. Obtain in the application program the first quantity of all roles first, obtain to should application program skeleton model, make The second quantity of bone for including of the skeleton model and the first quantity of role are consistent so that each bone can with It is assigned to a role.After the skeleton model for the bone for setting up the second quantity, bone role match is carried out.Search each role Index point, a bone is matched to the index point of a role, you can complete each bone and each angle in skeleton model The matching of color.Complete after matching, render the whole bone in the skeleton model, you can the moon of each role of generation Shadow.By way of bone is rendered, each bone in skeleton model is matched into a role, the shade of the role is used as.It is logical Cross and render the Shading Rendering that multiple roles in correspondence program can be achieved in whole bones in skeleton model, ensureing to render experience On the premise of, reduce shadow-buffer and render cost, improve rendering speed.Rendered by the batch of skeleton model one come complete The shade of portion role, improves rendering speed, and then reduce the influence to application terminal operating speed.Both it ensure that shade Intuitive, simplifies to shadow algorithm, and the internal memory of the standard textures occupancy application terminal of shade is optimized, and improves Shade drafting efficiency.The specific implementation process of Shading Rendering device provided in an embodiment of the present invention refers to above method implementation Example, this is no longer going to repeat them.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (10)

1. a kind of Shading Rendering method, it is characterised in that the shade for rendering multiple roles in application program, methods described bag Include:
Obtain the first quantity of whole roles in the application program;
The skeleton model of the correspondence application program is set up, wherein, the bone of the second quantity is included in the skeleton model, it is described First quantity is equal to second quantity;
The index point of each role is searched, each bone is matched to the mark of a role in multiple roles Point;
Render the whole bone in the skeleton model, the shade of each role of generation.
2. it is according to the method described in claim 1, it is characterised in that render the whole bone in the skeleton model, raw Into each role shade the step of include:
Obtain the model of each bone;
According to each model generation shade piece;
The shade piece of each role is rendered, the shade of the role is generated.
3. method according to claim 2, it is characterised in that render the shade piece of each role, generate the role Shade the step of include:
The shade piece of all roles is rendered with batch, the shade of each role is generated according to rendering result.
4. method according to claim 3, it is characterised in that the model of each bone is obtained, according to each described The step of model formation shade piece, includes:
Obtain four model points that the bone of the Feature Points Matching of the role is included;
Square model is set up according to four model points;
The circular shade piece of the role is generated according to the square model.
5. method according to claim 4, it is characterised in that the index point of the role is personage's pin position of the role Put, search the index point of each role, each bone is matched to the mark of a role in multiple roles The step of point, includes:
Search personage's placement of foot of each role;
One bone is matched to personage's placement of foot of a role in multiple roles so that the bone with Personage's pin movement of the role.
6. method according to claim 2, it is characterised in that render the shade piece of each role, generate the role Shade the step of include:
The viewing area where the role is obtained, standard textures are matched on the viewing area;
Rule is set according to default factor value, according to the shadow state of the role in the viewing area, correspondence is set The factor value of whole pixels on the standard textures, wherein, the factor value includes the pixel of correspondence shadow-free state Zero factor value and to that should have the material elements value of the pixel of shadow state;
According to the factor value of whole pixels on the standard textures, the shade of the role is rendered.
7. method according to claim 6, it is characterised in that the factor value includes the alpha value of pixel, according to pre- If factor value rule is set, according to the shade of the role in the viewing area, set on the correspondence standard textures All the step of factor value of the pixel includes:
Obtain the shadow state of the whole pixel of the viewing area;
Whether the shadow state for judging each pixel is shadow-free state;
If the shadow state of the pixel is shadow-free state, by the pixel of the pixel correspondence standard textures Alpha value be set to 0;
If the shadow state of the pixel is has shadow state, according to the pixel and the relative distance of the role, if The alpha value for putting the pixel of the pixel correspondence standard textures is the value between 1-255, wherein, the pixel With the size of the relative distance of the role, with the size of corresponding alpha value into positive correlation.
8. method according to claim 7, it is characterised in that the picture format of the standard textures is alpha8 forms.
9. a kind of Shading Rendering device, it is characterised in that the shade for rendering multiple roles in application program, the shade wash with watercolours Dye device includes:
Role's quantity acquisition module, the first quantity for obtaining whole roles in the application program;
Model building module, the skeleton model for setting up the correspondence application program, wherein, comprising the in the skeleton model The bone of two quantity, first quantity is equal to second quantity;
Bone matching module, the index point for searching each role, multiple angles are matched to by each bone The index point of a role in color;
Shadow generation module, for rendering the whole bone in the skeleton model, the shade of each role of generation.
10. device according to claim 9, it is characterised in that the shadow generation module is used for:
Obtain the model of each bone;
According to each model generation shade piece;
The shade piece of each role is rendered, the shade of the role is generated.
CN201710539413.0A 2017-07-04 2017-07-04 Shading Rendering method and apparatus Pending CN107230249A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710539413.0A CN107230249A (en) 2017-07-04 2017-07-04 Shading Rendering method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710539413.0A CN107230249A (en) 2017-07-04 2017-07-04 Shading Rendering method and apparatus

Publications (1)

Publication Number Publication Date
CN107230249A true CN107230249A (en) 2017-10-03

Family

ID=59957406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710539413.0A Pending CN107230249A (en) 2017-07-04 2017-07-04 Shading Rendering method and apparatus

Country Status (1)

Country Link
CN (1) CN107230249A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107885484A (en) * 2017-12-08 2018-04-06 北京酷我科技有限公司 A kind of caching establishing method of panorama audio
CN110570508A (en) * 2019-07-23 2019-12-13 博志生物科技(深圳)有限公司 three-dimensional visualization rendering method for osteoporosis condition
CN110692089A (en) * 2017-10-04 2020-01-14 谷歌有限责任公司 Shadow generation for inserted image content
CN111371966A (en) * 2020-03-24 2020-07-03 深圳市励得数码科技有限公司 Method, device and storage medium for synthesizing foreground character shadow in virtual studio

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006285511A (en) * 2005-03-31 2006-10-19 Namco Bandai Games Inc Program, information storage medium and image generation system
JP2007200110A (en) * 2006-01-27 2007-08-09 Samii Kk Image processing device, image processing method, and computer program
JP2008305241A (en) * 2007-06-08 2008-12-18 Samii Kk Image generation device and image generation program
US20090062000A1 (en) * 2006-01-26 2009-03-05 Konami Digital Entertainment Co., Ltd. Game machine, game machine control method, and information storage medium
CN103973634A (en) * 2013-01-24 2014-08-06 腾讯科技(深圳)有限公司 Application data construction method, related equipment and network system
US20140267249A1 (en) * 2013-03-14 2014-09-18 Dreamworks Animation Llc Shadow contouring process for integrating 2d shadow characters into 3d scenes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006285511A (en) * 2005-03-31 2006-10-19 Namco Bandai Games Inc Program, information storage medium and image generation system
US20090062000A1 (en) * 2006-01-26 2009-03-05 Konami Digital Entertainment Co., Ltd. Game machine, game machine control method, and information storage medium
JP2007200110A (en) * 2006-01-27 2007-08-09 Samii Kk Image processing device, image processing method, and computer program
JP2008305241A (en) * 2007-06-08 2008-12-18 Samii Kk Image generation device and image generation program
CN103973634A (en) * 2013-01-24 2014-08-06 腾讯科技(深圳)有限公司 Application data construction method, related equipment and network system
US20140267249A1 (en) * 2013-03-14 2014-09-18 Dreamworks Animation Llc Shadow contouring process for integrating 2d shadow characters into 3d scenes

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110692089A (en) * 2017-10-04 2020-01-14 谷歌有限责任公司 Shadow generation for inserted image content
CN110692089B (en) * 2017-10-04 2023-06-06 谷歌有限责任公司 Method and system for generating shadows of inserted content
CN107885484A (en) * 2017-12-08 2018-04-06 北京酷我科技有限公司 A kind of caching establishing method of panorama audio
CN110570508A (en) * 2019-07-23 2019-12-13 博志生物科技(深圳)有限公司 three-dimensional visualization rendering method for osteoporosis condition
CN110570508B (en) * 2019-07-23 2023-09-08 博志生物科技(深圳)有限公司 Three-dimensional visual rendering method for osteoporosis condition
CN111371966A (en) * 2020-03-24 2020-07-03 深圳市励得数码科技有限公司 Method, device and storage medium for synthesizing foreground character shadow in virtual studio
CN111371966B (en) * 2020-03-24 2022-02-08 深圳市励得数码科技有限公司 Method, device and storage medium for synthesizing foreground character shadow in virtual studio

Similar Documents

Publication Publication Date Title
US11619989B2 (en) Gaze and saccade based graphical manipulation
CN108479067B (en) The rendering method and device of game picture
US10353464B2 (en) Gaze and saccade based graphical manipulation
US11714487B2 (en) Gaze and smooth pursuit based continuous foveal adjustment
US9916676B2 (en) 3D model rendering method and apparatus and terminal device
CN106575445B (en) Fur avatar animation
CN107230249A (en) Shading Rendering method and apparatus
TWI343530B (en) Method,system and computer program product for data formatting
US20140302930A1 (en) Rendering system, rendering server, control method thereof, program, and recording medium
CN105976417A (en) Animation generating method and apparatus
CN105487848B (en) A kind of the display method for refreshing and system of 3D application
CN106910236A (en) Rendering indication method and device in a kind of three-dimensional virtual environment
CN108604385A (en) A kind of application interface display methods and device
CN110196746A (en) Interactive interface rendering method and device, electronic equipment, storage medium
CN107302694B (en) Method, equipment and the virtual reality device of scene are presented by virtual reality device
US10895909B2 (en) Gaze and saccade based graphical manipulation
CN105550973B (en) Graphics processing unit, graphics processing system and anti-aliasing processing method
CN109102560A (en) Threedimensional model rendering method and device
US20220230375A1 (en) Three-dimensional avatar generation and customization
CN105631923A (en) Rendering method and device
CN111179396A (en) Image generation method, image generation device, storage medium, and electronic device
CN106204703A (en) Three-dimensional scene models rendering intent and device
JP2017068438A (en) Computer program for generating silhouette, and computer implementing method
US20180365878A1 (en) Facial model editing method and apparatus
WO2017174006A1 (en) Image processing method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171003