mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:58:35 +02:00
fixed AUTOSCRIBE_SHADER_LIB to work for targets outside of libraries/
This commit is contained in:
parent
691cb48a08
commit
bd18951be8
5 changed files with 69 additions and 4 deletions
|
@ -23,7 +23,7 @@ macro(SETUP_HIFI_PROJECT)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# add the executable, include additional optional sources
|
# add the executable, include additional optional sources
|
||||||
add_executable(${TARGET_NAME} ${TARGET_SRCS} "${AUTOMTC_SRC}")
|
add_executable(${TARGET_NAME} ${TARGET_SRCS} "${AUTOMTC_SRC}" "${AUTOSCRIBE_SHADER_LIB_SRC}")
|
||||||
|
|
||||||
set(${TARGET_NAME}_DEPENDENCY_QT_MODULES ${ARGN})
|
set(${TARGET_NAME}_DEPENDENCY_QT_MODULES ${ARGN})
|
||||||
list(APPEND ${TARGET_NAME}_DEPENDENCY_QT_MODULES Core)
|
list(APPEND ${TARGET_NAME}_DEPENDENCY_QT_MODULES Core)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
set(TARGET_NAME gpu-test)
|
set(TARGET_NAME gpu-test)
|
||||||
|
|
||||||
AUTOSCRIBE_SHADER_LIB(gpu model render gpu-test)
|
AUTOSCRIBE_SHADER_LIB(gpu model render-utils)
|
||||||
|
|
||||||
# This is not a testcase -- just set it up as a regular hifi project
|
# This is not a testcase -- just set it up as a regular hifi project
|
||||||
setup_hifi_project(Quick Gui OpenGL Script Widgets)
|
setup_hifi_project(Quick Gui OpenGL Script Widgets)
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
#include <GeometryCache.h>
|
#include <GeometryCache.h>
|
||||||
|
|
||||||
#include "../../libraries/render-utils/simple_frag.h"
|
#include "simple_frag.h"
|
||||||
#include "../../libraries/render-utils/simple_vert.h"
|
#include "simple_vert.h"
|
||||||
|
|
||||||
class RateCounter {
|
class RateCounter {
|
||||||
std::vector<float> times;
|
std::vector<float> times;
|
||||||
|
|
29
tests/gpu-test/src/simple.slf
Normal file
29
tests/gpu-test/src/simple.slf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<@include gpu/Config.slh@>
|
||||||
|
<$VERSION_HEADER$>
|
||||||
|
// Generated on <$_SCRIBE_DATE$>
|
||||||
|
//
|
||||||
|
// simple.frag
|
||||||
|
// fragment shader
|
||||||
|
//
|
||||||
|
// Created by Andrzej Kapolka on 9/15/14.
|
||||||
|
// Copyright 2014 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 model/Material.slh@>
|
||||||
|
|
||||||
|
// the interpolated normal
|
||||||
|
in vec3 _normal;
|
||||||
|
in vec3 _color;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
Material material = getMaterial();
|
||||||
|
packDeferredFragment(
|
||||||
|
normalize(_normal.xyz),
|
||||||
|
glowIntensity,
|
||||||
|
_color.rgb,
|
||||||
|
DEFAULT_SPECULAR, DEFAULT_SHININESS);
|
||||||
|
}
|
36
tests/gpu-test/src/simple.slv
Normal file
36
tests/gpu-test/src/simple.slv
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<@include gpu/Config.slh@>
|
||||||
|
<$VERSION_HEADER$>
|
||||||
|
// Generated on <$_SCRIBE_DATE$>
|
||||||
|
//
|
||||||
|
// simple.vert
|
||||||
|
// vertex shader
|
||||||
|
//
|
||||||
|
// Created by Andrzej Kapolka on 9/15/14.
|
||||||
|
// Copyright 2014 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 gpu/Inputs.slh@>
|
||||||
|
|
||||||
|
<@include gpu/Transform.slh@>
|
||||||
|
|
||||||
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
|
// the interpolated normal
|
||||||
|
|
||||||
|
out vec3 _normal;
|
||||||
|
out vec3 _color;
|
||||||
|
out vec2 _texCoord0;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
_color = inColor.rgb;
|
||||||
|
_texCoord0 = inTexCoord0.st;
|
||||||
|
|
||||||
|
// standard transform
|
||||||
|
TransformCamera cam = getTransformCamera();
|
||||||
|
TransformObject obj = getTransformObject();
|
||||||
|
<$transformModelToClipPos(cam, obj, inPosition, gl_Position)$>
|
||||||
|
<$transformModelToEyeDir(cam, obj, inNormal.xyz, _normal)$>
|
||||||
|
}
|
Loading…
Reference in a new issue