chore: migrate sobel to glsl 330 (#4682)
parent
fe7fc1f634
commit
eccfa3030e
|
@ -1,18 +1,9 @@
|
|||
/*
|
||||
* Copyright 2012 Benjamin Glatzel <benjamin.glatzel@me.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2021 The Terasology Foundation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#version 330 core
|
||||
|
||||
in vec2 v_uv0;
|
||||
|
||||
uniform sampler2D texDepth;
|
||||
|
||||
|
@ -23,7 +14,7 @@ uniform float pixelOffsetX;
|
|||
uniform float pixelOffsetY;
|
||||
|
||||
float fetchDepth(float x, float y) {
|
||||
return linDepth(texture2D(texDepth, gl_TexCoord[0].xy + vec2(x*texelWidth*pixelOffsetX, y*texelHeight*pixelOffsetY)).x);
|
||||
return linDepth(texture2D(texDepth, v_uv0.xy + vec2(x*texelWidth*pixelOffsetX, y*texelHeight*pixelOffsetY)).x);
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
/*
|
||||
* Copyright 2012 Benjamin Glatzel <benjamin.glatzel@me.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2021 The Terasology Foundation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
#version 330 core
|
||||
|
||||
layout (location = 0) in vec3 in_vert;
|
||||
layout (location = 1) in vec3 in_normal;
|
||||
layout (location = 2) in vec2 in_uv0;
|
||||
layout (location = 4) in vec4 in_color0;
|
||||
|
||||
out vec2 v_uv0;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(in_vert, 1.0);
|
||||
v_uv0 = in_uv0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue