문제

I would like to have two pixel shaders; the first doing one thing, and then the next doing something else. Is this possible, or do I have to pack everything into the one shader?

도움이 되었습니까?

해결책

You can do do this, e.g. by doing function calls from the main entrypoint to functions that are implemented in the various shader objects.

main() {
    callToShaderObject1()
    callToShaderObject2()
}

each of those callToShaderObject functions can live in different shader objects, but all objects have to be attached and linked in the same program before it can be used.

다른 팁

They can't run at the same time, but you are free to use different shaders for different geometry, or to render in multiple passes using different shaders.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top