mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-05 04:11:50 +02:00
40 lines
1 KiB
Text
40 lines
1 KiB
Text
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// Created by Zach Pomerantz on 2/16/2016.
|
|
// Copyright 2016 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
<@include DeferredBufferWrite.slh@>
|
|
|
|
<@include gpu/ShaderConstants.h@>
|
|
<@include gpu/Paint.slh@>
|
|
|
|
struct Grid {
|
|
vec4 period;
|
|
vec4 offset;
|
|
vec4 edge;
|
|
};
|
|
|
|
LAYOUT(binding=0) uniform gridBuffer {
|
|
Grid grid;
|
|
};
|
|
|
|
layout(location=GPU_ATTR_TEXCOORD0) in vec2 varTexCoord0;
|
|
layout(location=GPU_ATTR_COLOR) in vec4 varColor;
|
|
|
|
void main(void) {
|
|
float alpha = mix(paintGridMajorMinor(varTexCoord0, grid.offset, grid.period, grid.edge),
|
|
paintGrid(varTexCoord0, grid.offset.xy, grid.period.xy, grid.edge.xy),
|
|
float(grid.edge.z == 0.0));
|
|
|
|
if (alpha < 0.0001) {
|
|
discard;
|
|
}
|
|
|
|
packDeferredFragmentUnlit(vec3(1.0, 0.0, 0.0), 1.0, varColor.xyz);
|
|
}
|