fixed AUTOSCRIBE_SHADER_LIB to work for targets outside of libraries/

This commit is contained in:
Seiji Emery 2015-08-24 13:13:24 -07:00
parent 691cb48a08
commit bd18951be8
5 changed files with 69 additions and 4 deletions

View file

@ -23,7 +23,7 @@ macro(SETUP_HIFI_PROJECT)
endforeach()
# 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})
list(APPEND ${TARGET_NAME}_DEPENDENCY_QT_MODULES Core)

View file

@ -1,7 +1,7 @@
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
setup_hifi_project(Quick Gui OpenGL Script Widgets)

View file

@ -35,8 +35,8 @@
#include <PathUtils.h>
#include <GeometryCache.h>
#include "../../libraries/render-utils/simple_frag.h"
#include "../../libraries/render-utils/simple_vert.h"
#include "simple_frag.h"
#include "simple_vert.h"
class RateCounter {
std::vector<float> times;

View 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);
}

View 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)$>
}