PDA

View Full Version : GLSL to GLSL ES translation



pakito
03-28-2011, 02:26 AM
how do you translate "in" and "out" parameters from GLSL to GLSL ES ?
since i wanna port some GLSL shaders into GLSL ES

tksuoran
03-28-2011, 07:07 AM
GLSL*#version 330 -> GLSL*ES:

vertex shader "in" -> "attribute"
vertex shader "out" ->*"varying"
fragment shader "in" -> "varying"

pakito
04-04-2011, 01:39 AM
thank you, what about fragment shader "out" ?

Zenja
04-07-2011, 02:42 AM
You need to write to the built in variables (eg. gl_FragColor)

kRogue
04-07-2011, 06:06 AM
one thing you will also need to pay very serious attention to is precision qualifiers. On most embedded devices, choosing incorrect precision qualifies can have dramatically bad consequences in terms of performance and/or render quality.