US 12,437,450 B2
Method and apparatus for rendering hair, computer storage medium, electronic device
Chao Yang, Beijing (CN); Xiangjun Liu, Beijing (CN); Feng Du, Beijing (CN); and Chaoyang Wu, Beijing (CN)
Assigned to Beijing Wodong Tianjun Information Technology Co., Ltd., Beijing (CN); and BEIJING JINGDONG CENTURY TRADING CO., LTD., Beijing (CN)
Filed by BEIJING WODONG TIANJUN INFORMATION TECHNOLOGY CO., LTD., Beijing (CN); and BEIJING JINGDONG CENTURY TRADING CO., LTD., Beijing (CN)
Filed on Mar. 28, 2023, as Appl. No. 18/191,018.
Claims priority of application No. 202210349186.6 (CN), filed on Apr. 1, 2022.
Prior Publication US 2023/0316597 A1, Oct. 5, 2023
Int. Cl. G06T 11/00 (2006.01); G06T 7/90 (2017.01); G06T 15/00 (2011.01); G06T 15/83 (2011.01); G06V 10/60 (2022.01)
CPC G06T 11/001 (2013.01) [G06T 15/005 (2013.01); G06T 2210/62 (2013.01)] 18 Claims
OG exemplary drawing
 
1. A method for rendering hair, performed by a server, comprising:
establishing a hair model in 3D software, wherein the hair model comprises a light-oriented pixel point and a backlight pixel point, the light-oriented pixel point is a pixel point directly facing a preset light source in a virtual scene, the backlight pixel point is a pixel point facing away from the preset light source in the virtual scene, and each pixel point in the hair model contains a color value and a transparent channel value;
obtaining a pixel depth value corresponding to each pixel point by rasterizing the hair model through a vertex shader;
obtaining a first rendered result by performing transparent channel test rendering on a first specified pixel point in the hair model through a fragment shader, wherein the transparent channel test rendering comprises performing rendering on the first specified pixel point with the pixel depth value less than a preset depth threshold and the transparency channel value greater than a preset transparency threshold;
obtaining a second rendered result by performing transparent channel hybrid rendering on the backlight pixel point of the hair model based on the first rendered result through the fragment shader;
obtaining a third rendered result by performing transparent channel hybrid rendering on the light-oriented pixel point of the hair model based on the second rendered result through the fragment shader,
wherein the transparent channel hybrid rendering comprises performing rendering on a second specified pixel point in the hair model, the second specified pixel point comprising the backlight pixel point or the light-oriented pixel point, and wherein the color value of the second specified pixel point is determined based on a following formula,
current color value of the second specified pixel point * transparent channel value corresponding to the second specified pixel point+color value of the second specified pixel point determined by previous rendering result * (1-transparent channel value corresponding to the second specified pixel point); and
obtaining a final rendered result of the hair model by hybridizing the first rendered result, the second rendered result and the third rendered result, wherein hybridizing the first rendered result, the second rendered result and the third rendered result comprises performing a weighted operation on the first rendered result, the second rendered result and the third rendered result, based on a preset weight.