[PyOpenGL-Users] First fragment shader
Brought to you by:
mcfletch
From: Mads I. <mp...@co...> - 2009-10-12 07:04:15
|
OK, so its time to write the first most simple fragment shader ever. But it doesn't work: void main() { gl_FragColor = vec4(0.5, 0.5, 0.5, 1.0); } No teapot. Changing to gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); gives red teapot, and vec4(0.0, 0.5, 0.0, 1.0) and vec4(0.0, 0.0, 1.0, 1.0) gives green and blue teapot. But any RGB triplet with values < 1.0 are always truncated to 0.0. For example: vec4(1.0, 0.5, 0.0, 1.0) -> pure red vec4(0.0, 0.5, 0.5, 1.0) -> pure black I have no clue about whats up. Best regards, Mads -- +-------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +-------------------------------+-----------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Nørre Søgade 27A | www: www.quantumwise.com | | DK-1370 Copenhagen K, Denmark | email: mp...@qu... | +-------------------------------+-----------------------------+ |