mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Try implementing core context version of XMB ribbon
This commit is contained in:
parent
c16bb5ff5e
commit
03ee897ae2
18
gfx/drivers/gl_shaders/core_pipeline_xmb_ribbon.glsl.frag.h
Normal file
18
gfx/drivers/gl_shaders/core_pipeline_xmb_ribbon.glsl.frag.h
Normal 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);
|
||||
}
|
||||
);
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user