gpt4 book ai didi

opengl - 片段着色器 : output variables

转载 作者:行者123 更新时间:2023-12-04 03:00:04 24 4
gpt4 key购买 nike

阅读 GLSL 1.40 规范:

Fragment outputs can only be float, floating-point vectors, signed or unsigned integers or integer vectors, or arrays of any these. Matrices and structures cannot be output. Fragment outputs are declared as in the following examples:

out vec4 FragmentColor; out uint Luminosity;



片段颜色定义为 gl_FragColor... 对吗?有人可以清除我对这些输出的想法吗?我可以只写示例的“FragmentColor”来确定片段颜色吗?我可以复读它们吗(例如“光度”)?

最佳答案

在 GLSL 版本 120 之后,不推荐使用全局输出变量 gl_FragColor。
现在你必须自己给它一个名字和类型,就像你的例子一样。
关于几个输出,
此链接为您提供有关映射的信息:http://www.opengl.org/wiki/GLSL_Objects#Program_linking

(我发现该链接位于:http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=270999)

希望这可以帮助! :D

哎呀!我看到 kvark 给出了相关信息。无论如何,也许你也从我的文字中得到了一些东西。

关于opengl - 片段着色器 : output variables,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1733838/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com