Simulating PS1 "shaky vertices" with shaders

Started by
10 comments, last by Daaark 11 years, 3 months ago
glPosition was post all transformations. that line was the last line in the vertex shader. I'm not sure quite what you're going for wit that code.. I assume that you meant to type this:

gl_Position.xy = fract(gl_Position.xy/gl_Position.w*(1./4.))*4.*gl_Position.w;

Using fract doesn't make sense to me in this case. floor makes more sense, but I get similar problems anyway. Everything shows up strangely stretched in one quarter of the screen.

sorry, that was a typo, was a bit in a hurry. floor instead of fract is correct.

but my point was, that you need the division by .w to be in screenspace.

maybe your issue is a different bug, post a screenshot maybe smile.png

Fixed it by multiplying by w inside the floor and dividing outside.

gl_Position.xy = floor(gl_Position.xy*gl_Position.w*.25)*4/gl_Position.w;

Gives a wobbling effect. Doesn't quite feel like PS1 shaking yet, but there's probably a lot of other stuff combining too. Thanks

Advertisement
You're talking about texture artifacts (

EDIT: typo.
Read my first sentence.

This topic is closed to new replies.

Advertisement