Try implementing core context version of XMB ribbon

This commit is contained in:
twinaphex 2017-06-27 06:30:47 +02:00
parent c16bb5ff5e
commit 03ee897ae2
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,18 @@
#include "shaders_common.h"
static const char *core_stock_fragment_xmb = GLSL(
uniform float time;
in vec3 fragVertexEc;
vec3 up = vec3(0, 0, 1);
out vec4 FragColor;
void main()
{
vec3 X = dFdx(fragVertexEc);
vec3 Y = dFdy(fragVertexEc);
vec3 normal=normalize(cross(X,Y));
float c = (1.0 - dot(normal, up));
c = (1.0 - cos(c*c))/3.0;
FragColor = vec4(c, c, c, 1.0);
}
);

View File

@ -118,6 +118,7 @@ static const char *glsl_prefixes[] = {
#include "../drivers/gl_shaders/core_alpha_blend.glsl.frag.h"
#ifdef HAVE_SHADERPIPELINE
#include "../drivers/gl_shaders/core_pipeline_xmb_ribbon.glsl.frag.h"
#include "../drivers/gl_shaders/legacy_pipeline_xmb_ribbon_simple.glsl.vert.h"
#include "../drivers/gl_shaders/modern_pipeline_xmb_ribbon_simple.glsl.vert.h"
#include "../drivers/gl_shaders/modern_pipeline_snow.glsl.vert.h"
@ -955,7 +956,7 @@ static void *gl_glsl_init(void *data, const char *path)
if (gl_query_extension("GL_OES_standard_derivatives"))
{
shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_ribbon_modern : stock_vertex_xmb_ribbon_legacy;
shader_prog_info.fragment = stock_fragment_xmb;
shader_prog_info.fragment = glsl_core ? core_stock_fragment_xmb : stock_fragment_xmb;
}
else
{
@ -964,7 +965,7 @@ static void *gl_glsl_init(void *data, const char *path)
}
#else
shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_ribbon_modern : stock_vertex_xmb_ribbon_legacy;
shader_prog_info.fragment = stock_fragment_xmb;
shader_prog_info.fragment = glsl_core ? core_stock_fragment_xmb : stock_fragment_xmb;
#endif
shader_prog_info.is_file = false;