Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

瘦脸参数怎么传递 我的是vec2的怎么转你的vec4 #1

Open
INTKILOW opened this issue Apr 15, 2022 · 1 comment
Open

瘦脸参数怎么传递 我的是vec2的怎么转你的vec4 #1

INTKILOW opened this issue Apr 15, 2022 · 1 comment

Comments

@INTKILOW
Copy link

uniform vec4 u_preCtrlPoints;//pre控制点
uniform vec4 u_curCtrlPoints;//cur控制点
uniform float u_reshapeRadius;//影响半径
uniform float u_reshapeRatio;//强度

@ouyangpeng
Copy link
Owner

在FaceSlenderSample.cpp里面不是写了吗?

就是把两个点的坐标 变成一个坐标 的 xy 和 zw

GLUtils::setVec4(m_ProgramObj, "u_preCtrlPoints",
             LeftSlenderCtlPoint[0] / (float) m_RenderImage.width,
             LeftSlenderCtlPoint[1] / (float) m_RenderImage.height,
             RightSlenderCtlPoint[0] / (float) m_RenderImage.width,
             RightSlenderCtlPoint[1] / (float) m_RenderImage.height);

//   ... 其他代码

 GLUtils::setVec4(m_ProgramObj, "u_curCtrlPoints",
                     leftCurPoint.x / (float) m_RenderImage.width,
                     leftCurPoint.y / (float) m_RenderImage.height,
                     rightCurPoint.x / (float) m_RenderImage.width,
                     rightCurPoint.y / (float) m_RenderImage.height);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants