Hello everyone!
I was thinking, if my fragment shader writes something. Anything, really, is it not possible to use that
in an earlier stage for the next vertex?
I just want to check on the vertex stage for the next vertex, wether something has been drawn in a specific place.
First, i just wanted to use a texture attached to an active fbo, but its not really doable, right?
GLSL - Is there really no way to read and write in one go?
No not really. You have no way to know or control the order in which which vertices and which pixels get written. Every vertex in your mesh could be executed before the pixel shader executes at all.
There's no such thing as a 'next' vertex, they all go at the same time (or at least as close to the same time as gpu can handle.)
Can you explain what you actually want to do this for?
There's no such thing as a 'next' vertex, they all go at the same time (or at least as close to the same time as gpu can handle.)
Can you explain what you actually want to do this for?
Yeah, I'm just trying to decrease overdraw in a call to a single vbo.
My fragment shader is slow, its a raycaster and the vbo contents approximate a surface of my volume.
The order of the vertices doesn't matter, so the next vertex may be anyone.
My fragment shader is slow, its a raycaster and the vbo contents approximate a surface of my volume.
The order of the vertices doesn't matter, so the next vertex may be anyone.
If there were any kind of linear relationship between vertices/pixels, that would blow away the ability for the GPU to operate in a massively parallel fashion. :P
Yes. Then it's multiple passes and texture swapping to achieve what i wanted, i guess.
Thanks! :)
Thanks! :)
Quote:
Yeah, I'm just trying to decrease overdraw in a call to a single vbo.
Then it's multiple passes and texture swapping to achieve what i wanted, i guess.
I hope "wanted" means you are not going to try and implement in a multi-pass as that is even more overdraw.
What are you drawing that has that much over-draw? Single objects shouldnt have hardly any overdraw. A cube has no overdraw, character maybe if the arms overlap the body.
Pass 1 : Depth only render with a simple fragment shader.
Pass 2 : render color and use your complex fragment shader.
Pass 2 : render color and use your complex fragment shader.
Quote:Original post by dpadam450Quote:
Yeah, I'm just trying to decrease overdraw in a call to a single vbo.
Then it's multiple passes and texture swapping to achieve what i wanted, i guess.
I hope "wanted" means you are not going to try and implement in a multi-pass as that is even more overdraw.
If done correctly, yes it will overdraw as in the fragments being considered, but no if we're talking about actual drawing, if the fragments are discarded by the detection of some depth that are < far.
Quote:Original post by dpadam450
What are you drawing that has that much over-draw? Single objects shouldnt have hardly any overdraw. A cube has no overdraw, character maybe if the arms overlap the body.
Mind you, the fragments take a long time to finish, even though i's just render a cube it is still sort of a naive raycaster.
But as i said earlier, the rendereed stuff is a coarse surface approximation,
take for instance a 3D '+' around a sphere. A little overdraw there.
Quote:Original post by V-man
Pass 1 : Depth only render with a simple fragment shader.
Pass 2 : render color and use your complex fragment shader.
Exactly!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement