CN110490961B - Hair brush tool and hair drawing method - Google Patents

Hair brush tool and hair drawing method Download PDF

Info

Publication number
CN110490961B
CN110490961B CN201910751255.4A CN201910751255A CN110490961B CN 110490961 B CN110490961 B CN 110490961B CN 201910751255 A CN201910751255 A CN 201910751255A CN 110490961 B CN110490961 B CN 110490961B
Authority
CN
China
Prior art keywords
hair
module
brush
texture
file
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.)
Active
Application number
CN201910751255.4A
Other languages
Chinese (zh)
Other versions
CN110490961A (en
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.)
Tianjin Youle Mutual Entertainment Technology Co ltd
Original Assignee
Tianjin Youle Mutual Entertainment 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 Tianjin Youle Mutual Entertainment Technology Co ltd filed Critical Tianjin Youle Mutual Entertainment Technology Co ltd
Priority to CN201910751255.4A priority Critical patent/CN110490961B/en
Publication of CN110490961A publication Critical patent/CN110490961A/en
Application granted granted Critical
Publication of CN110490961B publication Critical patent/CN110490961B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a hair brush tool and a method for drawing hair, wherein the tool comprises a single-channel drawing module, a FollowMap drawing module, a real-time preview module, an automatic texture attribute display module, a brush module, a snapshot module, a file storage module and a hair generation module; and performing corresponding processing on the file to be drawn among the modules, finally acquiring a hair drawing result file, storing the hair drawing result file in a disk file, and then performing real-time hair generation and rendering on the hair drawing result file. The advantages are that: by drawing the hair trend and the hair attribute in the unity, the what you see is what you get effect can be obtained, the problems of leading in and leading out between software and invisible effect during drawing are avoided, the time for debugging back and forth is reduced, and the development efficiency and the effect are improved; and convenient functions such as shortcut keys, snapshots, save in addition and the like are provided for drawing.

Description

Hair brush tool and hair drawing method
Technical Field
The invention relates to the field of hair drawing in a Unity engine, in particular to a hair brush tool and a hair drawing method.
Background
Tools for drawing a paste have been available in the Unity engine, such as meslpaerter, inkPainter and paintIn3D, but these tools have a number of disadvantages, including the inability to provide a drawing and combing hair function, a channel drawing function, a snapshot function, a followMap function, a paste thumbnail real-time preview function, an auto-show texture property function, and a shortcut function. Meanwhile, the existing tools have the following problems:
1. the hair combing function is not available, and a hair walking pattern cannot be drawn quickly; no single-channel drawing function exists;
2. data of a single channel cannot be modified conveniently, and other data channels can be influenced by each drawing;
3. without the snapshot function, it is not convenient to return to a previous state;
4. the hair walking map cannot be quickly drawn without the followmap function;
5. the current drawing effect cannot be known in time due to the fact that a thumbnail real-time preview function is not available;
6. without the automatic texture attribute display function, the texture attributes of the material cannot be accurately known;
7. the lack of a shortcut function results in a slow tool or function switching speed, which is not conducive to quick operation.
Disclosure of Invention
It is an object of the present invention to provide a hair brush tool and a method of drawing hair that solves the aforementioned problems of the prior art.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a hair brush tool, said tool comprising,
a single channel rendering module; the single-channel reading and writing device is used for reading and writing the brush texture in a single channel;
a FollowMap drawing module; the normal texture used for drawing the tangent space;
a real-time preview module; the method is used for displaying the drawing result of the brush texture in real time;
a module for automatically displaying texture attributes; the brush texture node is used for automatically detecting available brush texture nodes of hair materials and displaying the brush texture nodes in a pull-down list;
a brush module; the system is used for storing brush strength, size information and brush textures;
a snapshot module; the drawing state is temporarily stored, so that the drawing state is convenient to find back subsequently;
a file saving module; the file storage device is used for storing the drawn file into a disk file;
a hair generation module; and the system is used for generating and rendering the hair in real time according to the generated map drawn by the brush module.
Preferably, a FollowMap drawing logic is arranged in the FollowMap drawing module, a spatial conversion matrix is customized in the FollowMap drawing logic, and the spatial conversion matrix is used for converting normal line information into a tangent space.
Preferably, the hairbrush tool runs in a Unity engine, an internal verification tool TAToolCommon library is further arranged in the Unity engine, and the running of the hairbrush tool depends on the TAToolCommon library.
Preferably, the single-channel drawing module performs single-channel reading and writing on the brush texture to acquire single-channel data, and stores the single-channel data on the chartlet; the single-channel drawing module is also used for storing the growth length of the hair, the density degree of the hair and the influence degree of the hair on the normal map.
Preferably, the hair generation module can calculate and generate movement direction data of the brush, and store the data on the normal map, and the hair material acquires the growth direction of the hair through the data.
It is also an object of the present invention to provide a method of drawing hair, the method being carried out using any of the hair brush implements described above, comprising the steps of,
s1, reading material attributes by the hairbrush tool;
s2, the automatic texture attribute display module detects available texture attributes of hair materials, displays the available texture attributes to a pull-down menu, and selects corresponding texture attributes according to requirements of a file to be drawn; the automatic texture attribute showing module associates the corresponding texture attributes to the brush module and the real-time preview module;
s3, the brush module draws texture information on the file to be drawn according to the selected brush mode and writes a drawing result into a texture map; meanwhile, the real-time preview module reflects the drawing result to a preview window of the engine in real time so as to obtain a hair drawing result file;
s4, the file storage module stores the hair drawing result file into a disk file;
and S5, the hair generation module generates and renders the hair in real time according to the mapping information contained in the hair material.
Preferably, in step S3, the brush module selects to use a single-channel drawing module or a Followmap module according to the selected brush mode, and calls a drawing method stored therein to draw texture information on the file to be drawn, and performs drawing result calculation to obtain a drawing result.
Preferably, the single-channel drawing module calculates the selected channel to obtain a drawing result; and the Followmap module draws a normal map of a tangent space according to the handwriting to obtain a hair drawing result file.
Preferably, the snapshot module temporarily stores the texture state of the file to be drawn in the drawing process.
The invention has the beneficial effects that: 1. by drawing the hair trend and the attributes in the unity, the WYSIWYG effect can be obtained, the problems of leading-in and leading-out among software and invisible effect during drawing are avoided, the time for back and forth debugging is shortened, and the development efficiency and the effect are improved. 2. And convenient functions such as shortcut keys, snapshots, save in addition and the like are provided for drawing.
Drawings
FIG. 1 is a schematic representation of the principle of a hairbrush implement according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
Example one
As shown in fig. 1, the present embodiment provides a hair brush tool, comprising,
a single-channel rendering module; the single-channel reading and writing device is used for reading and writing the brush texture in a single channel;
a FollowMap drawing module; the normal texture used for drawing the tangent space;
a real-time preview module; the method is used for displaying the drawing result of the brush texture in real time;
a module for automatically displaying texture attributes; the brush texture node is used for automatically detecting available brush texture nodes of hair materials and displaying the brush texture nodes in a pull-down list;
a brush module; the pen brush storage module is used for storing pen brush strength, size information and pen brush textures;
a snapshot module; the drawing state is temporarily stored, so that the drawing state is convenient to find back subsequently;
a file saving module; the file storage device is used for storing the drawn file into a disk file;
a hair generation module; and the system is used for generating and rendering the hair in real time according to the generated map drawn by the brush module.
In this embodiment, a FollowMap rendering logic is set in the FollowMap rendering module, a spatial transformation matrix is customized in the FollowMap rendering logic, and the spatial transformation matrix is used for transforming normal line information into a tangent space.
In this embodiment, the normal information refers to a dotted line always perpendicular to a certain plane, and in mathematical geometry, the normal refers to a line perpendicular to a tangent line of a curve at a certain point on the plane. The normal also applies to physically planar specular reflections. The normal represents the direction of the current pixel point, the normal is represented by a three-dimensional vector, the numerical values represented in different coordinate spaces are different, the drawn normal is located in a world space coordinate system, and a tangent space coordinate system of an object is stored, so that the normal information needs to be converted into the tangent space by using a space conversion matrix.
In this embodiment, the hairbrush tool runs in a Unity engine, an internal verification tool TAToolCommon library is further arranged in the Unity engine, and the running of the hairbrush tool depends on the TAToolCommon library.
In this embodiment, the TAToolCommon provides an operating environment monitoring function, and can detect whether an operating environment of the plug-in meets an operating requirement of the plug-in. And calling a verification method provided in the library for verification during initial running of the brush tool, and obtaining a result of the pool, wherein true is passed, and false is not passed. And if the program passes the judgment, the program runs, and if the program does not pass the judgment, the program prompts that the environment is not accordant, and the running is stopped.
In this embodiment, the single-channel rendering module performs single-channel reading and writing on the brush texture to obtain single-channel data, and stores the single-channel data on the chartlet; the single-channel drawing module is also internally stored with the growth length of the hair, the density of the hair and the degree of influence of the hair on the normal map.
In this embodiment, the single-channel data is explained as follows: the first picture has three to four channels, three are RGB, and four are RGBA. The single channel data refers to data of one of the channels, such as R channel data or G channel data.
In this embodiment, the normal map is obtained by taking a normal line at each point of the concave-convex surface of the original object, and marking the direction of the normal line by using RGB color channels, which can be understood as another different surface parallel to the original concave-convex surface, but actually is a smooth plane. For the visual effect, the efficiency of the light source is higher than that of the original concave-convex surface, and if the light source is applied to a specific position, the surface with lower detail degree can generate accurate illumination direction and reflection effect with high detail degree.
In this embodiment, the hair generation module can calculate and generate movement direction data of the brush, and store the data on the normal map, and the hair material obtains the growth direction of the hair through the data.
In this embodiment, the snapshot module can quickly roll back the drawing result to the snapshot state.
Example two
In this embodiment, a method of drawing hair is provided, the method being implemented using a hairbrush implement, comprising the steps of,
s1, reading material attributes by the hairbrush tool;
s2, the automatic texture attribute display module detects available texture attributes of hair materials, displays the texture attributes to a pull-down menu, and selects corresponding texture attributes according to the requirements of a file to be drawn; the automatic texture attribute showing module associates the corresponding texture attributes to the brush module and the real-time preview module;
s3, the brush module draws texture information of the file to be drawn according to the selected brush mode and writes a drawing result into a texture map; meanwhile, the real-time preview module reflects the drawing result to a preview window of the engine in real time so as to obtain a hair drawing result file;
s4, the file storage module stores the hair drawing result file into a disk file;
and S5, the hair generation module generates and renders the hair in real time according to the mapping information contained in the hair material.
In this embodiment, in step S3, the brush module selects to use a single-channel drawing module or a Followmap module according to the selected brush mode, and invokes a drawing method stored therein to draw texture information on the file to be drawn, and performs drawing result calculation to obtain a drawing result.
In this embodiment, a preview window of the engine has a brush mode selection mode, and a user can select a single channel mode or a Followmap mode by himself or herself, and select a corresponding mode to start a corresponding module.
In this embodiment, the calculation of the drawing result refers to calculating the pixel value of the current drawing area according to the selected brush mode.
In this embodiment, the single-channel rendering module calculates a selected channel to obtain a rendering result; and the Followmap module draws a normal map of a tangent space according to the pen gesture to obtain a hair drawing result file.
In this embodiment, the snapshot module temporarily stores the texture state of the file to be drawn during the drawing process.
By adopting the technical scheme disclosed by the invention, the following beneficial effects are obtained:
the invention provides a hair brush tool and a method for drawing hair, which can obtain what you see is what you get effect by drawing the trend and the attribute of the hair in unity, avoid the problems of leading in and leading out between software and invisible effect in drawing, reduce the time of debugging back and forth, and improve the development efficiency and effect; meanwhile, convenient functions such as shortcut keys, snapshots, additional storage and the like are provided for drawing.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements should also be considered within the scope of the present invention.

Claims (8)

1. A hair brush tool, characterized in that: the tool comprises a tool body and a tool body,
a single-channel rendering module; the single-channel reading and writing device is used for reading and writing the brush texture in a single channel;
a FollowMap drawing module; the normal texture used for drawing the tangent space;
a real-time preview module; the method is used for displaying the drawing result of the brush texture in real time;
a module for automatically displaying texture attributes; the brush texture node is used for automatically detecting available brush texture nodes of hair materials and displaying the brush texture nodes in a pull-down list;
a brush module; the system is used for storing brush strength, size information and brush textures;
a snapshot module; the drawing state is temporarily stored, so that the drawing state is convenient to find back subsequently;
a file saving module; the file storage device is used for storing the drawn file into a disk file;
a hair generation module; the brush module is used for drawing the generated chartlet to generate and render the hair in real time;
the hairbrush tool runs in a Unity engine, an internal verification tool TAToolCommon library is further arranged in the Unity engine, and the running of the hairbrush tool depends on the TAToolCommon library;
the single-channel drawing module performs single-channel reading and writing on the brush texture to acquire single-channel data and stores the single-channel data on a chartlet;
the single-channel data is data read by one of channels included in the first picture version.
2. A hairbrush implement according to claim 1 wherein: and a FollowMap drawing logic is arranged in the FollowMap drawing module, a space conversion matrix is customized in the FollowMap drawing logic, and the space conversion matrix is used for converting the normal information into a tangent space.
3. A hairbrush implement according to claim 1 wherein: the single-channel drawing module is also internally stored with the growth length of the hair, the density of the hair and the degree of influence of the hair on the normal map.
4. A hairbrush implement according to claim 1 wherein: the hair generation module can calculate and generate movement direction data of the brush, the data are stored on the normal map, and the hair material acquires the growth direction of the hair through the data.
5. A method of hair drawing, which is carried out using the hairbrush implement according to any one of claims 1 to 4, characterized in that: comprises the following steps of (a) carrying out,
s1, reading material attributes by the hairbrush tool;
s2, the automatic texture attribute display module detects available texture attributes of hair materials, displays the texture attributes to a pull-down menu, and selects corresponding texture attributes according to the requirements of a file to be drawn; the automatic display texture attribute module associates the corresponding texture attributes to the brush module and the real-time preview module;
s3, the brush module draws texture information of the file to be drawn according to the selected brush mode and writes a drawing result into a texture map; meanwhile, the real-time preview module reflects the drawing result to a preview window of the engine in real time so as to obtain a hair drawing result file;
s4, the file storage module stores the hair drawing result file into a disk file;
and S5, the hair generation module generates and renders the hair in real time according to the mapping information contained in the hair material.
6. The method of hair mapping according to claim 5, wherein: in step S3, the brush module selects to use a single-channel drawing module or a Followmap module according to the selected brush mode, and calls a drawing method stored therein to draw texture information of the file to be drawn, and performs drawing result calculation to obtain a drawing result.
7. The method of hair mapping according to claim 6, wherein: the single-channel drawing module calculates a selected channel to obtain a drawing result; and the Followmap module draws a normal map of a tangent space according to the handwriting to obtain a hair drawing result file.
8. A method of hair mapping as claimed in claim 7, characterized in that: and the snapshot module temporarily stores the texture state of the file to be drawn in the drawing process.
CN201910751255.4A 2019-08-15 2019-08-15 Hair brush tool and hair drawing method Active CN110490961B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910751255.4A CN110490961B (en) 2019-08-15 2019-08-15 Hair brush tool and hair drawing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910751255.4A CN110490961B (en) 2019-08-15 2019-08-15 Hair brush tool and hair drawing method

Publications (2)

Publication Number Publication Date
CN110490961A CN110490961A (en) 2019-11-22
CN110490961B true CN110490961B (en) 2023-03-31

Family

ID=68551061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910751255.4A Active CN110490961B (en) 2019-08-15 2019-08-15 Hair brush tool and hair drawing method

Country Status (1)

Country Link
CN (1) CN110490961B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111784807B (en) * 2020-07-03 2024-07-16 珠海金山数字网络科技有限公司 Virtual character drawing method and device
CN111782198B (en) * 2020-08-03 2023-08-22 网易(杭州)网络有限公司 Texture resource previewing method and device
CN112396680B (en) * 2020-11-27 2022-11-25 完美世界(北京)软件科技发展有限公司 Method and device for making hair flow diagram, storage medium and computer equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5145391B2 (en) * 2010-09-14 2013-02-13 株式会社コナミデジタルエンタテインメント Image processing apparatus, image processing apparatus control method, and program
US8988461B1 (en) * 2011-01-18 2015-03-24 Disney Enterprises, Inc. 3D drawing and painting system with a 3D scalar field
JP5828976B1 (en) * 2015-02-06 2015-12-09 株式会社アデランス Fastener for wig and wig using the same
CN106445625A (en) * 2016-09-23 2017-02-22 网易(杭州)网络有限公司 Preprocessing method and device of to-be-compiled codes

Also Published As

Publication number Publication date
CN110490961A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN110490961B (en) Hair brush tool and hair drawing method
EP2074499B1 (en) 3d connected shadow mouse pointer
CA2880345C (en) Hit testing method and apparatus
JP2010027050A (en) Monitoring of graphic processing
CN102455859B (en) A kind of frequency spectrum data display packing and device
US20210343072A1 (en) Shader binding management in ray tracing
US11087561B2 (en) Three-dimensional sketching in mobile augmented reality
Zampogiannis et al. Cilantro: A lean, versatile, and efficient library for point cloud data processing
CN110428504B (en) Text image synthesis method, apparatus, computer device and storage medium
WO2021034396A1 (en) Using bounding volume representations for raytracing dynamic units within a virtual space
CN111638497A (en) Radar data processing method, device, equipment and storage medium
US20230334729A1 (en) Image generation method, apparatus, and device, and storage medium
CN107481306B (en) Three-dimensional interaction method
CN113129362A (en) Method and device for acquiring three-dimensional coordinate data
CN108062339B (en) Processing method and device of visual chart
US20230290072A1 (en) System and method of object detection and interactive 3d models
US7379599B1 (en) Model based object recognition method using a texture engine
CN117788609A (en) Method, device, equipment and storage medium for picking up interface graphic elements
CN117523074A (en) Method and device for dynamically switching building white mold textures in batches for Web end
CN105155153A (en) Processing method for displaying local patterns in computerized embroidery machine
CN117115327A (en) Real-time rendering optimization method and device for building information model and electronic equipment
CN111524209A (en) Electronic writing method, device, terminal and storage medium
TW202338733A (en) Image processing method, image processing apparatus, and image processing system
CN115526993A (en) Three-dimensional model construction method and device, electronic equipment and storage medium
CN114067072A (en) Three-dimensional geometric figure drawing method and device and electronic equipment

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 209, 2nd Floor, Zone C, Anime Building, No. 126 Anime Middle Road, Tianjin Ecological City, Binhai New Area, Tianjin (TG No. 399)

Patentee after: Tianjin Youle mutual Entertainment Technology Co.,Ltd.

Country or region after: China

Address before: 209, 2nd Floor, Zone C, Anime Building, No. 126 Anime Middle Road, Tianjin Ecological City, Heping District, Tianjin (TG No. 399)

Patentee before: Tianjin Youle mutual Entertainment Technology Co.,Ltd.

Country or region before: China