Skip to content

Edge blending shift#14

Open
colinbouvry wants to merge 4 commits into
paulhoux:masterfrom
colinbouvry:master
Open

Edge blending shift#14
colinbouvry wants to merge 4 commits into
paulhoux:masterfrom
colinbouvry:master

Conversation

@colinbouvry

Copy link
Copy Markdown

Hello Paul,
I needed to shift edge blending to adjust easily
I added
mShader->uniform( "uShift", mShift + vec4(-mX1, -mY1, 1.f - mX2, 1.f - mY2) );
because with this code it did not worked with edge
warp->draw(texture, m_oSrcArea);

but with this, It worked !
warp->begin(); gl::draw(texture, m_oSrcArea, warp->getBounds()); warp->end();
`

Perhaps we should add this method into WarpPerspective class ?
void setTexCoords( float x1, float y1, float x2, float y2 );
Thanks for this nice block !

@paulhoux

Copy link
Copy Markdown
Owner

Thanks Colin, I'll have a look. Not sure if "shift" is the best name for it, though. "Offset" would sound more appropriate, but perhaps we should allow to set the texcoords directly and make sure the edge blending takes them into account.

@colinbouvry

Copy link
Copy Markdown
Author

I hesitated between shift and offset !
Ok for Offset !
How to set the texcoords directly ? Using uEdges ?

@zx13098499270

Copy link
Copy Markdown

你好,我需要这种功能,可以加我微信17621807340,给你报酬

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

Successfully merging this pull request may close these issues.

3 participants