【发布时间】:2022-04-21 21:14:33
【问题描述】:
为什么会出现这一行:
float x = 1 - gl_Color.x;
给:
(26): error: Could not implicitly convert operands to arithmetic operator
【问题讨论】:
为什么会出现这一行:
float x = 1 - gl_Color.x;
给:
(26): error: Could not implicitly convert operands to arithmetic operator
【问题讨论】:
GLSL(#version 120 之前)不允许整数和浮点之间的隐式转换。 1 是一个整数,gl_Color.x 是一个浮点数,所以会出现错误。你需要
float x = 1.0 - gl_Color.x;
改为
【讨论】: