This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_fire_frag.glsl
Mike Erwin b95ee78ed3 OpenGL: prepare GLSL for version 3.3
- use in/out instead of attribute/varying
- use named output instead of gl_FragColor
- use texture() instead of the multitude of older texture sampling functions

The #if __VERSION__ == 120 paths (needed on Mac) will be removed after we switch to 3.3 core profile.

Part of T49165 (general OpenGL upgrade)
2017-03-27 01:16:18 -04:00

26 lines
478 B
GLSL

#if __VERSION__ == 120
varying vec3 coords;
#define fragColor gl_FragColor
#else
in vec3 coords;
out vec4 fragColor;
#define texture1D texture
#define texture3D texture
#endif
uniform sampler3D flame_texture;
uniform sampler1D spectrum_texture;
void main()
{
float flame = texture3D(flame_texture, coords).r;
vec4 emission = texture1D(spectrum_texture, flame);
vec4 color;
color.rgb = emission.a * emission.rgb;
color.a = emission.a;
fragColor = color;
}