Merge branch 'master' of github.com:highfidelity/hifi into fix-camera-update
|
@ -13,6 +13,11 @@ include("cmake/init.cmake")
|
||||||
|
|
||||||
include("cmake/compiler.cmake")
|
include("cmake/compiler.cmake")
|
||||||
|
|
||||||
|
if (BUILD_SCRIBE_ONLY)
|
||||||
|
add_subdirectory(tools/scribe)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED SERVER_ONLY)
|
if (NOT DEFINED SERVER_ONLY)
|
||||||
set(SERVER_ONLY 0)
|
set(SERVER_ONLY 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -18,7 +18,7 @@ android {
|
||||||
'-DANDROID_TOOLCHAIN=clang',
|
'-DANDROID_TOOLCHAIN=clang',
|
||||||
'-DANDROID_STL=c++_shared',
|
'-DANDROID_STL=c++_shared',
|
||||||
'-DQT_CMAKE_PREFIX_PATH=' + HIFI_ANDROID_PRECOMPILED + '/qt/lib/cmake',
|
'-DQT_CMAKE_PREFIX_PATH=' + HIFI_ANDROID_PRECOMPILED + '/qt/lib/cmake',
|
||||||
'-DNATIVE_SCRIBE=' + HIFI_ANDROID_PRECOMPILED + '/scribe',
|
'-DNATIVE_SCRIBE=' + HIFI_ANDROID_PRECOMPILED + '/scribe' + EXEC_SUFFIX,
|
||||||
'-DHIFI_ANDROID_PRECOMPILED=' + HIFI_ANDROID_PRECOMPILED,
|
'-DHIFI_ANDROID_PRECOMPILED=' + HIFI_ANDROID_PRECOMPILED,
|
||||||
'-DRELEASE_NUMBER=' + RELEASE_NUMBER,
|
'-DRELEASE_NUMBER=' + RELEASE_NUMBER,
|
||||||
'-DRELEASE_TYPE=' + RELEASE_TYPE,
|
'-DRELEASE_TYPE=' + RELEASE_TYPE,
|
||||||
|
|
|
@ -137,16 +137,16 @@ def packages = [
|
||||||
def scribeLocalFile='scribe' + EXEC_SUFFIX
|
def scribeLocalFile='scribe' + EXEC_SUFFIX
|
||||||
|
|
||||||
def scribeFile='scribe_linux_x86_64'
|
def scribeFile='scribe_linux_x86_64'
|
||||||
def scribeChecksum='c98678d9726bd8bbf1bab792acf3ff6c'
|
def scribeChecksum='ca4b904f52f4f993c29175ba96798fa6'
|
||||||
def scribeVersion='onfeBkJWcJiTwiGOyZPVBjlyhoYQ4Axn'
|
def scribeVersion='wgpf4dB2Ltzg4Lb2jJ4nPFsHoDkmK_OO'
|
||||||
if (Os.isFamily(Os.FAMILY_MAC)) {
|
if (Os.isFamily(Os.FAMILY_MAC)) {
|
||||||
scribeFile = 'scribe_osx_x86_64'
|
scribeFile = 'scribe_osx_x86_64'
|
||||||
scribeChecksum='a137ad62c1bf7cca739da219544a9a16'
|
scribeChecksum='72db9d32d4e1e50add755570ac5eb749'
|
||||||
scribeVersion='kU.Aq512HVe65uRnkFEWQEqeQfaYF2c0'
|
scribeVersion='o_NbPrktzEYtBkQf3Tn7zc1nZWzM52w6'
|
||||||
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
scribeFile = 'scribe_win32_x86_64.exe'
|
scribeFile = 'scribe_win32_x86_64.exe'
|
||||||
scribeChecksum='75c2ce9ed45d17de375e3988bfaba816'
|
scribeChecksum='678e43d290c90fda670c6fefe038a06d'
|
||||||
scribeVersion='24TfWFh1FBY.t6i_LdzAXZYeQOtmQNZp'
|
scribeVersion='GCCJxlmd2irvNOFWfZR0U1UCLHndHQrC'
|
||||||
}
|
}
|
||||||
|
|
||||||
def options = [
|
def options = [
|
||||||
|
|
|
@ -39,56 +39,41 @@ function(AUTOSCRIBE_SHADER SHADER_FILE)
|
||||||
get_filename_component(SHADER_TARGET ${SHADER_FILE} NAME_WE)
|
get_filename_component(SHADER_TARGET ${SHADER_FILE} NAME_WE)
|
||||||
get_filename_component(SHADER_EXT ${SHADER_FILE} EXT)
|
get_filename_component(SHADER_EXT ${SHADER_FILE} EXT)
|
||||||
if(SHADER_EXT STREQUAL .slv)
|
if(SHADER_EXT STREQUAL .slv)
|
||||||
set(SHADER_TARGET ${SHADER_TARGET}_vert.h)
|
set(SHADER_TYPE vert)
|
||||||
elseif(${SHADER_EXT} STREQUAL .slf)
|
elseif(${SHADER_EXT} STREQUAL .slf)
|
||||||
set(SHADER_TARGET ${SHADER_TARGET}_frag.h)
|
set(SHADER_TYPE frag)
|
||||||
elseif(${SHADER_EXT} STREQUAL .slg)
|
elseif(${SHADER_EXT} STREQUAL .slg)
|
||||||
set(SHADER_TARGET ${SHADER_TARGET}_geom.h)
|
set(SHADER_TYPE geom)
|
||||||
endif()
|
endif()
|
||||||
|
set(SHADER_TARGET ${SHADER_TARGET}_${SHADER_TYPE})
|
||||||
|
|
||||||
set(SHADER_TARGET "${SHADERS_DIR}/${SHADER_TARGET}")
|
set(SHADER_TARGET "${SHADERS_DIR}/${SHADER_TARGET}")
|
||||||
|
set(SHADER_TARGET_HEADER ${SHADER_TARGET}.h)
|
||||||
|
set(SHADER_TARGET_SOURCE ${SHADER_TARGET}.cpp)
|
||||||
|
set(SCRIBE_COMMAND scribe)
|
||||||
|
|
||||||
# Target dependant Custom rule on the SHADER_FILE
|
# Target dependant Custom rule on the SHADER_FILE
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(GLPROFILE MAC_GL)
|
set(GLPROFILE MAC_GL)
|
||||||
set(SCRIBE_ARGS -c++ -D GLPROFILE ${GLPROFILE} ${SCRIBE_INCLUDES} -o ${SHADER_TARGET} ${SHADER_FILE})
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${SHADER_TARGET} COMMAND scribe ${SCRIBE_ARGS} DEPENDS scribe ${SHADER_INCLUDE_FILES} ${SHADER_FILE})
|
|
||||||
elseif (ANDROID)
|
elseif (ANDROID)
|
||||||
set(GLPROFILE LINUX_GL)
|
set(GLPROFILE LINUX_GL)
|
||||||
set(SCRIBE_ARGS -c++ -D GLPROFILE ${GLPROFILE} ${SCRIBE_INCLUDES} -o ${SHADER_TARGET} ${SHADER_FILE})
|
set(SCRIBE_COMMAND ${NATIVE_SCRIBE})
|
||||||
|
|
||||||
# for an android build, we can't use the scribe that cmake would normally produce as a target,
|
|
||||||
# since it's unrunnable by the cross-compiling build machine
|
|
||||||
|
|
||||||
# so, we require the compiling user to point us at a compiled executable version for their native toolchain
|
|
||||||
if (NOT NATIVE_SCRIBE)
|
|
||||||
find_program(NATIVE_SCRIBE scribe PATHS ${SCRIBE_PATH} ENV SCRIBE_PATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT NATIVE_SCRIBE)
|
|
||||||
message(FATAL_ERROR "The High Fidelity scribe tool is required for shader pre-processing. \
|
|
||||||
Please compile scribe using your native toolchain and set SCRIBE_PATH to the path containing the scribe executable in your ENV.\
|
|
||||||
")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${SHADER_TARGET} COMMAND ${NATIVE_SCRIBE} ${SCRIBE_ARGS} DEPENDS ${SHADER_INCLUDE_FILES} ${SHADER_FILE})
|
|
||||||
elseif (UNIX)
|
elseif (UNIX)
|
||||||
set(GLPROFILE LINUX_GL)
|
set(GLPROFILE LINUX_GL)
|
||||||
set(SCRIBE_ARGS -c++ -D GLPROFILE ${GLPROFILE} ${SCRIBE_INCLUDES} -o ${SHADER_TARGET} ${SHADER_FILE})
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${SHADER_TARGET} COMMAND scribe ${SCRIBE_ARGS} DEPENDS scribe ${SHADER_INCLUDE_FILES} ${SHADER_FILE})
|
|
||||||
else ()
|
else ()
|
||||||
set(GLPROFILE PC_GL)
|
set(GLPROFILE PC_GL)
|
||||||
set(SCRIBE_ARGS -c++ -D GLPROFILE ${GLPROFILE} ${SCRIBE_INCLUDES} -o ${SHADER_TARGET} ${SHADER_FILE})
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${SHADER_TARGET} COMMAND scribe ${SCRIBE_ARGS} DEPENDS scribe ${SHADER_INCLUDE_FILES} ${SHADER_FILE})
|
|
||||||
endif()
|
endif()
|
||||||
|
set(SCRIBE_ARGS -c++ -T ${SHADER_TYPE} -D GLPROFILE ${GLPROFILE} ${SCRIBE_INCLUDES} -o ${SHADER_TARGET} ${SHADER_FILE})
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${SHADER_TARGET_HEADER} ${SHADER_TARGET_SOURCE}
|
||||||
|
COMMAND ${SCRIBE_COMMAND} ${SCRIBE_ARGS}
|
||||||
|
DEPENDS ${SCRIBE_COMMAND} ${SHADER_INCLUDE_FILES} ${SHADER_FILE}
|
||||||
|
)
|
||||||
|
|
||||||
#output the generated file name
|
#output the generated file name
|
||||||
set(AUTOSCRIBE_SHADER_RETURN ${SHADER_TARGET} PARENT_SCOPE)
|
set(AUTOSCRIBE_SHADER_RETURN ${SHADER_TARGET_HEADER} ${SHADER_TARGET_SOURCE} PARENT_SCOPE)
|
||||||
|
|
||||||
file(GLOB INCLUDE_FILES ${SHADER_TARGET})
|
file(GLOB INCLUDE_FILES ${SHADER_TARGET_HEADER})
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
@ -126,7 +111,7 @@ macro(AUTOSCRIBE_SHADER_LIB)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
source_group("Shaders" FILES ${SHADER_INCLUDE_FILES})
|
source_group("Shaders" FILES ${SHADER_INCLUDE_FILES})
|
||||||
source_group("Shaders" FILES ${SHADER_SOURCE_FILES})
|
source_group("Shaders" FILES ${SHADER_SOURCE_FILES})
|
||||||
source_group("Shaders" FILES ${AUTOSCRIBE_SHADER_SRC})
|
source_group("Shaders\\generated" FILES ${AUTOSCRIBE_SHADER_SRC})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND AUTOSCRIBE_SHADER_LIB_SRC ${SHADER_INCLUDE_FILES})
|
list(APPEND AUTOSCRIBE_SHADER_LIB_SRC ${SHADER_INCLUDE_FILES})
|
||||||
|
@ -136,4 +121,7 @@ macro(AUTOSCRIBE_SHADER_LIB)
|
||||||
# Link library shaders, if they exist
|
# Link library shaders, if they exist
|
||||||
include_directories("${SHADERS_DIR}")
|
include_directories("${SHADERS_DIR}")
|
||||||
|
|
||||||
|
# Add search directory to find gpu/Shader.h
|
||||||
|
include_directories("${HIFI_LIBRARY_DIR}/gpu/src")
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -1,96 +1,15 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
<svg
|
viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
<g>
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
<ellipse cx="26.1" cy="18.8" rx="4.6" ry="4.5"/>
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
<path d="M29.6,25.8h-6.7c-2.8,0-5,2.3-5,5v2c2,2.9,7.4,6.8,8.5,6.8c1.3,0,6.3-4,8.1-6.9v-1.9C34.5,28,32.4,25.8,29.6,25.8z"/>
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
<path d="M25.8,5.4C32.5,8,35.9,8.6,38.9,9.3C40,9.5,41,9.7,42.1,9.9c-0.3,4.9-0.3,9.8-0.3,12.5c0,8.7-3.6,15.3-11.3,20.4
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
c-1.2,0.8-2.7,1.5-4.2,2.3c-0.1,0.1-0.2,0.1-0.3,0.2c-3.7-1.7-6.8-3.8-9.2-6.3c-2.7-2.8-4.6-6.1-5.7-10.1c-0.5-1.7-0.7-3.6-0.8-6.3
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
c-0.1-3.6-0.3-7.8-0.7-12.9C11,9.5,12.2,9.3,13.5,9C16.6,8.3,20.1,7.6,25.8,5.4 M25.8,1.5c-0.2,0-0.4,0-0.6,0.1
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
C15.7,5.4,12.6,4.9,6.6,6.8C6,7,5.8,7.3,5.8,7.9c0.4,5,0.7,10.2,0.8,14.9c0.1,2.4,0.3,4.9,0.9,7.2c2.6,9.4,9,15.4,17.9,19.2
|
||||||
version="1.1"
|
c0.2,0.1,0.4,0.1,0.6,0.1c0.2,0,0.5,0,0.7-0.1c2-1,4-1.9,5.8-3.1c8.4-5.7,13-13.4,12.9-23.6c0-3.8,0.1-9.8,0.5-15.2
|
||||||
x="0px"
|
c-0.2-0.1-0.3-0.2-0.5-0.2c-6.2-2-8.1-1.1-19.3-5.5C26.1,1.5,26,1.5,25.8,1.5L25.8,1.5z"/>
|
||||||
y="0px"
|
</g>
|
||||||
viewBox="0 0 50 50"
|
</svg>
|
||||||
style="enable-background:new 0 0 50 50;"
|
|
||||||
xml:space="preserve"
|
|
||||||
id="svg2"
|
|
||||||
inkscape:version="0.91 r13725"
|
|
||||||
sodipodi:docname="bubble-a.svg"><metadata
|
|
||||||
id="metadata36"><rdf:RDF><cc:Work
|
|
||||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
|
||||||
id="defs34" /><sodipodi:namedview
|
|
||||||
pagecolor="#ff4900"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1"
|
|
||||||
objecttolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
guidetolerance="10"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:window-width="1149"
|
|
||||||
inkscape:window-height="801"
|
|
||||||
id="namedview32"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:zoom="4.72"
|
|
||||||
inkscape:cx="25"
|
|
||||||
inkscape:cy="25"
|
|
||||||
inkscape:window-x="485"
|
|
||||||
inkscape:window-y="514"
|
|
||||||
inkscape:window-maximized="0"
|
|
||||||
inkscape:current-layer="svg2" /><style
|
|
||||||
type="text/css"
|
|
||||||
id="style4">
|
|
||||||
.st0{fill:#FFFFFF;}
|
|
||||||
</style><g
|
|
||||||
id="Layer_2" /><g
|
|
||||||
id="Layer_1"
|
|
||||||
style="fill:#000000;fill-opacity:1"><g
|
|
||||||
id="g8"
|
|
||||||
style="fill:#000000;fill-opacity:1"><path
|
|
||||||
class="st0"
|
|
||||||
d="M23.2,24.1c-0.8,0.9-1.5,1.8-2.2,2.6c-0.1,0.2-0.1,0.5-0.1,0.7c0.1,1.7,0.2,3.4,0.2,5.1 c0,0.8-0.4,1.2-1.1,1.3c-0.7,0.1-1.3-0.4-1.4-1.1c-0.2-2.2-0.3-4.3-0.5-6.5c0-0.3,0.1-0.7,0.4-1c1.1-1.5,2.3-3,3.4-4.5 c0.6-0.7,1.6-1.6,2.6-1.6c0.3,0,1.1,0,1.4,0c0.8-0.1,1.3,0.1,1.9,0.9c1,1.2,1.5,2.3,2.4,3.6c0.7,1.1,1.4,1.6,2.9,1.9 c1.1,0.2,2.2,0.5,3.3,0.8c0.3,0.1,0.6,0.2,0.8,0.3c0.5,0.3,0.7,0.8,0.6,1.3c-0.1,0.5-0.5,0.7-1,0.8c-0.4,0-0.9,0-1.3-0.1 c-1.4-0.3-2.7-0.6-4.1-0.9c-0.8-0.2-1.5-0.6-2.1-1.1c-0.3-0.3-0.6-0.5-0.9-0.8c0,0.3,0,0.5,0,0.7c0,1.2,0,2.4,0,3.6 c0,0.4-0.3,12.6-0.1,16.8c0,0.5-0.1,1-0.2,1.5c-0.2,0.7-0.6,1-1.4,1.1c-0.8,0-1.4-0.3-1.7-1c-0.2-0.5-0.3-1.1-0.4-1.6 c-0.4-4.6-0.9-12.9-1.1-13.8c-0.1-0.8-0.2-1.1-0.3-2.1c-0.1-0.5-0.1-0.9-0.1-1.3C23.3,27.9,23.2,26.1,23.2,24.1z"
|
|
||||||
id="path10"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M28.2,14.6c0,1.4-1.1,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.1-2.6-2.6v-1.6c0-1.4,1.1-2.6,2.6-2.6l0,0 c1.4,0,2.6,1.1,2.6,2.6V14.6z"
|
|
||||||
id="path12"
|
|
||||||
style="fill:#000000;fill-opacity:1" /></g><path
|
|
||||||
class="st0"
|
|
||||||
d="M8.4,38.9c2.8,3.2,6.4,5.5,10.5,6.7c0.6,0.2,1.3,0.1,1.7-0.3c0.4-0.3,0.6-0.6,0.7-1c0.2-0.5,0.1-1.1-0.2-1.5 c-0.3-0.5-0.7-0.8-1.2-1c-1.6-0.5-3.2-1.2-4.6-2.1c-1.5-0.9-2.8-2.1-4-3.4c-0.4-0.4-0.9-0.7-1.5-0.7c-0.5,0-1,0.2-1.3,0.5 c-0.4,0.4-0.6,0.8-0.7,1.4C7.8,38,8,38.5,8.4,38.9z"
|
|
||||||
id="path14"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M43.7,36.8c0.3-0.4,0.4-1,0.3-1.5c-0.1-0.5-0.4-1-0.8-1.3c-0.3-0.2-0.7-0.3-1.1-0.3c-0.7,0-1.3,0.3-1.7,0.9 c-1.1,1.6-2.4,3-4,4.2c-1.2,0.9-2.5,1.7-3.9,2.3c-0.5,0.2-0.9,0.6-1.1,1.1c-0.2,0.5-0.2,1,0,1.5c0.4,1,1.6,1.5,2.6,1 c1.7-0.7,3.3-1.7,4.8-2.8C40.7,40.4,42.4,38.7,43.7,36.8z"
|
|
||||||
id="path16"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M5.1,33.2c0.5,0.4,1.2,0.4,1.8,0.2c0.5-0.2,0.9-0.6,1.1-1.1c0.2-0.5,0.2-1,0-1.5c-0.1-0.4-0.4-0.7-0.7-0.9 c-0.3-0.2-0.7-0.3-1.1-0.3c-0.2,0-0.5,0-0.7,0.1c-1,0.4-1.5,1.6-1.1,2.6C4.5,32.7,4.7,33,5.1,33.2z"
|
|
||||||
id="path18"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M45.4,27.3c-0.2,0-0.3-0.1-0.5-0.1c-0.9,0-1.7,0.6-1.9,1.5c-0.1,0.5-0.1,1.1,0.2,1.5c0.3,0.5,0.7,0.8,1.2,0.9 c0.2,0,0.3,0.1,0.5,0.1c0.9,0,1.7-0.6,1.9-1.5c0.1-0.5,0.1-1.1-0.2-1.5C46.4,27.8,45.9,27.5,45.4,27.3z"
|
|
||||||
id="path20"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M8.6,12c-0.3-0.2-0.7-0.3-1-0.3c-0.3,0-0.7,0.1-1,0.3c-0.3,0.2-0.6,0.4-0.7,0.7c-2,3.5-3.1,7.4-3.1,11.4 c0,0.2,0,0.4,0,0.6c0,0.5,0.2,1,0.6,1.4c0.4,0.4,0.9,0.6,1.4,0.6v0.4l0.1-0.4c0.5,0,1-0.2,1.4-0.6c0.4-0.4,0.6-0.9,0.5-1.4 c0-0.2,0-0.4,0-0.5c0-3.3,0.9-6.6,2.6-9.4C9.9,13.8,9.6,12.6,8.6,12z"
|
|
||||||
id="path22"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M39.3,11.4c-0.1,0.5,0.1,1.1,0.4,1.5c1.1,1.4,2,3,2.6,4.6c0.6,1.6,1,3.2,1.2,4.9c0,0.5,0.3,1,0.6,1.3 c0.4,0.4,1,0.6,1.5,0.5c0.5,0,1-0.3,1.4-0.7c0.3-0.4,0.5-0.9,0.5-1.5c-0.4-4.2-2-8.2-4.6-11.6c-0.4-0.5-1-0.8-1.6-0.8 c-0.4,0-0.9,0.1-1.2,0.4C39.7,10.4,39.4,10.8,39.3,11.4z"
|
|
||||||
id="path24"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M12.2,6.3c-0.5,0-0.9,0.2-1.3,0.5c-0.4,0.3-0.7,0.8-0.7,1.4c-0.1,0.5,0.1,1.1,0.4,1.5c0.7,0.8,2,1,2.8,0.3 c0.4-0.3,0.7-0.8,0.7-1.3c0.1-0.5-0.1-1.1-0.4-1.5C13.4,6.6,12.8,6.3,12.2,6.3z"
|
|
||||||
id="path26"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M37.2,5.2c-0.3-0.2-0.7-0.3-1.1-0.3c-0.7,0-1.3,0.3-1.7,0.9c-0.3,0.4-0.4,1-0.3,1.5c0.1,0.5,0.4,1,0.9,1.3 C36,9.2,37.3,8.9,37.9,8C38.4,7.1,38.2,5.8,37.2,5.2z"
|
|
||||||
id="path28"
|
|
||||||
style="fill:#000000;fill-opacity:1" /><path
|
|
||||||
class="st0"
|
|
||||||
d="M16.5,4c-0.2,0.5-0.3,1-0.1,1.5c0.4,1,1.5,1.6,2.6,1.2c3.3-1.2,6.8-1.4,10.2-0.6c0.6,0.1,1.2,0,1.7-0.4 c0.4-0.3,0.6-0.7,0.7-1.1c0.1-0.5,0-1.1-0.3-1.5c-0.3-0.5-0.7-0.8-1.3-0.9c-1.6-0.4-3.3-0.5-4.9-0.5c-2.6,0-5.1,0.4-7.5,1.3 C17.1,3.2,16.7,3.6,16.5,4z"
|
|
||||||
id="path30"
|
|
||||||
style="fill:#000000;fill-opacity:1" /></g></svg>
|
|
||||||
|
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -1,46 +1,19 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
|
viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.st0{fill:#FFFFFF;}
|
.st0{fill:#FFFFFF;}
|
||||||
</style>
|
</style>
|
||||||
<g id="Layer_2">
|
<g>
|
||||||
</g>
|
<ellipse class="st0" cx="26.1" cy="18.8" rx="4.6" ry="4.5"/>
|
||||||
<g id="Layer_1">
|
<path class="st0" d="M29.6,25.8h-6.7c-2.8,0-5,2.3-5,5v2c2,2.9,7.4,6.8,8.5,6.8c1.3,0,6.3-4,8.1-6.9v-1.9
|
||||||
<g>
|
C34.5,28,32.4,25.8,29.6,25.8z"/>
|
||||||
<path class="st0" d="M23.2,24.1c-0.8,0.9-1.5,1.8-2.2,2.6c-0.1,0.2-0.1,0.5-0.1,0.7c0.1,1.7,0.2,3.4,0.2,5.1
|
<path class="st0" d="M25.8,5.4C32.5,8,35.9,8.6,38.9,9.3C40,9.5,41,9.7,42.1,9.9c-0.3,4.9-0.3,9.8-0.3,12.5
|
||||||
c0,0.8-0.4,1.2-1.1,1.3c-0.7,0.1-1.3-0.4-1.4-1.1c-0.2-2.2-0.3-4.3-0.5-6.5c0-0.3,0.1-0.7,0.4-1c1.1-1.5,2.3-3,3.4-4.5
|
c0,8.7-3.6,15.3-11.3,20.4c-1.2,0.8-2.7,1.5-4.2,2.3c-0.1,0.1-0.2,0.1-0.3,0.2c-3.7-1.7-6.8-3.8-9.2-6.3c-2.7-2.8-4.6-6.1-5.7-10.1
|
||||||
c0.6-0.7,1.6-1.6,2.6-1.6c0.3,0,1.1,0,1.4,0c0.8-0.1,1.3,0.1,1.9,0.9c1,1.2,1.5,2.3,2.4,3.6c0.7,1.1,1.4,1.6,2.9,1.9
|
c-0.5-1.7-0.7-3.6-0.8-6.3c-0.1-3.6-0.3-7.8-0.7-12.9C11,9.5,12.2,9.3,13.5,9C16.6,8.3,20.1,7.6,25.8,5.4 M25.8,1.5
|
||||||
c1.1,0.2,2.2,0.5,3.3,0.8c0.3,0.1,0.6,0.2,0.8,0.3c0.5,0.3,0.7,0.8,0.6,1.3c-0.1,0.5-0.5,0.7-1,0.8c-0.4,0-0.9,0-1.3-0.1
|
c-0.2,0-0.4,0-0.6,0.1C15.7,5.4,12.6,4.9,6.6,6.8C6,7,5.8,7.3,5.8,7.9c0.4,5,0.7,10.2,0.8,14.9c0.1,2.4,0.3,4.9,0.9,7.2
|
||||||
c-1.4-0.3-2.7-0.6-4.1-0.9c-0.8-0.2-1.5-0.6-2.1-1.1c-0.3-0.3-0.6-0.5-0.9-0.8c0,0.3,0,0.5,0,0.7c0,1.2,0,2.4,0,3.6
|
c2.6,9.4,9,15.4,17.9,19.2c0.2,0.1,0.4,0.1,0.6,0.1c0.2,0,0.5,0,0.7-0.1c2-1,4-1.9,5.8-3.1c8.4-5.7,13-13.4,12.9-23.6
|
||||||
c0,0.4-0.3,12.6-0.1,16.8c0,0.5-0.1,1-0.2,1.5c-0.2,0.7-0.6,1-1.4,1.1c-0.8,0-1.4-0.3-1.7-1c-0.2-0.5-0.3-1.1-0.4-1.6
|
c0-3.8,0.1-9.8,0.5-15.2c-0.2-0.1-0.3-0.2-0.5-0.2c-6.2-2-8.1-1.1-19.3-5.5C26.1,1.5,26,1.5,25.8,1.5L25.8,1.5z"/>
|
||||||
c-0.4-4.6-0.9-12.9-1.1-13.8c-0.1-0.8-0.2-1.1-0.3-2.1c-0.1-0.5-0.1-0.9-0.1-1.3C23.3,27.9,23.2,26.1,23.2,24.1z"/>
|
|
||||||
<path class="st0" d="M28.2,14.6c0,1.4-1.1,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.1-2.6-2.6v-1.6c0-1.4,1.1-2.6,2.6-2.6l0,0
|
|
||||||
c1.4,0,2.6,1.1,2.6,2.6V14.6z"/>
|
|
||||||
</g>
|
|
||||||
<path class="st0" d="M8.4,38.9c2.8,3.2,6.4,5.5,10.5,6.7c0.6,0.2,1.3,0.1,1.7-0.3c0.4-0.3,0.6-0.6,0.7-1c0.2-0.5,0.1-1.1-0.2-1.5
|
|
||||||
c-0.3-0.5-0.7-0.8-1.2-1c-1.6-0.5-3.2-1.2-4.6-2.1c-1.5-0.9-2.8-2.1-4-3.4c-0.4-0.4-0.9-0.7-1.5-0.7c-0.5,0-1,0.2-1.3,0.5
|
|
||||||
c-0.4,0.4-0.6,0.8-0.7,1.4C7.8,38,8,38.5,8.4,38.9z"/>
|
|
||||||
<path class="st0" d="M43.7,36.8c0.3-0.4,0.4-1,0.3-1.5c-0.1-0.5-0.4-1-0.8-1.3c-0.3-0.2-0.7-0.3-1.1-0.3c-0.7,0-1.3,0.3-1.7,0.9
|
|
||||||
c-1.1,1.6-2.4,3-4,4.2c-1.2,0.9-2.5,1.7-3.9,2.3c-0.5,0.2-0.9,0.6-1.1,1.1c-0.2,0.5-0.2,1,0,1.5c0.4,1,1.6,1.5,2.6,1
|
|
||||||
c1.7-0.7,3.3-1.7,4.8-2.8C40.7,40.4,42.4,38.7,43.7,36.8z"/>
|
|
||||||
<path class="st0" d="M5.1,33.2c0.5,0.4,1.2,0.4,1.8,0.2c0.5-0.2,0.9-0.6,1.1-1.1c0.2-0.5,0.2-1,0-1.5c-0.1-0.4-0.4-0.7-0.7-0.9
|
|
||||||
c-0.3-0.2-0.7-0.3-1.1-0.3c-0.2,0-0.5,0-0.7,0.1c-1,0.4-1.5,1.6-1.1,2.6C4.5,32.7,4.7,33,5.1,33.2z"/>
|
|
||||||
<path class="st0" d="M45.4,27.3c-0.2,0-0.3-0.1-0.5-0.1c-0.9,0-1.7,0.6-1.9,1.5c-0.1,0.5-0.1,1.1,0.2,1.5c0.3,0.5,0.7,0.8,1.2,0.9
|
|
||||||
c0.2,0,0.3,0.1,0.5,0.1c0.9,0,1.7-0.6,1.9-1.5c0.1-0.5,0.1-1.1-0.2-1.5C46.4,27.8,45.9,27.5,45.4,27.3z"/>
|
|
||||||
<path class="st0" d="M8.6,12c-0.3-0.2-0.7-0.3-1-0.3c-0.3,0-0.7,0.1-1,0.3c-0.3,0.2-0.6,0.4-0.7,0.7c-2,3.5-3.1,7.4-3.1,11.4
|
|
||||||
c0,0.2,0,0.4,0,0.6c0,0.5,0.2,1,0.6,1.4c0.4,0.4,0.9,0.6,1.4,0.6v0.4l0.1-0.4c0.5,0,1-0.2,1.4-0.6c0.4-0.4,0.6-0.9,0.5-1.4
|
|
||||||
c0-0.2,0-0.4,0-0.5c0-3.3,0.9-6.6,2.6-9.4C9.9,13.8,9.6,12.6,8.6,12z"/>
|
|
||||||
<path class="st0" d="M39.3,11.4c-0.1,0.5,0.1,1.1,0.4,1.5c1.1,1.4,2,3,2.6,4.6c0.6,1.6,1,3.2,1.2,4.9c0,0.5,0.3,1,0.6,1.3
|
|
||||||
c0.4,0.4,1,0.6,1.5,0.5c0.5,0,1-0.3,1.4-0.7c0.3-0.4,0.5-0.9,0.5-1.5c-0.4-4.2-2-8.2-4.6-11.6c-0.4-0.5-1-0.8-1.6-0.8
|
|
||||||
c-0.4,0-0.9,0.1-1.2,0.4C39.7,10.4,39.4,10.8,39.3,11.4z"/>
|
|
||||||
<path class="st0" d="M12.2,6.3c-0.5,0-0.9,0.2-1.3,0.5c-0.4,0.3-0.7,0.8-0.7,1.4c-0.1,0.5,0.1,1.1,0.4,1.5c0.7,0.8,2,1,2.8,0.3
|
|
||||||
c0.4-0.3,0.7-0.8,0.7-1.3c0.1-0.5-0.1-1.1-0.4-1.5C13.4,6.6,12.8,6.3,12.2,6.3z"/>
|
|
||||||
<path class="st0" d="M37.2,5.2c-0.3-0.2-0.7-0.3-1.1-0.3c-0.7,0-1.3,0.3-1.7,0.9c-0.3,0.4-0.4,1-0.3,1.5c0.1,0.5,0.4,1,0.9,1.3
|
|
||||||
C36,9.2,37.3,8.9,37.9,8C38.4,7.1,38.2,5.8,37.2,5.2z"/>
|
|
||||||
<path class="st0" d="M16.5,4c-0.2,0.5-0.3,1-0.1,1.5c0.4,1,1.5,1.6,2.6,1.2c3.3-1.2,6.8-1.4,10.2-0.6c0.6,0.1,1.2,0,1.7-0.4
|
|
||||||
c0.4-0.3,0.6-0.7,0.7-1.1c0.1-0.5,0-1.1-0.3-1.5c-0.3-0.5-0.7-0.8-1.3-0.9c-1.6-0.4-3.3-0.5-4.9-0.5c-2.6,0-5.1,0.4-7.5,1.3
|
|
||||||
C17.1,3.2,16.7,3.6,16.5,4z"/>
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -19,30 +19,21 @@ import "../../../controls-uit" as HifiControlsUit
|
||||||
import "../../../controls" as HifiControls
|
import "../../../controls" as HifiControls
|
||||||
import "../wallet" as HifiWallet
|
import "../wallet" as HifiWallet
|
||||||
|
|
||||||
|
// references XXX from root context
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
id: root;
|
id: root;
|
||||||
property string marketplaceUrl: "";
|
property string marketplaceUrl;
|
||||||
property string certificateId: "";
|
property string certificateId;
|
||||||
property string itemName: "--";
|
property string itemName: "--";
|
||||||
property string itemOwner: "--";
|
property string itemOwner: "--";
|
||||||
property string itemEdition: "--";
|
property string itemEdition: "--";
|
||||||
property string dateOfPurchase: "--";
|
property string dateOfPurchase: "--";
|
||||||
property string itemCost: "--";
|
|
||||||
property string certTitleTextColor: hifi.colors.darkGray;
|
|
||||||
property string certTextColor: hifi.colors.white;
|
|
||||||
property string infoTextColor: hifi.colors.blueAccent;
|
|
||||||
// 0 means replace none
|
|
||||||
// 4 means replace all but "Item Edition"
|
|
||||||
// 5 means replace all 5 replaceable fields
|
|
||||||
property int certInfoReplaceMode: 5;
|
|
||||||
property bool isLightbox: false;
|
property bool isLightbox: false;
|
||||||
property bool isMyCert: false;
|
property bool isMyCert: false;
|
||||||
property bool useGoldCert: true;
|
property bool isCertificateInvalid: false;
|
||||||
property bool certificateInfoPending: true;
|
|
||||||
property int certificateStatus: 0;
|
|
||||||
property bool certificateStatusPending: true;
|
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.faintGray;
|
color: hifi.colors.faintGray;
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -54,130 +45,71 @@ Rectangle {
|
||||||
} else {
|
} else {
|
||||||
root.marketplaceUrl = result.data.marketplace_item_url;
|
root.marketplaceUrl = result.data.marketplace_item_url;
|
||||||
root.isMyCert = result.isMyCert ? result.isMyCert : false;
|
root.isMyCert = result.isMyCert ? result.isMyCert : false;
|
||||||
|
root.itemOwner = root.isCertificateInvalid ? "--" : (root.isMyCert ? Account.username :
|
||||||
if (root.certInfoReplaceMode > 3) {
|
"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022");
|
||||||
|
root.itemEdition = root.isCertificateInvalid ? "Uncertified Copy" :
|
||||||
|
(result.data.edition_number + "/" + (result.data.limited_run === -1 ? "\u221e" : result.data.limited_run));
|
||||||
|
root.dateOfPurchase = root.isCertificateInvalid ? "" : getFormattedDate(result.data.transfer_created_at * 1000);
|
||||||
root.itemName = result.data.marketplace_item_name;
|
root.itemName = result.data.marketplace_item_name;
|
||||||
// "\u2022" is the Unicode character 'BULLET' - it's what's used in password fields on the web, etc
|
|
||||||
root.itemOwner = root.isMyCert ? Account.username :
|
|
||||||
"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
|
|
||||||
root.dateOfPurchase = root.isMyCert ? getFormattedDate(result.data.transfer_created_at * 1000) : "Undisclosed";
|
|
||||||
root.itemCost = (root.isMyCert && result.data.cost !== undefined) ? result.data.cost : "Undisclosed";
|
|
||||||
}
|
|
||||||
if (root.certInfoReplaceMode > 4) {
|
|
||||||
root.itemEdition = result.data.edition_number + "/" + (result.data.limited_run === -1 ? "\u221e" : result.data.limited_run);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (root.certificateStatus === 4) { // CERTIFICATE_STATUS_OWNER_VERIFICATION_FAILED
|
|
||||||
if (root.isMyCert) {
|
|
||||||
errorText.text = "This item is an uncertified copy of an item you purchased.";
|
|
||||||
} else {
|
|
||||||
errorText.text = "The person who placed this item doesn't own it.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.data.invalid_reason || result.data.transfer_status[0] === "failed") {
|
if (result.data.invalid_reason || result.data.transfer_status[0] === "failed") {
|
||||||
root.useGoldCert = false;
|
titleBarText.text = "Invalid Certificate";
|
||||||
root.certTitleTextColor = hifi.colors.redHighlight;
|
titleBarText.color = hifi.colors.redHighlight;
|
||||||
root.certTextColor = hifi.colors.redHighlight;
|
|
||||||
root.infoTextColor = hifi.colors.redHighlight;
|
|
||||||
titleBarText.text = "Certificate\nNo Longer Valid";
|
|
||||||
popText.text = "";
|
popText.text = "";
|
||||||
showInMarketplaceButton.visible = false;
|
|
||||||
// "Edition" text previously set above in this function
|
|
||||||
// "Owner" text previously set above in this function
|
|
||||||
// "Purchase Date" text previously set above in this function
|
|
||||||
// "Purchase Price" text previously set above in this function
|
|
||||||
if (result.data.invalid_reason) {
|
if (result.data.invalid_reason) {
|
||||||
errorText.text = result.data.invalid_reason;
|
errorText.text = result.data.invalid_reason;
|
||||||
}
|
}
|
||||||
} else if (result.data.transfer_status[0] === "pending") {
|
} else if (result.data.transfer_status[0] === "pending") {
|
||||||
root.useGoldCert = false;
|
|
||||||
root.certTitleTextColor = hifi.colors.redHighlight;
|
|
||||||
root.certTextColor = hifi.colors.redHighlight;
|
|
||||||
root.infoTextColor = hifi.colors.redHighlight;
|
|
||||||
titleBarText.text = "Certificate Pending";
|
titleBarText.text = "Certificate Pending";
|
||||||
popText.text = "";
|
|
||||||
showInMarketplaceButton.visible = true;
|
|
||||||
// "Edition" text previously set above in this function
|
|
||||||
// "Owner" text previously set above in this function
|
|
||||||
// "Purchase Date" text previously set above in this function
|
|
||||||
// "Purchase Price" text previously set above in this function
|
|
||||||
errorText.text = "The status of this item is still pending confirmation. If the purchase is not confirmed, " +
|
errorText.text = "The status of this item is still pending confirmation. If the purchase is not confirmed, " +
|
||||||
"this entity will be cleaned up by the domain.";
|
"this entity will be cleaned up by the domain.";
|
||||||
|
errorText.color = hifi.colors.baseGray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
root.certificateInfoPending = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdateCertificateStatus: {
|
onUpdateCertificateStatus: {
|
||||||
root.certificateStatus = certStatus;
|
if (certStatus === 1) { // CERTIFICATE_STATUS_VERIFICATION_SUCCESS
|
||||||
if (root.certificateStatus === 1) { // CERTIFICATE_STATUS_VERIFICATION_SUCCESS
|
// NOP
|
||||||
root.useGoldCert = true;
|
} else if (certStatus === 2) { // CERTIFICATE_STATUS_VERIFICATION_TIMEOUT
|
||||||
root.certTitleTextColor = hifi.colors.darkGray;
|
root.isCertificateInvalid = true;
|
||||||
root.certTextColor = hifi.colors.white;
|
errorText.text = "Verification of this certificate timed out.";
|
||||||
root.infoTextColor = hifi.colors.blueAccent;
|
errorText.color = hifi.colors.redHighlight;
|
||||||
titleBarText.text = "Certificate";
|
} else if (certStatus === 3) { // CERTIFICATE_STATUS_STATIC_VERIFICATION_FAILED
|
||||||
popText.text = "PROOF OF PROVENANCE";
|
root.isCertificateInvalid = true;
|
||||||
showInMarketplaceButton.visible = true;
|
|
||||||
root.certInfoReplaceMode = 5;
|
|
||||||
// "Item Name" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Edition" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Owner" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Purchase Date" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Purchase Price" text will be set in "onCertificateInfoResult()"
|
|
||||||
errorText.text = "";
|
|
||||||
} else if (root.certificateStatus === 2) { // CERTIFICATE_STATUS_VERIFICATION_TIMEOUT
|
|
||||||
root.useGoldCert = false;
|
|
||||||
root.certTitleTextColor = hifi.colors.redHighlight;
|
|
||||||
root.certTextColor = hifi.colors.redHighlight;
|
|
||||||
root.infoTextColor = hifi.colors.redHighlight;
|
|
||||||
titleBarText.text = "Request Timed Out";
|
|
||||||
popText.text = "";
|
|
||||||
showInMarketplaceButton.visible = false;
|
|
||||||
root.certInfoReplaceMode = 0;
|
|
||||||
root.itemName = "";
|
|
||||||
root.itemEdition = "";
|
|
||||||
root.itemOwner = "";
|
|
||||||
root.dateOfPurchase = "";
|
|
||||||
root.itemCost = "";
|
|
||||||
errorText.text = "Your request to inspect this item timed out. Please try again later.";
|
|
||||||
} else if (root.certificateStatus === 3) { // CERTIFICATE_STATUS_STATIC_VERIFICATION_FAILED
|
|
||||||
root.useGoldCert = false;
|
|
||||||
root.certTitleTextColor = hifi.colors.redHighlight;
|
|
||||||
root.certTextColor = hifi.colors.redHighlight;
|
|
||||||
root.infoTextColor = hifi.colors.redHighlight;
|
|
||||||
titleBarText.text = "Certificate\nNo Longer Valid";
|
|
||||||
popText.text = "";
|
|
||||||
showInMarketplaceButton.visible = true;
|
|
||||||
root.certInfoReplaceMode = 5;
|
|
||||||
// "Item Name" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Edition" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Owner" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Purchase Date" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Purchase Price" text will be set in "onCertificateInfoResult()"
|
|
||||||
errorText.text = "The information associated with this item has been modified and it no longer matches the original certified item.";
|
|
||||||
} else if (root.certificateStatus === 4) { // CERTIFICATE_STATUS_OWNER_VERIFICATION_FAILED
|
|
||||||
root.useGoldCert = false;
|
|
||||||
root.certTitleTextColor = hifi.colors.redHighlight;
|
|
||||||
root.certTextColor = hifi.colors.redHighlight;
|
|
||||||
root.infoTextColor = hifi.colors.redHighlight;
|
|
||||||
titleBarText.text = "Invalid Certificate";
|
titleBarText.text = "Invalid Certificate";
|
||||||
|
titleBarText.color = hifi.colors.redHighlight;
|
||||||
|
|
||||||
popText.text = "";
|
popText.text = "";
|
||||||
showInMarketplaceButton.visible = true;
|
root.itemOwner = "";
|
||||||
root.certInfoReplaceMode = 4;
|
dateOfPurchaseHeader.text = "";
|
||||||
// "Item Name" text will be set in "onCertificateInfoResult()"
|
root.dateOfPurchase = "";
|
||||||
root.itemEdition = "Uncertified Copy"
|
root.itemEdition = "Uncertified Copy";
|
||||||
// "Owner" text will be set in "onCertificateInfoResult()"
|
|
||||||
// "Purchase Date" text will be set in "onCertificateInfoResult()"
|
errorText.text = "The information associated with this item has been modified and it no longer matches the original certified item.";
|
||||||
// "Purchase Price" text will be set in "onCertificateInfoResult()"
|
errorText.color = hifi.colors.baseGray;
|
||||||
// "Error Text" text will be set in "onCertificateInfoResult()"
|
} else if (certStatus === 4) { // CERTIFICATE_STATUS_OWNER_VERIFICATION_FAILED
|
||||||
|
root.isCertificateInvalid = true;
|
||||||
|
titleBarText.text = "Invalid Certificate";
|
||||||
|
titleBarText.color = hifi.colors.redHighlight;
|
||||||
|
|
||||||
|
popText.text = "";
|
||||||
|
root.itemOwner = "";
|
||||||
|
dateOfPurchaseHeader.text = "";
|
||||||
|
root.dateOfPurchase = "";
|
||||||
|
root.itemEdition = "Uncertified Copy";
|
||||||
|
|
||||||
|
errorText.text = "The avatar who rezzed this item doesn't own it.";
|
||||||
|
errorText.color = hifi.colors.baseGray;
|
||||||
} else {
|
} else {
|
||||||
console.log("Unknown certificate status received from ledger signal!");
|
console.log("Unknown certificate status received from ledger signal!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
root.certificateStatusPending = false;
|
onCertificateIdChanged: {
|
||||||
// We've gotten cert status - we are GO on getting the cert info
|
if (certificateId !== "") {
|
||||||
Commerce.certificateInfo(root.certificateId);
|
Commerce.certificateInfo(certificateId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,35 +122,9 @@ Rectangle {
|
||||||
hoverEnabled: true;
|
hoverEnabled: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: loadingOverlay;
|
|
||||||
z: 998;
|
|
||||||
|
|
||||||
visible: root.certificateInfoPending || root.certificateStatusPending;
|
|
||||||
anchors.fill: parent;
|
|
||||||
color: Qt.rgba(0.0, 0.0, 0.0, 0.7);
|
|
||||||
|
|
||||||
// This object is always used in a popup or full-screen Wallet section.
|
|
||||||
// This MouseArea is used to prevent a user from being
|
|
||||||
// able to click on a button/mouseArea underneath the popup/section.
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
propagateComposedEvents: false;
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimatedImage {
|
|
||||||
source: "../common/images/loader.gif"
|
|
||||||
width: 96;
|
|
||||||
height: width;
|
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: backgroundImage;
|
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
source: root.useGoldCert ? "images/cert-bg-gold-split.png" : "images/nocert-bg-split.png";
|
source: "images/cert-bg.jpg";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Title text
|
// Title text
|
||||||
|
@ -231,17 +137,16 @@ Rectangle {
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.topMargin: 40;
|
anchors.topMargin: 40;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: 36;
|
anchors.leftMargin: 45;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: 8;
|
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: root.certTitleTextColor;
|
color: hifi.colors.darkGray;
|
||||||
wrapMode: Text.WordWrap;
|
|
||||||
}
|
}
|
||||||
// Title text
|
// Title text
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: popText;
|
id: popText;
|
||||||
|
text: "Proof of Provenance";
|
||||||
// Text size
|
// Text size
|
||||||
size: 16;
|
size: 16;
|
||||||
// Anchors
|
// Anchors
|
||||||
|
@ -249,38 +154,9 @@ Rectangle {
|
||||||
anchors.topMargin: 4;
|
anchors.topMargin: 4;
|
||||||
anchors.left: titleBarText.left;
|
anchors.left: titleBarText.left;
|
||||||
anchors.right: titleBarText.right;
|
anchors.right: titleBarText.right;
|
||||||
height: text === "" ? 0 : paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: root.certTitleTextColor;
|
color: hifi.colors.darkGray;
|
||||||
}
|
|
||||||
|
|
||||||
// "Close" button
|
|
||||||
HiFiGlyphs {
|
|
||||||
id: closeGlyphButton;
|
|
||||||
text: hifi.glyphs.close;
|
|
||||||
color: hifi.colors.white;
|
|
||||||
size: 26;
|
|
||||||
anchors.top: parent.top;
|
|
||||||
anchors.topMargin: 10;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
anchors.rightMargin: 10;
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
hoverEnabled: true;
|
|
||||||
onEntered: {
|
|
||||||
parent.text = hifi.glyphs.closeInverted;
|
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
parent.text = hifi.glyphs.close;
|
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
if (root.isLightbox) {
|
|
||||||
root.visible = false;
|
|
||||||
} else {
|
|
||||||
sendToScript({method: 'inspectionCertificate_closeClicked', closeGoesToPurchases: root.closeGoesToPurchases});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -288,13 +164,11 @@ Rectangle {
|
||||||
//
|
//
|
||||||
Item {
|
Item {
|
||||||
id: certificateContainer;
|
id: certificateContainer;
|
||||||
anchors.top: titleBarText.top;
|
anchors.top: popText.bottom;
|
||||||
anchors.topMargin: 110;
|
anchors.topMargin: 30;
|
||||||
anchors.bottom: infoContainer.top;
|
anchors.bottom: buttonsContainer.top;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.leftMargin: titleBarText.anchors.leftMargin;
|
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
anchors.rightMargin: 24;
|
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: itemNameHeader;
|
id: itemNameHeader;
|
||||||
|
@ -304,7 +178,9 @@ Rectangle {
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: parent.top;
|
anchors.top: parent.top;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 45;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.darkGray;
|
color: hifi.colors.darkGray;
|
||||||
|
@ -321,30 +197,79 @@ Rectangle {
|
||||||
anchors.right: itemNameHeader.right;
|
anchors.right: itemNameHeader.right;
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: root.certTextColor;
|
color: hifi.colors.white;
|
||||||
elide: Text.ElideRight;
|
elide: Text.ElideRight;
|
||||||
MouseArea {
|
MouseArea {
|
||||||
enabled: showInMarketplaceButton.visible;
|
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
hoverEnabled: enabled;
|
hoverEnabled: enabled;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', marketplaceUrl: root.marketplaceUrl});
|
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', marketplaceUrl: root.marketplaceUrl});
|
||||||
}
|
}
|
||||||
onEntered: itemName.color = hifi.colors.blueHighlight;
|
onEntered: itemName.color = hifi.colors.blueHighlight;
|
||||||
onExited: itemName.color = root.certTextColor;
|
onExited: itemName.color = hifi.colors.white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RalewayRegular {
|
||||||
|
id: ownedByHeader;
|
||||||
|
text: "OWNER";
|
||||||
|
// Text size
|
||||||
|
size: 16;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: itemName.bottom;
|
||||||
|
anchors.topMargin: 28;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 45;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.darkGray;
|
||||||
|
}
|
||||||
|
RalewayRegular {
|
||||||
|
id: ownedBy;
|
||||||
|
text: root.itemOwner;
|
||||||
|
// Text size
|
||||||
|
size: 22;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: ownedByHeader.bottom;
|
||||||
|
anchors.topMargin: 8;
|
||||||
|
anchors.left: ownedByHeader.left;
|
||||||
|
height: paintedHeight;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.white;
|
||||||
|
elide: Text.ElideRight;
|
||||||
|
}
|
||||||
|
AnonymousProRegular {
|
||||||
|
id: isMyCertText;
|
||||||
|
visible: root.isMyCert && !root.isCertificateInvalid;
|
||||||
|
text: "(Private)";
|
||||||
|
size: 18;
|
||||||
|
// Anchors
|
||||||
|
anchors.top: ownedBy.top;
|
||||||
|
anchors.topMargin: 4;
|
||||||
|
anchors.bottom: ownedBy.bottom;
|
||||||
|
anchors.left: ownedBy.right;
|
||||||
|
anchors.leftMargin: 6;
|
||||||
|
anchors.right: ownedByHeader.right;
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.white;
|
||||||
|
elide: Text.ElideRight;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
}
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: editionHeader;
|
id: editionHeader;
|
||||||
text: "EDITION";
|
text: "EDITION";
|
||||||
// Text size
|
// Text size
|
||||||
size: 16;
|
size: 16;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: itemName.bottom;
|
anchors.top: ownedBy.bottom;
|
||||||
anchors.topMargin: 28;
|
anchors.topMargin: 28;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 45;
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.darkGray;
|
color: hifi.colors.darkGray;
|
||||||
|
@ -361,117 +286,21 @@ Rectangle {
|
||||||
anchors.right: editionHeader.right;
|
anchors.right: editionHeader.right;
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: root.certTextColor;
|
color: hifi.colors.white;
|
||||||
}
|
|
||||||
|
|
||||||
// "Show In Marketplace" button
|
|
||||||
HifiControlsUit.Button {
|
|
||||||
id: showInMarketplaceButton;
|
|
||||||
enabled: root.marketplaceUrl;
|
|
||||||
color: hifi.buttons.blue;
|
|
||||||
colorScheme: hifi.colorSchemes.light;
|
|
||||||
anchors.bottom: parent.bottom;
|
|
||||||
anchors.bottomMargin: 48;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
width: 200;
|
|
||||||
height: 40;
|
|
||||||
text: "View In Market"
|
|
||||||
onClicked: {
|
|
||||||
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', marketplaceUrl: root.marketplaceUrl});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// "CERTIFICATE" END
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// "INFO CONTAINER" START
|
|
||||||
//
|
|
||||||
Item {
|
|
||||||
id: infoContainer;
|
|
||||||
anchors.bottom: parent.bottom;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.leftMargin: titleBarText.anchors.leftMargin;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
anchors.rightMargin: 24;
|
|
||||||
height: root.useGoldCert ? 220 : 372;
|
|
||||||
|
|
||||||
RalewayRegular {
|
|
||||||
id: errorText;
|
|
||||||
visible: !root.useGoldCert;
|
|
||||||
// Text size
|
|
||||||
size: 20;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: parent.top;
|
|
||||||
anchors.topMargin: 36;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
height: 116;
|
|
||||||
// Style
|
|
||||||
wrapMode: Text.WordWrap;
|
|
||||||
color: hifi.colors.baseGray;
|
|
||||||
verticalAlignment: Text.AlignTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
RalewayRegular {
|
|
||||||
id: ownedByHeader;
|
|
||||||
text: "OWNER";
|
|
||||||
// Text size
|
|
||||||
size: 16;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: errorText.visible ? errorText.bottom : parent.top;
|
|
||||||
anchors.topMargin: 28;
|
|
||||||
anchors.left: parent.left;
|
|
||||||
anchors.right: parent.right;
|
|
||||||
height: paintedHeight;
|
|
||||||
// Style
|
|
||||||
color: hifi.colors.darkGray;
|
|
||||||
}
|
|
||||||
|
|
||||||
RalewayRegular {
|
|
||||||
id: ownedBy;
|
|
||||||
text: root.itemOwner;
|
|
||||||
// Text size
|
|
||||||
size: 22;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: ownedByHeader.bottom;
|
|
||||||
anchors.topMargin: 8;
|
|
||||||
anchors.left: ownedByHeader.left;
|
|
||||||
height: paintedHeight;
|
|
||||||
// Style
|
|
||||||
color: root.infoTextColor;
|
|
||||||
elide: Text.ElideRight;
|
|
||||||
}
|
|
||||||
AnonymousProRegular {
|
|
||||||
id: isMyCertText;
|
|
||||||
visible: root.isMyCert && ownedBy.text !== "--" && ownedBy.text !== "";
|
|
||||||
text: "(Private)";
|
|
||||||
size: 18;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: ownedBy.top;
|
|
||||||
anchors.topMargin: 4;
|
|
||||||
anchors.bottom: ownedBy.bottom;
|
|
||||||
anchors.left: ownedBy.right;
|
|
||||||
anchors.leftMargin: 6;
|
|
||||||
anchors.right: ownedByHeader.right;
|
|
||||||
// Style
|
|
||||||
color: root.infoTextColor;
|
|
||||||
elide: Text.ElideRight;
|
|
||||||
verticalAlignment: Text.AlignVCenter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: dateOfPurchaseHeader;
|
id: dateOfPurchaseHeader;
|
||||||
text: "PURCHASE DATE";
|
text: "DATE OF PURCHASE";
|
||||||
// Text size
|
// Text size
|
||||||
size: 16;
|
size: 16;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: ownedBy.bottom;
|
anchors.top: edition.bottom;
|
||||||
anchors.topMargin: 28;
|
anchors.topMargin: 28;
|
||||||
anchors.left: parent.left;
|
anchors.left: parent.left;
|
||||||
anchors.right: parent.horizontalCenter;
|
anchors.leftMargin: 45;
|
||||||
anchors.rightMargin: 8;
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 16;
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.darkGray;
|
color: hifi.colors.darkGray;
|
||||||
|
@ -488,59 +317,74 @@ Rectangle {
|
||||||
anchors.right: dateOfPurchaseHeader.right;
|
anchors.right: dateOfPurchaseHeader.right;
|
||||||
height: paintedHeight;
|
height: paintedHeight;
|
||||||
// Style
|
// Style
|
||||||
color: root.infoTextColor;
|
color: hifi.colors.white;
|
||||||
}
|
}
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: priceHeader;
|
id: errorText;
|
||||||
text: "PURCHASE PRICE";
|
|
||||||
// Text size
|
// Text size
|
||||||
size: 16;
|
size: 20;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: ownedBy.bottom;
|
anchors.top: dateOfPurchase.bottom;
|
||||||
anchors.topMargin: 28;
|
anchors.topMargin: 36;
|
||||||
anchors.left: parent.horizontalCenter;
|
anchors.left: dateOfPurchase.left;
|
||||||
anchors.right: parent.right;
|
anchors.right: dateOfPurchase.right;
|
||||||
height: paintedHeight;
|
anchors.bottom: parent.bottom;
|
||||||
// Style
|
// Style
|
||||||
color: hifi.colors.darkGray;
|
wrapMode: Text.WordWrap;
|
||||||
}
|
color: hifi.colors.redHighlight;
|
||||||
HiFiGlyphs {
|
|
||||||
id: hfcGlyph;
|
|
||||||
visible: priceText.text !== "Undisclosed" && priceText.text !== "";
|
|
||||||
text: hifi.glyphs.hfc;
|
|
||||||
// Size
|
|
||||||
size: 24;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: priceHeader.bottom;
|
|
||||||
anchors.topMargin: 8;
|
|
||||||
anchors.left: priceHeader.left;
|
|
||||||
width: visible ? paintedWidth + 6 : 0;
|
|
||||||
height: 40;
|
|
||||||
// Style
|
|
||||||
color: root.infoTextColor;
|
|
||||||
verticalAlignment: Text.AlignTop;
|
verticalAlignment: Text.AlignTop;
|
||||||
horizontalAlignment: Text.AlignLeft;
|
|
||||||
}
|
|
||||||
AnonymousProRegular {
|
|
||||||
id: priceText;
|
|
||||||
text: root.itemCost;
|
|
||||||
// Text size
|
|
||||||
size: 18;
|
|
||||||
// Anchors
|
|
||||||
anchors.top: priceHeader.bottom;
|
|
||||||
anchors.topMargin: 8;
|
|
||||||
anchors.left: hfcGlyph.right;
|
|
||||||
anchors.right: priceHeader.right;
|
|
||||||
height: paintedHeight;
|
|
||||||
// Style
|
|
||||||
color: root.infoTextColor;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// "INFO CONTAINER" END
|
// "CERTIFICATE" END
|
||||||
//
|
//
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: buttonsContainer;
|
||||||
|
anchors.bottom: parent.bottom;
|
||||||
|
anchors.bottomMargin: 30;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
height: 50;
|
||||||
|
|
||||||
|
// "Cancel" button
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
color: hifi.buttons.noneBorderlessWhite;
|
||||||
|
colorScheme: hifi.colorSchemes.light;
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: 30;
|
||||||
|
width: parent.width/2 - 50;
|
||||||
|
height: 50;
|
||||||
|
text: "close";
|
||||||
|
onClicked: {
|
||||||
|
if (root.isLightbox) {
|
||||||
|
root.visible = false;
|
||||||
|
} else {
|
||||||
|
sendToScript({method: 'inspectionCertificate_closeClicked', closeGoesToPurchases: root.closeGoesToPurchases});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// "Show In Marketplace" button
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: showInMarketplaceButton;
|
||||||
|
enabled: root.marketplaceUrl;
|
||||||
|
color: hifi.buttons.blue;
|
||||||
|
colorScheme: hifi.colorSchemes.light;
|
||||||
|
anchors.top: parent.top;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: 30;
|
||||||
|
width: parent.width/2 - 50;
|
||||||
|
height: 50;
|
||||||
|
text: "View In Market"
|
||||||
|
onClicked: {
|
||||||
|
sendToScript({method: 'inspectionCertificate_showInMarketplaceClicked', marketplaceUrl: root.marketplaceUrl});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// FUNCTION DEFINITIONS START
|
// FUNCTION DEFINITIONS START
|
||||||
//
|
//
|
||||||
|
@ -560,11 +404,19 @@ Rectangle {
|
||||||
function fromScript(message) {
|
function fromScript(message) {
|
||||||
switch (message.method) {
|
switch (message.method) {
|
||||||
case 'inspectionCertificate_setCertificateId':
|
case 'inspectionCertificate_setCertificateId':
|
||||||
resetCert(false);
|
|
||||||
root.certificateId = message.certificateId;
|
root.certificateId = message.certificateId;
|
||||||
break;
|
break;
|
||||||
case 'inspectionCertificate_resetCert':
|
case 'inspectionCertificate_resetCert':
|
||||||
resetCert(true);
|
titleBarText.text = "Certificate";
|
||||||
|
popText.text = "PROOF OF PURCHASE";
|
||||||
|
root.certificateId = "";
|
||||||
|
root.itemName = "--";
|
||||||
|
root.itemOwner = "--";
|
||||||
|
root.itemEdition = "--";
|
||||||
|
root.dateOfPurchase = "--";
|
||||||
|
root.marketplaceUrl = "";
|
||||||
|
root.isMyCert = false;
|
||||||
|
errorText.text = "";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message));
|
console.log('Unrecognized message from marketplaces.js:', JSON.stringify(message));
|
||||||
|
@ -572,33 +424,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
function resetCert(alsoResetCertID) {
|
|
||||||
if (alsoResetCertID) {
|
|
||||||
root.certificateId = "";
|
|
||||||
}
|
|
||||||
root.certInfoReplaceMode = 5;
|
|
||||||
root.certificateInfoPending = true;
|
|
||||||
root.certificateStatusPending = true;
|
|
||||||
root.useGoldCert = true;
|
|
||||||
root.certTitleTextColor = hifi.colors.darkGray;
|
|
||||||
root.certTextColor = hifi.colors.white;
|
|
||||||
root.infoTextColor = hifi.colors.blueAccent;
|
|
||||||
titleBarText.text = "Certificate";
|
|
||||||
popText.text = "";
|
|
||||||
root.itemName = "--";
|
|
||||||
root.itemOwner = "--";
|
|
||||||
root.itemEdition = "--";
|
|
||||||
root.dateOfPurchase = "--";
|
|
||||||
root.marketplaceUrl = "";
|
|
||||||
root.itemCost = "--";
|
|
||||||
root.isMyCert = false;
|
|
||||||
errorText.text = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFormattedDate(timestamp) {
|
function getFormattedDate(timestamp) {
|
||||||
if (timestamp === "--") {
|
|
||||||
return "--";
|
|
||||||
}
|
|
||||||
function addLeadingZero(n) {
|
function addLeadingZero(n) {
|
||||||
return n < 10 ? '0' + n : '' + n;
|
return n < 10 ? '0' + n : '' + n;
|
||||||
}
|
}
|
||||||
|
@ -623,7 +449,7 @@ Rectangle {
|
||||||
|
|
||||||
var min = addLeadingZero(a.getMinutes());
|
var min = addLeadingZero(a.getMinutes());
|
||||||
var sec = addLeadingZero(a.getSeconds());
|
var sec = addLeadingZero(a.getSeconds());
|
||||||
return year + '-' + month + '-' + day + ' ' + drawnHour + ':' + min + amOrPm;
|
return year + '-' + month + '-' + day + '<br>' + drawnHour + ':' + min + amOrPm;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// FUNCTION DEFINITIONS END
|
// FUNCTION DEFINITIONS END
|
||||||
|
|
Before Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 17 KiB |
|
@ -1115,7 +1115,7 @@ Item {
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
id: sendingMoneyImage;
|
id: sendingMoneyImage;
|
||||||
source: "../../common/images/loader.gif"
|
source: "./images/loader.gif"
|
||||||
width: 96;
|
width: 96;
|
||||||
height: width;
|
height: width;
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
After Width: | Height: | Size: 58 KiB |
|
@ -318,7 +318,7 @@ static QTimer pingTimer;
|
||||||
static bool DISABLE_WATCHDOG = true;
|
static bool DISABLE_WATCHDOG = true;
|
||||||
#else
|
#else
|
||||||
static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" };
|
static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" };
|
||||||
static bool DISABLE_WATCHDOG = QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG);
|
static bool DISABLE_WATCHDOG = nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_GLES)
|
#if defined(USE_GLES)
|
||||||
|
@ -415,20 +415,26 @@ public:
|
||||||
*crashTrigger = 0xDEAD10CC;
|
*crashTrigger = 0xDEAD10CC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void withPause(const std::function<void()>& lambda) {
|
||||||
|
pause();
|
||||||
|
lambda();
|
||||||
|
resume();
|
||||||
|
}
|
||||||
static void pause() {
|
static void pause() {
|
||||||
_paused = true;
|
_paused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resume() {
|
static void resume() {
|
||||||
_paused = false;
|
// Update the heartbeat BEFORE resuming the checks
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
_paused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run() override {
|
void run() override {
|
||||||
while (!_quit) {
|
while (!_quit) {
|
||||||
QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
|
QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
|
||||||
// Don't do heartbeat detection under nsight
|
// Don't do heartbeat detection under nsight
|
||||||
if (nsightActive() || _paused) {
|
if (_paused) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
|
uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
|
||||||
|
@ -2283,11 +2289,8 @@ void Application::initializeGL() {
|
||||||
initDisplay();
|
initDisplay();
|
||||||
qCDebug(interfaceapp, "Initialized Display.");
|
qCDebug(interfaceapp, "Initialized Display.");
|
||||||
|
|
||||||
#ifdef Q_OS_OSX
|
// FIXME: on low end systems os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
|
||||||
// FIXME: on mac os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
|
DeadlockWatchdogThread::withPause([&] {
|
||||||
DeadlockWatchdogThread::pause();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set up the render engine
|
// Set up the render engine
|
||||||
render::CullFunctor cullFunctor = LODManager::shouldRender;
|
render::CullFunctor cullFunctor = LODManager::shouldRender;
|
||||||
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
|
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
|
||||||
|
@ -2296,16 +2299,12 @@ void Application::initializeGL() {
|
||||||
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
|
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
|
||||||
#endif
|
#endif
|
||||||
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0);
|
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0);
|
||||||
|
|
||||||
_renderEngine->load();
|
_renderEngine->load();
|
||||||
_renderEngine->registerScene(_main3DScene);
|
_renderEngine->registerScene(_main3DScene);
|
||||||
|
|
||||||
// Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success.
|
// Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success.
|
||||||
DependencyManager::get<GeometryCache>()->initializeShapePipelines();
|
DependencyManager::get<GeometryCache>()->initializeShapePipelines();
|
||||||
|
});
|
||||||
#ifdef Q_OS_OSX
|
|
||||||
DeadlockWatchdogThread::resume();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_offscreenContext = new OffscreenGLCanvas();
|
_offscreenContext = new OffscreenGLCanvas();
|
||||||
_offscreenContext->setObjectName("MainThreadContext");
|
_offscreenContext->setObjectName("MainThreadContext");
|
||||||
|
@ -2404,7 +2403,9 @@ void Application::initializeUi() {
|
||||||
tabletScriptingInterface->getTablet(SYSTEM_TABLET);
|
tabletScriptingInterface->getTablet(SYSTEM_TABLET);
|
||||||
}
|
}
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
DeadlockWatchdogThread::pause();
|
||||||
offscreenUi->create();
|
offscreenUi->create();
|
||||||
|
DeadlockWatchdogThread::resume();
|
||||||
|
|
||||||
auto surfaceContext = offscreenUi->getSurfaceContext();
|
auto surfaceContext = offscreenUi->getSurfaceContext();
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ void Application::paintGL() {
|
||||||
// If a display plugin loses it's underlying support, it
|
// If a display plugin loses it's underlying support, it
|
||||||
// needs to be able to signal us to not use it
|
// needs to be able to signal us to not use it
|
||||||
if (!displayPlugin->beginFrameRender(_renderFrameCount)) {
|
if (!displayPlugin->beginFrameRender(_renderFrameCount)) {
|
||||||
updateDisplayMode();
|
QMetaObject::invokeMethod(this, "updateDisplayMode");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,7 @@ float LODManager::getDesktopLODDecreaseFPS() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float LODManager::getDesktopLODIncreaseFPS() const {
|
float LODManager::getDesktopLODIncreaseFPS() const {
|
||||||
return glm::max(((float)MSECS_PER_SECOND / _desktopMaxRenderTime) + INCREASE_LOD_GAP_FPS, MAX_LIKELY_DESKTOP_FPS);
|
return glm::min(((float)MSECS_PER_SECOND / _desktopMaxRenderTime) + INCREASE_LOD_GAP_FPS, MAX_LIKELY_DESKTOP_FPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LODManager::setHMDLODDecreaseFPS(float fps) {
|
void LODManager::setHMDLODDecreaseFPS(float fps) {
|
||||||
|
@ -184,7 +184,7 @@ float LODManager::getHMDLODDecreaseFPS() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float LODManager::getHMDLODIncreaseFPS() const {
|
float LODManager::getHMDLODIncreaseFPS() const {
|
||||||
return glm::max(((float)MSECS_PER_SECOND / _hmdMaxRenderTime) + INCREASE_LOD_GAP_FPS, MAX_LIKELY_HMD_FPS);
|
return glm::min(((float)MSECS_PER_SECOND / _hmdMaxRenderTime) + INCREASE_LOD_GAP_FPS, MAX_LIKELY_HMD_FPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LODManager::getLODFeedbackText() {
|
QString LODManager::getLODFeedbackText() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ const float DEFAULT_DESKTOP_MAX_RENDER_TIME = (float)MSECS_PER_SECOND / DEFAULT_
|
||||||
const float DEFAULT_HMD_MAX_RENDER_TIME = (float)MSECS_PER_SECOND / DEFAULT_HMD_LOD_DOWN_FPS; // msec
|
const float DEFAULT_HMD_MAX_RENDER_TIME = (float)MSECS_PER_SECOND / DEFAULT_HMD_LOD_DOWN_FPS; // msec
|
||||||
const float MAX_LIKELY_DESKTOP_FPS = 59.0f; // this is essentially, V-synch - 1 fps
|
const float MAX_LIKELY_DESKTOP_FPS = 59.0f; // this is essentially, V-synch - 1 fps
|
||||||
const float MAX_LIKELY_HMD_FPS = 74.0f; // this is essentially, V-synch - 1 fps
|
const float MAX_LIKELY_HMD_FPS = 74.0f; // this is essentially, V-synch - 1 fps
|
||||||
const float INCREASE_LOD_GAP_FPS = 15.0f; // fps
|
const float INCREASE_LOD_GAP_FPS = 10.0f; // fps
|
||||||
|
|
||||||
// The default value DEFAULT_OCTREE_SIZE_SCALE means you can be 400 meters away from a 1 meter object in order to see it (which is ~20:20 vision).
|
// The default value DEFAULT_OCTREE_SIZE_SCALE means you can be 400 meters away from a 1 meter object in order to see it (which is ~20:20 vision).
|
||||||
const float ADJUST_LOD_MAX_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE;
|
const float ADJUST_LOD_MAX_SIZE_SCALE = DEFAULT_OCTREE_SIZE_SCALE;
|
||||||
|
|
|
@ -31,6 +31,9 @@ AvatarActionHold::AvatarActionHold(const QUuid& id, EntityItemPointer ownerEntit
|
||||||
myAvatar->addHoldAction(this);
|
myAvatar->addHoldAction(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_positionalTargetSet = true;
|
||||||
|
_rotationalTargetSet = true;
|
||||||
|
|
||||||
#if WANT_DEBUG
|
#if WANT_DEBUG
|
||||||
qDebug() << "AvatarActionHold::AvatarActionHold" << (void*)this;
|
qDebug() << "AvatarActionHold::AvatarActionHold" << (void*)this;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -80,7 +80,6 @@ Web3DOverlay::Web3DOverlay() {
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("GlobalServices", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED
|
_webSurface->getSurfaceContext()->setContextProperty("GlobalServices", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("AccountServices", AccountServicesScriptingInterface::getInstance());
|
_webSurface->getSurfaceContext()->setContextProperty("AccountServices", AccountServicesScriptingInterface::getInstance());
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Web3DOverlay::Web3DOverlay(const Web3DOverlay* Web3DOverlay) :
|
Web3DOverlay::Web3DOverlay(const Web3DOverlay* Web3DOverlay) :
|
||||||
|
@ -201,6 +200,11 @@ void Web3DOverlay::setupQmlSurface() {
|
||||||
|
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("offscreenFlags", flags);
|
_webSurface->getSurfaceContext()->setContextProperty("offscreenFlags", flags);
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
||||||
|
|
||||||
|
_webSurface->getSurfaceContext()->setContextProperty("Account", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED
|
||||||
|
_webSurface->getSurfaceContext()->setContextProperty("GlobalServices", AccountServicesScriptingInterface::getInstance()); // DEPRECATED - TO BE REMOVED
|
||||||
|
_webSurface->getSurfaceContext()->setContextProperty("AccountServices", AccountServicesScriptingInterface::getInstance());
|
||||||
|
|
||||||
// in Qt 5.10.0 there is already an "Audio" object in the QML context
|
// in Qt 5.10.0 there is already an "Audio" object in the QML context
|
||||||
// though I failed to find it (from QtMultimedia??). So.. let it be "AudioScriptingInterface"
|
// though I failed to find it (from QtMultimedia??). So.. let it be "AudioScriptingInterface"
|
||||||
_webSurface->getSurfaceContext()->setContextProperty("AudioScriptingInterface", DependencyManager::get<AudioScriptingInterface>().data());
|
_webSurface->getSurfaceContext()->setContextProperty("AudioScriptingInterface", DependencyManager::get<AudioScriptingInterface>().data());
|
||||||
|
|
|
@ -395,8 +395,8 @@ void HmdDisplayPlugin::HUDRenderer::build() {
|
||||||
|
|
||||||
void HmdDisplayPlugin::HUDRenderer::updatePipeline() {
|
void HmdDisplayPlugin::HUDRenderer::updatePipeline() {
|
||||||
if (!pipeline) {
|
if (!pipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(hmd_ui_vert));
|
auto vs = hmd_ui_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(hmd_ui_frag));
|
auto ps = hmd_ui_frag::getShader();
|
||||||
auto program = gpu::Shader::createProgram(vs, ps);
|
auto program = gpu::Shader::createProgram(vs, ps);
|
||||||
gpu::Shader::makeProgram(*program, gpu::Shader::BindingSet());
|
gpu::Shader::makeProgram(*program, gpu::Shader::BindingSet());
|
||||||
uniformsLocation = program->getUniformBuffers().findLocation("hudBuffer");
|
uniformsLocation = program->getUniformBuffers().findLocation("hudBuffer");
|
||||||
|
|
|
@ -36,8 +36,8 @@ static ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, co
|
||||||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||||
PrepareStencil::testMask(*state);
|
PrepareStencil::testMask(*state);
|
||||||
|
|
||||||
auto vertShader = gpu::Shader::createVertex(std::string(textured_particle_vert));
|
auto vertShader = textured_particle_vert::getShader();
|
||||||
auto fragShader = gpu::Shader::createPixel(std::string(textured_particle_frag));
|
auto fragShader = textured_particle_frag::getShader();
|
||||||
|
|
||||||
auto program = gpu::Shader::createProgram(vertShader, fragShader);
|
auto program = gpu::Shader::createProgram(vertShader, fragShader);
|
||||||
_texturedPipeline = texturedPipeline = gpu::Pipeline::create(program, state);
|
_texturedPipeline = texturedPipeline = gpu::Pipeline::create(program, state);
|
||||||
|
|
|
@ -48,8 +48,8 @@ struct PolyLineUniforms {
|
||||||
|
|
||||||
static render::ShapePipelinePointer shapePipelineFactory(const render::ShapePlumber& plumber, const render::ShapeKey& key, gpu::Batch& batch) {
|
static render::ShapePipelinePointer shapePipelineFactory(const render::ShapePlumber& plumber, const render::ShapeKey& key, gpu::Batch& batch) {
|
||||||
if (!polylinePipeline) {
|
if (!polylinePipeline) {
|
||||||
auto VS = gpu::Shader::createVertex(std::string(paintStroke_vert));
|
auto VS = paintStroke_vert::getShader();
|
||||||
auto PS = gpu::Shader::createPixel(std::string(paintStroke_frag));
|
auto PS = paintStroke_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
||||||
#ifdef POLYLINE_ENTITY_USE_FADE_EFFECT
|
#ifdef POLYLINE_ENTITY_USE_FADE_EFFECT
|
||||||
auto fadeVS = gpu::Shader::createVertex(std::string(paintStroke_fade_vert));
|
auto fadeVS = gpu::Shader::createVertex(std::string(paintStroke_fade_vert));
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <StencilMaskPass.h>
|
#include <StencilMaskPass.h>
|
||||||
|
|
||||||
#include "EntityTreeRenderer.h"
|
#include "EntityTreeRenderer.h"
|
||||||
|
|
||||||
#include "polyvox_vert.h"
|
#include "polyvox_vert.h"
|
||||||
#include "polyvox_frag.h"
|
#include "polyvox_frag.h"
|
||||||
#include "polyvox_fade_vert.h"
|
#include "polyvox_fade_vert.h"
|
||||||
|
@ -70,6 +71,7 @@
|
||||||
#include "StencilMaskPass.h"
|
#include "StencilMaskPass.h"
|
||||||
|
|
||||||
#include "EntityTreeRenderer.h"
|
#include "EntityTreeRenderer.h"
|
||||||
|
|
||||||
#include "polyvox_vert.h"
|
#include "polyvox_vert.h"
|
||||||
#include "polyvox_frag.h"
|
#include "polyvox_frag.h"
|
||||||
#include "polyvox_fade_vert.h"
|
#include "polyvox_fade_vert.h"
|
||||||
|
@ -1459,8 +1461,8 @@ static gpu::Stream::FormatPointer _vertexFormat;
|
||||||
|
|
||||||
ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, const ShapeKey& key, gpu::Batch& batch) {
|
ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, const ShapeKey& key, gpu::Batch& batch) {
|
||||||
if (!_pipelines[0]) {
|
if (!_pipelines[0]) {
|
||||||
gpu::ShaderPointer vertexShaders[2] = { gpu::Shader::createVertex(std::string(polyvox_vert)), gpu::Shader::createVertex(std::string(polyvox_fade_vert)) };
|
gpu::ShaderPointer vertexShaders[2] = { polyvox_vert::getShader(), polyvox_fade_vert::getShader() };
|
||||||
gpu::ShaderPointer pixelShaders[2] = { gpu::Shader::createPixel(std::string(polyvox_frag)), gpu::Shader::createPixel(std::string(polyvox_fade_frag)) };
|
gpu::ShaderPointer pixelShaders[2] = { polyvox_frag::getShader(), polyvox_fade_frag::getShader() };
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT));
|
slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT));
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
#include <GeometryCache.h>
|
#include <GeometryCache.h>
|
||||||
#include <PerfStat.h>
|
#include <PerfStat.h>
|
||||||
|
|
||||||
#include <render-utils/simple_vert.h>
|
#include "render-utils/simple_vert.h"
|
||||||
#include <render-utils/simple_frag.h>
|
#include "render-utils/simple_frag.h"
|
||||||
|
|
||||||
//#define SHAPE_ENTITY_USE_FADE_EFFECT
|
//#define SHAPE_ENTITY_USE_FADE_EFFECT
|
||||||
#ifdef SHAPE_ENTITY_USE_FADE_EFFECT
|
#ifdef SHAPE_ENTITY_USE_FADE_EFFECT
|
||||||
|
@ -32,8 +32,8 @@ static const float SPHERE_ENTITY_SCALE = 0.5f;
|
||||||
|
|
||||||
|
|
||||||
ShapeEntityRenderer::ShapeEntityRenderer(const EntityItemPointer& entity) : Parent(entity) {
|
ShapeEntityRenderer::ShapeEntityRenderer(const EntityItemPointer& entity) : Parent(entity) {
|
||||||
_procedural._vertexSource = simple_vert;
|
_procedural._vertexSource = simple_vert::getSource();
|
||||||
_procedural._fragmentSource = simple_frag;
|
_procedural._fragmentSource = simple_frag::getSource();
|
||||||
_procedural._opaqueState->setCullMode(gpu::State::CULL_NONE);
|
_procedural._opaqueState->setCullMode(gpu::State::CULL_NONE);
|
||||||
_procedural._opaqueState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
_procedural._opaqueState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
||||||
PrepareStencil::testMaskDrawShape(*_procedural._opaqueState);
|
PrepareStencil::testMaskDrawShape(*_procedural._opaqueState);
|
||||||
|
|
|
@ -73,42 +73,42 @@ ShaderPointer StandardShaderLib::getProgram(GetShader getVS, GetShader getPS) {
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawUnitQuadTexcoordVS() {
|
ShaderPointer StandardShaderLib::getDrawUnitQuadTexcoordVS() {
|
||||||
if (!_drawUnitQuadTexcoordVS) {
|
if (!_drawUnitQuadTexcoordVS) {
|
||||||
_drawUnitQuadTexcoordVS = gpu::Shader::createVertex(std::string(DrawUnitQuadTexcoord_vert));
|
_drawUnitQuadTexcoordVS = DrawUnitQuadTexcoord_vert::getShader();
|
||||||
}
|
}
|
||||||
return _drawUnitQuadTexcoordVS;
|
return _drawUnitQuadTexcoordVS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawTransformUnitQuadVS() {
|
ShaderPointer StandardShaderLib::getDrawTransformUnitQuadVS() {
|
||||||
if (!_drawTransformUnitQuadVS) {
|
if (!_drawTransformUnitQuadVS) {
|
||||||
_drawTransformUnitQuadVS = gpu::Shader::createVertex(std::string(DrawTransformUnitQuad_vert));
|
_drawTransformUnitQuadVS = DrawTransformUnitQuad_vert::getShader();
|
||||||
}
|
}
|
||||||
return _drawTransformUnitQuadVS;
|
return _drawTransformUnitQuadVS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawTexcoordRectTransformUnitQuadVS() {
|
ShaderPointer StandardShaderLib::getDrawTexcoordRectTransformUnitQuadVS() {
|
||||||
if (!_drawTexcoordRectTransformUnitQuadVS) {
|
if (!_drawTexcoordRectTransformUnitQuadVS) {
|
||||||
_drawTexcoordRectTransformUnitQuadVS = gpu::Shader::createVertex(std::string(DrawTexcoordRectTransformUnitQuad_vert));
|
_drawTexcoordRectTransformUnitQuadVS = DrawTexcoordRectTransformUnitQuad_vert::getShader();
|
||||||
}
|
}
|
||||||
return _drawTexcoordRectTransformUnitQuadVS;
|
return _drawTexcoordRectTransformUnitQuadVS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawViewportQuadTransformTexcoordVS() {
|
ShaderPointer StandardShaderLib::getDrawViewportQuadTransformTexcoordVS() {
|
||||||
if (!_drawViewportQuadTransformTexcoordVS) {
|
if (!_drawViewportQuadTransformTexcoordVS) {
|
||||||
_drawViewportQuadTransformTexcoordVS = gpu::Shader::createVertex(std::string(DrawViewportQuadTransformTexcoord_vert));
|
_drawViewportQuadTransformTexcoordVS = DrawViewportQuadTransformTexcoord_vert::getShader();
|
||||||
}
|
}
|
||||||
return _drawViewportQuadTransformTexcoordVS;
|
return _drawViewportQuadTransformTexcoordVS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawVertexPositionVS() {
|
ShaderPointer StandardShaderLib::getDrawVertexPositionVS() {
|
||||||
if (!_drawVertexPositionVS) {
|
if (!_drawVertexPositionVS) {
|
||||||
_drawVertexPositionVS = gpu::Shader::createVertex(std::string(DrawVertexPosition_vert));
|
_drawVertexPositionVS = DrawVertexPosition_vert::getShader();
|
||||||
}
|
}
|
||||||
return _drawVertexPositionVS;
|
return _drawVertexPositionVS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawTransformVertexPositionVS() {
|
ShaderPointer StandardShaderLib::getDrawTransformVertexPositionVS() {
|
||||||
if (!_drawTransformVertexPositionVS) {
|
if (!_drawTransformVertexPositionVS) {
|
||||||
_drawTransformVertexPositionVS = gpu::Shader::createVertex(std::string(DrawTransformVertexPosition_vert));
|
_drawTransformVertexPositionVS = DrawTransformVertexPosition_vert::getShader();
|
||||||
}
|
}
|
||||||
return _drawTransformVertexPositionVS;
|
return _drawTransformVertexPositionVS;
|
||||||
}
|
}
|
||||||
|
@ -122,42 +122,42 @@ ShaderPointer StandardShaderLib::getDrawNadaPS() {
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawWhitePS() {
|
ShaderPointer StandardShaderLib::getDrawWhitePS() {
|
||||||
if (!_drawWhitePS) {
|
if (!_drawWhitePS) {
|
||||||
_drawWhitePS = gpu::Shader::createPixel(std::string(DrawWhite_frag));
|
_drawWhitePS = DrawWhite_frag::getShader();
|
||||||
}
|
}
|
||||||
return _drawWhitePS;
|
return _drawWhitePS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawColorPS() {
|
ShaderPointer StandardShaderLib::getDrawColorPS() {
|
||||||
if (!_drawColorPS) {
|
if (!_drawColorPS) {
|
||||||
_drawColorPS = gpu::Shader::createPixel(std::string(DrawColor_frag));
|
_drawColorPS = DrawColor_frag::getShader();
|
||||||
}
|
}
|
||||||
return _drawColorPS;
|
return _drawColorPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawTexturePS() {
|
ShaderPointer StandardShaderLib::getDrawTexturePS() {
|
||||||
if (!_drawTexturePS) {
|
if (!_drawTexturePS) {
|
||||||
_drawTexturePS = gpu::Shader::createPixel(std::string(DrawTexture_frag));
|
_drawTexturePS = DrawTexture_frag::getShader();
|
||||||
}
|
}
|
||||||
return _drawTexturePS;
|
return _drawTexturePS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawTextureMirroredXPS() {
|
ShaderPointer StandardShaderLib::getDrawTextureMirroredXPS() {
|
||||||
if (!_drawTextureMirroredXPS) {
|
if (!_drawTextureMirroredXPS) {
|
||||||
_drawTextureMirroredXPS = gpu::Shader::createPixel(std::string(DrawTextureMirroredX_frag));
|
_drawTextureMirroredXPS = DrawTextureMirroredX_frag::getShader();
|
||||||
}
|
}
|
||||||
return _drawTextureMirroredXPS;
|
return _drawTextureMirroredXPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawTextureOpaquePS() {
|
ShaderPointer StandardShaderLib::getDrawTextureOpaquePS() {
|
||||||
if (!_drawTextureOpaquePS) {
|
if (!_drawTextureOpaquePS) {
|
||||||
_drawTextureOpaquePS = gpu::Shader::createPixel(std::string(DrawTextureOpaque_frag));
|
_drawTextureOpaquePS = DrawTextureOpaque_frag::getShader();
|
||||||
}
|
}
|
||||||
return _drawTextureOpaquePS;
|
return _drawTextureOpaquePS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPointer StandardShaderLib::getDrawColoredTexturePS() {
|
ShaderPointer StandardShaderLib::getDrawColoredTexturePS() {
|
||||||
if (!_drawColoredTexturePS) {
|
if (!_drawColoredTexturePS) {
|
||||||
_drawColoredTexturePS = gpu::Shader::createPixel(std::string(DrawColoredTexture_frag));
|
_drawColoredTexturePS = DrawColoredTexture_frag::getShader();
|
||||||
}
|
}
|
||||||
return _drawColoredTexturePS;
|
return _drawColoredTexturePS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,8 +91,8 @@ void Skybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum, const Sky
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&] {
|
std::call_once(once, [&] {
|
||||||
{
|
{
|
||||||
auto skyVS = gpu::Shader::createVertex(std::string(skybox_vert));
|
auto skyVS = skybox_vert::getShader();
|
||||||
auto skyFS = gpu::Shader::createPixel(std::string(skybox_frag));
|
auto skyFS = skybox_frag::getShader();
|
||||||
auto skyShader = gpu::Shader::createProgram(skyVS, skyFS);
|
auto skyShader = gpu::Shader::createProgram(skyVS, skyFS);
|
||||||
|
|
||||||
batch.runLambda([skyShader] {
|
batch.runLambda([skyShader] {
|
||||||
|
|
|
@ -77,13 +77,18 @@ bool ObjectActionTractor::prepareForTractorUpdate(btScalar deltaTimeStep) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool doLinearTraction = _positionalTargetSet && (_linearTimeScale < MAX_TRACTOR_TIMESCALE);
|
||||||
|
bool doAngularTraction = _rotationalTargetSet && (_angularTimeScale < MAX_TRACTOR_TIMESCALE);
|
||||||
|
if (!doLinearTraction && !doAngularTraction) {
|
||||||
|
// nothing to do
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
glm::quat rotation;
|
glm::quat rotation;
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::vec3 angularVelocity;
|
glm::vec3 angularVelocity;
|
||||||
|
|
||||||
bool linearValid = false;
|
|
||||||
int linearTractorCount = 0;
|
int linearTractorCount = 0;
|
||||||
bool angularValid = false;
|
|
||||||
int angularTractorCount = 0;
|
int angularTractorCount = 0;
|
||||||
|
|
||||||
QList<EntityDynamicPointer> tractorDerivedActions;
|
QList<EntityDynamicPointer> tractorDerivedActions;
|
||||||
|
@ -105,7 +110,6 @@ bool ObjectActionTractor::prepareForTractorUpdate(btScalar deltaTimeStep) {
|
||||||
linearTimeScale, angularTimeScale);
|
linearTimeScale, angularTimeScale);
|
||||||
if (success) {
|
if (success) {
|
||||||
if (angularTimeScale < MAX_TRACTOR_TIMESCALE) {
|
if (angularTimeScale < MAX_TRACTOR_TIMESCALE) {
|
||||||
angularValid = true;
|
|
||||||
angularTractorCount++;
|
angularTractorCount++;
|
||||||
angularVelocity += angularVelocityForAction;
|
angularVelocity += angularVelocityForAction;
|
||||||
if (tractorAction.get() == this) {
|
if (tractorAction.get() == this) {
|
||||||
|
@ -115,41 +119,40 @@ bool ObjectActionTractor::prepareForTractorUpdate(btScalar deltaTimeStep) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (linearTimeScale < MAX_TRACTOR_TIMESCALE) {
|
if (linearTimeScale < MAX_TRACTOR_TIMESCALE) {
|
||||||
linearValid = true;
|
|
||||||
linearTractorCount++;
|
linearTractorCount++;
|
||||||
position += positionForAction;
|
position += positionForAction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((angularValid && angularTractorCount > 0) || (linearValid && linearTractorCount > 0)) {
|
if (angularTractorCount > 0 || linearTractorCount > 0) {
|
||||||
withWriteLock([&]{
|
withWriteLock([&]{
|
||||||
if (linearValid && linearTractorCount > 0) {
|
if (doLinearTraction && linearTractorCount > 0) {
|
||||||
position /= linearTractorCount;
|
position /= linearTractorCount;
|
||||||
if (_positionalTargetSet) {
|
|
||||||
_lastPositionTarget = _positionalTarget;
|
_lastPositionTarget = _positionalTarget;
|
||||||
_positionalTarget = position;
|
_positionalTarget = position;
|
||||||
if (deltaTimeStep > EPSILON) {
|
if (deltaTimeStep > EPSILON) {
|
||||||
|
if (_havePositionTargetHistory) {
|
||||||
// blend the new velocity with the old (low-pass filter)
|
// blend the new velocity with the old (low-pass filter)
|
||||||
glm::vec3 newVelocity = (1.0f / deltaTimeStep) * (_positionalTarget - _lastPositionTarget);
|
glm::vec3 newVelocity = (1.0f / deltaTimeStep) * (_positionalTarget - _lastPositionTarget);
|
||||||
const float blend = 0.25f;
|
const float blend = 0.25f;
|
||||||
_linearVelocityTarget = (1.0f - blend) * _linearVelocityTarget + blend * newVelocity;
|
_linearVelocityTarget = (1.0f - blend) * _linearVelocityTarget + blend * newVelocity;
|
||||||
|
} else {
|
||||||
|
_havePositionTargetHistory = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_positionalTargetSet = true;
|
|
||||||
_active = true;
|
_active = true;
|
||||||
}
|
}
|
||||||
if (angularValid && angularTractorCount > 0) {
|
if (doAngularTraction && angularTractorCount > 0) {
|
||||||
angularVelocity /= angularTractorCount;
|
angularVelocity /= angularTractorCount;
|
||||||
_rotationalTarget = rotation;
|
_rotationalTarget = rotation;
|
||||||
_angularVelocityTarget = angularVelocity;
|
_angularVelocityTarget = angularVelocity;
|
||||||
_rotationalTargetSet = true;
|
|
||||||
_active = true;
|
_active = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return linearValid || angularValid;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,7 +242,9 @@ bool ObjectActionTractor::updateArguments(QVariantMap arguments) {
|
||||||
// targets are required, tractor-constants are optional
|
// targets are required, tractor-constants are optional
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
positionalTarget = EntityDynamicInterface::extractVec3Argument("tractor action", arguments, "targetPosition", ok, false);
|
positionalTarget = EntityDynamicInterface::extractVec3Argument("tractor action", arguments, "targetPosition", ok, false);
|
||||||
if (!ok) {
|
if (ok) {
|
||||||
|
_positionalTargetSet = true;
|
||||||
|
} else {
|
||||||
positionalTarget = _desiredPositionalTarget;
|
positionalTarget = _desiredPositionalTarget;
|
||||||
}
|
}
|
||||||
ok = true;
|
ok = true;
|
||||||
|
@ -250,7 +255,9 @@ bool ObjectActionTractor::updateArguments(QVariantMap arguments) {
|
||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
rotationalTarget = EntityDynamicInterface::extractQuatArgument("tractor action", arguments, "targetRotation", ok, false);
|
rotationalTarget = EntityDynamicInterface::extractQuatArgument("tractor action", arguments, "targetRotation", ok, false);
|
||||||
if (!ok) {
|
if (ok) {
|
||||||
|
_rotationalTargetSet = true;
|
||||||
|
} else {
|
||||||
rotationalTarget = _desiredRotationalTarget;
|
rotationalTarget = _desiredRotationalTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ protected:
|
||||||
glm::vec3 _lastPositionTarget;
|
glm::vec3 _lastPositionTarget;
|
||||||
float _linearTimeScale;
|
float _linearTimeScale;
|
||||||
bool _positionalTargetSet;
|
bool _positionalTargetSet;
|
||||||
|
bool _havePositionTargetHistory { false };
|
||||||
|
|
||||||
glm::quat _rotationalTarget;
|
glm::quat _rotationalTarget;
|
||||||
glm::quat _desiredRotationalTarget;
|
glm::quat _desiredRotationalTarget;
|
||||||
|
|
|
@ -241,7 +241,7 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm
|
||||||
std::string fragmentShaderSource = _fragmentSource;
|
std::string fragmentShaderSource = _fragmentSource;
|
||||||
size_t replaceIndex = fragmentShaderSource.find(PROCEDURAL_COMMON_BLOCK);
|
size_t replaceIndex = fragmentShaderSource.find(PROCEDURAL_COMMON_BLOCK);
|
||||||
if (replaceIndex != std::string::npos) {
|
if (replaceIndex != std::string::npos) {
|
||||||
fragmentShaderSource.replace(replaceIndex, PROCEDURAL_COMMON_BLOCK.size(), ProceduralCommon_frag);
|
fragmentShaderSource.replace(replaceIndex, PROCEDURAL_COMMON_BLOCK.size(), ProceduralCommon_frag::getSource());
|
||||||
}
|
}
|
||||||
|
|
||||||
replaceIndex = fragmentShaderSource.find(PROCEDURAL_VERSION);
|
replaceIndex = fragmentShaderSource.find(PROCEDURAL_VERSION);
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
#include <graphics/skybox_frag.h>
|
#include <graphics/skybox_frag.h>
|
||||||
|
|
||||||
ProceduralSkybox::ProceduralSkybox() : graphics::Skybox() {
|
ProceduralSkybox::ProceduralSkybox() : graphics::Skybox() {
|
||||||
_procedural._vertexSource = skybox_vert;
|
_procedural._vertexSource = skybox_vert::getSource();
|
||||||
_procedural._fragmentSource = skybox_frag;
|
_procedural._fragmentSource = skybox_frag::getSource();
|
||||||
// Adjust the pipeline state for background using the stencil test
|
// Adjust the pipeline state for background using the stencil test
|
||||||
_procedural.setDoesFade(false);
|
_procedural.setDoesFade(false);
|
||||||
// Must match PrepareStencil::STENCIL_BACKGROUND
|
// Must match PrepareStencil::STENCIL_BACKGROUND
|
||||||
|
|
|
@ -263,7 +263,7 @@ void AmbientOcclusionEffect::configure(const Config& config) {
|
||||||
const gpu::PipelinePointer& AmbientOcclusionEffect::getOcclusionPipeline() {
|
const gpu::PipelinePointer& AmbientOcclusionEffect::getOcclusionPipeline() {
|
||||||
if (!_occlusionPipeline) {
|
if (!_occlusionPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(ssao_makeOcclusion_frag));
|
auto ps = ssao_makeOcclusion_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -288,7 +288,7 @@ const gpu::PipelinePointer& AmbientOcclusionEffect::getOcclusionPipeline() {
|
||||||
const gpu::PipelinePointer& AmbientOcclusionEffect::getHBlurPipeline() {
|
const gpu::PipelinePointer& AmbientOcclusionEffect::getHBlurPipeline() {
|
||||||
if (!_hBlurPipeline) {
|
if (!_hBlurPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(ssao_makeHorizontalBlur_frag));
|
auto ps = ssao_makeHorizontalBlur_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -311,7 +311,7 @@ const gpu::PipelinePointer& AmbientOcclusionEffect::getHBlurPipeline() {
|
||||||
const gpu::PipelinePointer& AmbientOcclusionEffect::getVBlurPipeline() {
|
const gpu::PipelinePointer& AmbientOcclusionEffect::getVBlurPipeline() {
|
||||||
if (!_vBlurPipeline) {
|
if (!_vBlurPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(ssao_makeVerticalBlur_frag));
|
auto ps = ssao_makeVerticalBlur_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -458,7 +458,7 @@ void DebugAmbientOcclusion::configure(const Config& config) {
|
||||||
const gpu::PipelinePointer& DebugAmbientOcclusion::getDebugPipeline() {
|
const gpu::PipelinePointer& DebugAmbientOcclusion::getDebugPipeline() {
|
||||||
if (!_debugPipeline) {
|
if (!_debugPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(ssao_debugOcclusion_frag));
|
auto ps = ssao_debugOcclusion_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
#include <qmath.h>
|
#include <qmath.h>
|
||||||
|
|
||||||
#include "animdebugdraw_vert.h"
|
|
||||||
#include "animdebugdraw_frag.h"
|
|
||||||
#include <gpu/Batch.h>
|
#include <gpu/Batch.h>
|
||||||
#include "AbstractViewStateInterface.h"
|
#include "AbstractViewStateInterface.h"
|
||||||
#include "RenderUtilsLogging.h"
|
#include "RenderUtilsLogging.h"
|
||||||
|
@ -19,6 +17,9 @@
|
||||||
|
|
||||||
#include "AnimDebugDraw.h"
|
#include "AnimDebugDraw.h"
|
||||||
|
|
||||||
|
#include "animdebugdraw_vert.h"
|
||||||
|
#include "animdebugdraw_frag.h"
|
||||||
|
|
||||||
class AnimDebugDrawData {
|
class AnimDebugDrawData {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -101,8 +102,8 @@ AnimDebugDraw::AnimDebugDraw() :
|
||||||
state->setBlendFunction(false, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD,
|
state->setBlendFunction(false, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD,
|
||||||
gpu::State::INV_SRC_ALPHA, gpu::State::FACTOR_ALPHA,
|
gpu::State::INV_SRC_ALPHA, gpu::State::FACTOR_ALPHA,
|
||||||
gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||||
auto vertShader = gpu::Shader::createVertex(std::string(animdebugdraw_vert));
|
auto vertShader = animdebugdraw_vert::getShader();
|
||||||
auto fragShader = gpu::Shader::createPixel(std::string(animdebugdraw_frag));
|
auto fragShader = animdebugdraw_frag::getShader();
|
||||||
auto program = gpu::Shader::createProgram(vertShader, fragShader);
|
auto program = gpu::Shader::createProgram(vertShader, fragShader);
|
||||||
_pipeline = gpu::Pipeline::create(program, state);
|
_pipeline = gpu::Pipeline::create(program, state);
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,8 @@ const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline(RenderArgs* ar
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_antialiasingPipeline) {
|
if (!_antialiasingPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(fxaa_vert));
|
auto vs = fxaa_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(fxaa_frag));
|
auto ps = fxaa_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -82,8 +82,8 @@ const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline(RenderArgs* ar
|
||||||
|
|
||||||
const gpu::PipelinePointer& Antialiasing::getBlendPipeline() {
|
const gpu::PipelinePointer& Antialiasing::getBlendPipeline() {
|
||||||
if (!_blendPipeline) {
|
if (!_blendPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(fxaa_vert));
|
auto vs = fxaa_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(fxaa_blend_frag));
|
auto ps = fxaa_blend_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -61,7 +61,7 @@ void BloomThreshold::run(const render::RenderContextPointer& renderContext, cons
|
||||||
|
|
||||||
if (!_pipeline) {
|
if (!_pipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(BloomThreshold_frag));
|
auto ps = BloomThreshold_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -113,7 +113,7 @@ void BloomApply::run(const render::RenderContextPointer& renderContext, const In
|
||||||
|
|
||||||
if (!_pipeline) {
|
if (!_pipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(BloomApply_frag));
|
auto ps = BloomApply_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -369,8 +369,7 @@ bool DebugDeferredBuffer::pipelineNeedsUpdate(Mode mode, std::string customFile)
|
||||||
|
|
||||||
const gpu::PipelinePointer& DebugDeferredBuffer::getPipeline(Mode mode, std::string customFile) {
|
const gpu::PipelinePointer& DebugDeferredBuffer::getPipeline(Mode mode, std::string customFile) {
|
||||||
if (pipelineNeedsUpdate(mode, customFile)) {
|
if (pipelineNeedsUpdate(mode, customFile)) {
|
||||||
static const std::string VERTEX_SHADER { debug_deferred_buffer_vert };
|
static const std::string FRAGMENT_SHADER { debug_deferred_buffer_frag::getSource() };
|
||||||
static const std::string FRAGMENT_SHADER { debug_deferred_buffer_frag };
|
|
||||||
static const std::string SOURCE_PLACEHOLDER { "//SOURCE_PLACEHOLDER" };
|
static const std::string SOURCE_PLACEHOLDER { "//SOURCE_PLACEHOLDER" };
|
||||||
static const auto SOURCE_PLACEHOLDER_INDEX = FRAGMENT_SHADER.find(SOURCE_PLACEHOLDER);
|
static const auto SOURCE_PLACEHOLDER_INDEX = FRAGMENT_SHADER.find(SOURCE_PLACEHOLDER);
|
||||||
Q_ASSERT_X(SOURCE_PLACEHOLDER_INDEX != std::string::npos, Q_FUNC_INFO,
|
Q_ASSERT_X(SOURCE_PLACEHOLDER_INDEX != std::string::npos, Q_FUNC_INFO,
|
||||||
|
@ -380,7 +379,7 @@ const gpu::PipelinePointer& DebugDeferredBuffer::getPipeline(Mode mode, std::str
|
||||||
bakedFragmentShader.replace(SOURCE_PLACEHOLDER_INDEX, SOURCE_PLACEHOLDER.size(),
|
bakedFragmentShader.replace(SOURCE_PLACEHOLDER_INDEX, SOURCE_PLACEHOLDER.size(),
|
||||||
getShaderSourceCode(mode, customFile));
|
getShaderSourceCode(mode, customFile));
|
||||||
|
|
||||||
static const auto vs = gpu::Shader::createVertex(VERTEX_SHADER);
|
const auto vs = debug_deferred_buffer_vert::getShader();
|
||||||
const auto ps = gpu::Shader::createPixel(bakedFragmentShader);
|
const auto ps = gpu::Shader::createPixel(bakedFragmentShader);
|
||||||
const auto program = gpu::Shader::createProgram(vs, ps);
|
const auto program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ enum DeferredShader_BufferSlot {
|
||||||
LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
|
LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void loadLightProgram(const char* vertSource, const char* fragSource, bool lightVolume, gpu::PipelinePointer& program, LightLocationsPtr& locations);
|
static void loadLightProgram(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, bool lightVolume, gpu::PipelinePointer& program, LightLocationsPtr& locations);
|
||||||
|
|
||||||
void DeferredLightingEffect::init() {
|
void DeferredLightingEffect::init() {
|
||||||
_directionalAmbientSphereLightLocations = std::make_shared<LightLocations>();
|
_directionalAmbientSphereLightLocations = std::make_shared<LightLocations>();
|
||||||
|
@ -95,14 +95,14 @@ void DeferredLightingEffect::init() {
|
||||||
_localLightLocations = std::make_shared<LightLocations>();
|
_localLightLocations = std::make_shared<LightLocations>();
|
||||||
_localLightOutlineLocations = std::make_shared<LightLocations>();
|
_localLightOutlineLocations = std::make_shared<LightLocations>();
|
||||||
|
|
||||||
loadLightProgram(deferred_light_vert, directional_ambient_light_frag, false, _directionalAmbientSphereLight, _directionalAmbientSphereLightLocations);
|
loadLightProgram(deferred_light_vert::getShader(), directional_ambient_light_frag::getShader(), false, _directionalAmbientSphereLight, _directionalAmbientSphereLightLocations);
|
||||||
loadLightProgram(deferred_light_vert, directional_skybox_light_frag, false, _directionalSkyboxLight, _directionalSkyboxLightLocations);
|
loadLightProgram(deferred_light_vert::getShader(), directional_skybox_light_frag::getShader(), false, _directionalSkyboxLight, _directionalSkyboxLightLocations);
|
||||||
|
|
||||||
loadLightProgram(deferred_light_vert, directional_ambient_light_shadow_frag, false, _directionalAmbientSphereLightShadow, _directionalAmbientSphereLightShadowLocations);
|
loadLightProgram(deferred_light_vert::getShader(), directional_ambient_light_shadow_frag::getShader(), false, _directionalAmbientSphereLightShadow, _directionalAmbientSphereLightShadowLocations);
|
||||||
loadLightProgram(deferred_light_vert, directional_skybox_light_shadow_frag, false, _directionalSkyboxLightShadow, _directionalSkyboxLightShadowLocations);
|
loadLightProgram(deferred_light_vert::getShader(), directional_skybox_light_shadow_frag::getShader(), false, _directionalSkyboxLightShadow, _directionalSkyboxLightShadowLocations);
|
||||||
|
|
||||||
loadLightProgram(deferred_light_vert, local_lights_shading_frag, true, _localLight, _localLightLocations);
|
loadLightProgram(deferred_light_vert::getShader(), local_lights_shading_frag::getShader(), true, _localLight, _localLightLocations);
|
||||||
loadLightProgram(deferred_light_vert, local_lights_drawOutline_frag, true, _localLightOutline, _localLightOutlineLocations);
|
loadLightProgram(deferred_light_vert::getShader(), local_lights_drawOutline_frag::getShader(), true, _localLightOutline, _localLightOutlineLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeferredLightingEffect::setupKeyLightBatch(const RenderArgs* args, gpu::Batch& batch, int lightBufferUnit, int ambientBufferUnit, int skyboxCubemapUnit) {
|
void DeferredLightingEffect::setupKeyLightBatch(const RenderArgs* args, gpu::Batch& batch, int lightBufferUnit, int ambientBufferUnit, int skyboxCubemapUnit) {
|
||||||
|
@ -171,12 +171,8 @@ void DeferredLightingEffect::unsetLocalLightsBatch(gpu::Batch& batch, int cluste
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpu::ShaderPointer makeLightProgram(const char* vertSource, const char* fragSource, LightLocationsPtr& locations) {
|
static gpu::ShaderPointer makeLightProgram(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, LightLocationsPtr& locations) {
|
||||||
auto VS = gpu::Shader::createVertex(std::string(vertSource));
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vertShader, fragShader);
|
||||||
auto PS = gpu::Shader::createPixel(std::string(fragSource));
|
|
||||||
|
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("colorMap"), DEFERRED_BUFFER_COLOR_UNIT));
|
slotBindings.insert(gpu::Shader::Binding(std::string("colorMap"), DEFERRED_BUFFER_COLOR_UNIT));
|
||||||
slotBindings.insert(gpu::Shader::Binding(std::string("normalMap"), DEFERRED_BUFFER_NORMAL_UNIT));
|
slotBindings.insert(gpu::Shader::Binding(std::string("normalMap"), DEFERRED_BUFFER_NORMAL_UNIT));
|
||||||
|
@ -224,9 +220,9 @@ static gpu::ShaderPointer makeLightProgram(const char* vertSource, const char* f
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadLightProgram(const char* vertSource, const char* fragSource, bool lightVolume, gpu::PipelinePointer& pipeline, LightLocationsPtr& locations) {
|
static void loadLightProgram(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, bool lightVolume, gpu::PipelinePointer& pipeline, LightLocationsPtr& locations) {
|
||||||
|
|
||||||
gpu::ShaderPointer program = makeLightProgram(vertSource, fragSource, locations);
|
gpu::ShaderPointer program = makeLightProgram(vertShader, fragShader, locations);
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
state->setColorWriteMask(true, true, true, false);
|
state->setColorWriteMask(true, true, true, false);
|
||||||
|
|
|
@ -133,7 +133,7 @@ void DrawHaze::run(const render::RenderContextPointer& renderContext, const Inpu
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
|
|
||||||
if (!_hazePipeline) {
|
if (!_hazePipeline) {
|
||||||
gpu::ShaderPointer ps = gpu::Shader::createPixel(std::string(Haze_frag));
|
gpu::ShaderPointer ps = Haze_frag::getShader();
|
||||||
gpu::ShaderPointer vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
gpu::ShaderPointer vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
|
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
|
@ -1946,8 +1946,8 @@ void GeometryCache::renderGlowLine(gpu::Batch& batch, const glm::vec3& p1, const
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&] {
|
std::call_once(once, [&] {
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
auto VS = gpu::Shader::createVertex(std::string(glowLine_vert));
|
auto VS = glowLine_vert::getShader();
|
||||||
auto PS = gpu::Shader::createPixel(std::string(glowLine_frag));
|
auto PS = glowLine_frag::getShader();
|
||||||
auto program = gpu::Shader::createProgram(VS, PS);
|
auto program = gpu::Shader::createProgram(VS, PS);
|
||||||
state->setCullMode(gpu::State::CULL_NONE);
|
state->setCullMode(gpu::State::CULL_NONE);
|
||||||
state->setDepthTest(true, false, gpu::LESS_EQUAL);
|
state->setDepthTest(true, false, gpu::LESS_EQUAL);
|
||||||
|
@ -2003,8 +2003,8 @@ void GeometryCache::renderGlowLine(gpu::Batch& batch, const glm::vec3& p1, const
|
||||||
void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
|
void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&]() {
|
std::call_once(once, [&]() {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(standardTransformPNTC_vert));
|
auto vs = standardTransformPNTC_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(standardDrawTexture_frag));
|
auto ps = standardDrawTexture_frag::getShader();
|
||||||
auto program = gpu::Shader::createProgram(vs, ps);
|
auto program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
@ -2039,8 +2039,8 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
|
||||||
|
|
||||||
void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bool isLayered) {
|
void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bool isLayered) {
|
||||||
if (!_gridPipeline) {
|
if (!_gridPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(standardTransformPNTC_vert));
|
auto vs = standardTransformPNTC_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(grid_frag));
|
auto ps = grid_frag::getShader();
|
||||||
auto program = gpu::Shader::createProgram(vs, ps);
|
auto program = gpu::Shader::createProgram(vs, ps);
|
||||||
gpu::Shader::makeProgram((*program));
|
gpu::Shader::makeProgram((*program));
|
||||||
_gridSlot = program->getUniformBuffers().findLocation("gridBuffer");
|
_gridSlot = program->getUniformBuffers().findLocation("gridBuffer");
|
||||||
|
@ -2123,12 +2123,9 @@ inline bool operator==(const SimpleProgramKey& a, const SimpleProgramKey& b) {
|
||||||
return a.getRaw() == b.getRaw();
|
return a.getRaw() == b.getRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void buildWebShader(const std::string& vertShaderText, const std::string& fragShaderText, bool blendEnable,
|
static void buildWebShader(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, bool blendEnable,
|
||||||
gpu::ShaderPointer& shaderPointerOut, gpu::PipelinePointer& pipelinePointerOut) {
|
gpu::ShaderPointer& shaderPointerOut, gpu::PipelinePointer& pipelinePointerOut) {
|
||||||
auto VS = gpu::Shader::createVertex(vertShaderText);
|
shaderPointerOut = gpu::Shader::createProgram(vertShader, fragShader);
|
||||||
auto PS = gpu::Shader::createPixel(fragShaderText);
|
|
||||||
|
|
||||||
shaderPointerOut = gpu::Shader::createProgram(VS, PS);
|
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
gpu::Shader::makeProgram(*shaderPointerOut, slotBindings);
|
gpu::Shader::makeProgram(*shaderPointerOut, slotBindings);
|
||||||
|
@ -2151,8 +2148,8 @@ void GeometryCache::bindWebBrowserProgram(gpu::Batch& batch, bool transparent) {
|
||||||
gpu::PipelinePointer GeometryCache::getWebBrowserProgram(bool transparent) {
|
gpu::PipelinePointer GeometryCache::getWebBrowserProgram(bool transparent) {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&]() {
|
std::call_once(once, [&]() {
|
||||||
buildWebShader(simple_vert, simple_opaque_web_browser_frag, false, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipelineNoAA);
|
buildWebShader(simple_vert::getShader(), simple_opaque_web_browser_frag::getShader(), false, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipelineNoAA);
|
||||||
buildWebShader(simple_vert, simple_transparent_web_browser_frag, true, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipelineNoAA);
|
buildWebShader(simple_vert::getShader(), simple_transparent_web_browser_frag::getShader(), true, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipelineNoAA);
|
||||||
});
|
});
|
||||||
|
|
||||||
return transparent ? _simpleTransparentWebBrowserPipelineNoAA : _simpleOpaqueWebBrowserPipelineNoAA;
|
return transparent ? _simpleTransparentWebBrowserPipelineNoAA : _simpleOpaqueWebBrowserPipelineNoAA;
|
||||||
|
@ -2181,9 +2178,9 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp
|
||||||
if (!fading) {
|
if (!fading) {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&]() {
|
std::call_once(once, [&]() {
|
||||||
auto VS = gpu::Shader::createVertex(std::string(simple_vert));
|
auto VS = simple_vert::getShader();
|
||||||
auto PS = gpu::Shader::createPixel(std::string(simple_textured_frag));
|
auto PS = simple_textured_frag::getShader();
|
||||||
auto PSUnlit = gpu::Shader::createPixel(std::string(simple_textured_unlit_frag));
|
auto PSUnlit = simple_textured_unlit_frag::getShader();
|
||||||
|
|
||||||
_simpleShader = gpu::Shader::createProgram(VS, PS);
|
_simpleShader = gpu::Shader::createProgram(VS, PS);
|
||||||
_unlitShader = gpu::Shader::createProgram(VS, PSUnlit);
|
_unlitShader = gpu::Shader::createProgram(VS, PSUnlit);
|
||||||
|
@ -2196,9 +2193,9 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp
|
||||||
} else {
|
} else {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&]() {
|
std::call_once(once, [&]() {
|
||||||
auto VS = gpu::Shader::createVertex(std::string(simple_fade_vert));
|
auto VS = simple_fade_vert::getShader();
|
||||||
auto PS = gpu::Shader::createPixel(std::string(simple_textured_fade_frag));
|
auto PS = simple_textured_fade_frag::getShader();
|
||||||
auto PSUnlit = gpu::Shader::createPixel(std::string(simple_textured_unlit_fade_frag));
|
auto PSUnlit = simple_textured_unlit_fade_frag::getShader();
|
||||||
|
|
||||||
_simpleFadeShader = gpu::Shader::createProgram(VS, PS);
|
_simpleFadeShader = gpu::Shader::createProgram(VS, PS);
|
||||||
_unlitFadeShader = gpu::Shader::createProgram(VS, PSUnlit);
|
_unlitFadeShader = gpu::Shader::createProgram(VS, PSUnlit);
|
||||||
|
|
|
@ -130,8 +130,8 @@ void DrawHighlightMask::run(const render::RenderContextPointer& renderContext, c
|
||||||
fillState->setColorWriteMask(false, false, false, false);
|
fillState->setColorWriteMask(false, false, false, false);
|
||||||
fillState->setCullMode(gpu::State::CULL_FRONT);
|
fillState->setCullMode(gpu::State::CULL_FRONT);
|
||||||
|
|
||||||
auto vs = gpu::Shader::createVertex(std::string(Highlight_aabox_vert));
|
auto vs = Highlight_aabox_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(nop_frag));
|
auto ps = nop_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -313,7 +313,7 @@ const gpu::PipelinePointer& DrawHighlight::getPipeline(const render::HighlightSt
|
||||||
state->setStencilTest(true, 0, gpu::State::StencilTest(OUTLINE_STENCIL_MASK, 0xFF, gpu::EQUAL));
|
state->setStencilTest(true, 0, gpu::State::StencilTest(OUTLINE_STENCIL_MASK, 0xFF, gpu::EQUAL));
|
||||||
|
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(Highlight_frag));
|
auto ps = Highlight_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -325,7 +325,7 @@ const gpu::PipelinePointer& DrawHighlight::getPipeline(const render::HighlightSt
|
||||||
|
|
||||||
_pipeline = gpu::Pipeline::create(program, state);
|
_pipeline = gpu::Pipeline::create(program, state);
|
||||||
|
|
||||||
ps = gpu::Shader::createPixel(std::string(Highlight_filled_frag));
|
ps = Highlight_filled_frag::getShader();
|
||||||
program = gpu::Shader::createProgram(vs, ps);
|
program = gpu::Shader::createProgram(vs, ps);
|
||||||
gpu::Shader::makeProgram(*program, slotBindings);
|
gpu::Shader::makeProgram(*program, slotBindings);
|
||||||
_pipelineFilled = gpu::Pipeline::create(program, state);
|
_pipelineFilled = gpu::Pipeline::create(program, state);
|
||||||
|
@ -385,8 +385,7 @@ void DebugHighlight::run(const render::RenderContextPointer& renderContext, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugHighlight::initializePipelines() {
|
void DebugHighlight::initializePipelines() {
|
||||||
static const std::string VERTEX_SHADER{ debug_deferred_buffer_vert };
|
static const std::string FRAGMENT_SHADER{ debug_deferred_buffer_frag::getSource() };
|
||||||
static const std::string FRAGMENT_SHADER{ debug_deferred_buffer_frag };
|
|
||||||
static const std::string SOURCE_PLACEHOLDER{ "//SOURCE_PLACEHOLDER" };
|
static const std::string SOURCE_PLACEHOLDER{ "//SOURCE_PLACEHOLDER" };
|
||||||
static const auto SOURCE_PLACEHOLDER_INDEX = FRAGMENT_SHADER.find(SOURCE_PLACEHOLDER);
|
static const auto SOURCE_PLACEHOLDER_INDEX = FRAGMENT_SHADER.find(SOURCE_PLACEHOLDER);
|
||||||
Q_ASSERT_X(SOURCE_PLACEHOLDER_INDEX != std::string::npos, Q_FUNC_INFO,
|
Q_ASSERT_X(SOURCE_PLACEHOLDER_INDEX != std::string::npos, Q_FUNC_INFO,
|
||||||
|
@ -396,7 +395,7 @@ void DebugHighlight::initializePipelines() {
|
||||||
state->setDepthTest(gpu::State::DepthTest(false, false));
|
state->setDepthTest(gpu::State::DepthTest(false, false));
|
||||||
state->setStencilTest(true, 0, gpu::State::StencilTest(OUTLINE_STENCIL_MASK, 0xFF, gpu::EQUAL));
|
state->setStencilTest(true, 0, gpu::State::StencilTest(OUTLINE_STENCIL_MASK, 0xFF, gpu::EQUAL));
|
||||||
|
|
||||||
const auto vs = gpu::Shader::createVertex(VERTEX_SHADER);
|
const auto vs = debug_deferred_buffer_vert::getShader();
|
||||||
|
|
||||||
// Depth shader
|
// Depth shader
|
||||||
{
|
{
|
||||||
|
@ -553,14 +552,14 @@ const render::Varying DrawHighlightTask::addSelectItemJobs(JobModel& task, const
|
||||||
#include "model_shadow_frag.h"
|
#include "model_shadow_frag.h"
|
||||||
|
|
||||||
void DrawHighlightTask::initMaskPipelines(render::ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
void DrawHighlightTask::initMaskPipelines(render::ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
||||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
auto modelVertex = model_shadow_vert::getShader();
|
||||||
auto modelPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
auto modelPixel = model_shadow_frag::getShader();
|
||||||
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(modelVertex, modelPixel);
|
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(modelVertex, modelPixel);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withoutSkinned(),
|
ShapeKey::Filter::Builder().withoutSkinned(),
|
||||||
modelProgram, state);
|
modelProgram, state);
|
||||||
|
|
||||||
auto skinVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_vert));
|
auto skinVertex = skin_model_shadow_vert::getShader();
|
||||||
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(skinVertex, modelPixel);
|
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(skinVertex, modelPixel);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned(),
|
ShapeKey::Filter::Builder().withSkinned(),
|
||||||
|
|
|
@ -605,8 +605,8 @@ void DebugLightClusters::configure(const Config& config) {
|
||||||
|
|
||||||
const gpu::PipelinePointer DebugLightClusters::getDrawClusterGridPipeline() {
|
const gpu::PipelinePointer DebugLightClusters::getDrawClusterGridPipeline() {
|
||||||
if (!_drawClusterGrid) {
|
if (!_drawClusterGrid) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawGrid_vert));
|
auto vs = lightClusters_drawGrid_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(lightClusters_drawGrid_frag));
|
auto ps = lightClusters_drawGrid_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -635,7 +635,7 @@ const gpu::PipelinePointer DebugLightClusters::getDrawClusterFromDepthPipeline()
|
||||||
if (!_drawClusterFromDepth) {
|
if (!_drawClusterFromDepth) {
|
||||||
// auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawGrid_vert));
|
// auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawGrid_vert));
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(lightClusters_drawClusterFromDepth_frag));
|
auto ps = lightClusters_drawClusterFromDepth_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -665,7 +665,7 @@ const gpu::PipelinePointer DebugLightClusters::getDrawClusterContentPipeline() {
|
||||||
if (!_drawClusterContent) {
|
if (!_drawClusterContent) {
|
||||||
// auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawClusterContent_vert));
|
// auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawClusterContent_vert));
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(lightClusters_drawClusterContent_frag));
|
auto ps = lightClusters_drawClusterContent_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -121,16 +121,16 @@ void batchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* a
|
||||||
void lightBatchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* args);
|
void lightBatchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* args);
|
||||||
|
|
||||||
void initOverlay3DPipelines(ShapePlumber& plumber, bool depthTest) {
|
void initOverlay3DPipelines(ShapePlumber& plumber, bool depthTest) {
|
||||||
auto vertex = gpu::Shader::createVertex(std::string(overlay3D_vert));
|
auto vertex = overlay3D_vert::getShader();
|
||||||
auto vertexModel = gpu::Shader::createVertex(std::string(model_vert));
|
auto vertexModel = model_vert::getShader();
|
||||||
auto pixel = gpu::Shader::createPixel(std::string(overlay3D_frag));
|
auto pixel = overlay3D_frag::getShader();
|
||||||
auto pixelTranslucent = gpu::Shader::createPixel(std::string(overlay3D_translucent_frag));
|
auto pixelTranslucent = overlay3D_translucent_frag::getShader();
|
||||||
auto pixelUnlit = gpu::Shader::createPixel(std::string(overlay3D_unlit_frag));
|
auto pixelUnlit = overlay3D_unlit_frag::getShader();
|
||||||
auto pixelTranslucentUnlit = gpu::Shader::createPixel(std::string(overlay3D_translucent_unlit_frag));
|
auto pixelTranslucentUnlit = overlay3D_translucent_unlit_frag::getShader();
|
||||||
auto pixelModel = gpu::Shader::createPixel(std::string(overlay3D_model_frag));
|
auto pixelModel = overlay3D_model_frag::getShader();
|
||||||
auto pixelModelTranslucent = gpu::Shader::createPixel(std::string(overlay3D_model_translucent_frag));
|
auto pixelModelTranslucent = overlay3D_model_translucent_frag::getShader();
|
||||||
auto pixelModelUnlit = gpu::Shader::createPixel(std::string(overlay3D_model_unlit_frag));
|
auto pixelModelUnlit = overlay3D_model_unlit_frag::getShader();
|
||||||
auto pixelModelTranslucentUnlit = gpu::Shader::createPixel(std::string(overlay3D_model_translucent_unlit_frag));
|
auto pixelModelTranslucentUnlit = overlay3D_model_translucent_unlit_frag::getShader();
|
||||||
|
|
||||||
auto opaqueProgram = gpu::Shader::createProgram(vertex, pixel);
|
auto opaqueProgram = gpu::Shader::createProgram(vertex, pixel);
|
||||||
auto translucentProgram = gpu::Shader::createProgram(vertex, pixelTranslucent);
|
auto translucentProgram = gpu::Shader::createProgram(vertex, pixelTranslucent);
|
||||||
|
@ -187,66 +187,66 @@ void initOverlay3DPipelines(ShapePlumber& plumber, bool depthTest) {
|
||||||
|
|
||||||
void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePipeline::BatchSetter& batchSetter, const render::ShapePipeline::ItemSetter& itemSetter) {
|
void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePipeline::BatchSetter& batchSetter, const render::ShapePipeline::ItemSetter& itemSetter) {
|
||||||
// Vertex shaders
|
// Vertex shaders
|
||||||
auto simpleVertex = gpu::Shader::createVertex(std::string(simple_vert));
|
auto simpleVertex = simple_vert::getShader();
|
||||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_vert));
|
auto modelVertex = model_vert::getShader();
|
||||||
auto modelNormalMapVertex = gpu::Shader::createVertex(std::string(model_normal_map_vert));
|
auto modelNormalMapVertex = model_normal_map_vert::getShader();
|
||||||
auto modelLightmapVertex = gpu::Shader::createVertex(std::string(model_lightmap_vert));
|
auto modelLightmapVertex = model_lightmap_vert::getShader();
|
||||||
auto modelLightmapNormalMapVertex = gpu::Shader::createVertex(std::string(model_lightmap_normal_map_vert));
|
auto modelLightmapNormalMapVertex = model_lightmap_normal_map_vert::getShader();
|
||||||
auto modelTranslucentVertex = gpu::Shader::createVertex(std::string(model_translucent_vert));
|
auto modelTranslucentVertex = model_translucent_vert::getShader();
|
||||||
auto modelTranslucentNormalMapVertex = gpu::Shader::createVertex(std::string(model_translucent_normal_map_vert));
|
auto modelTranslucentNormalMapVertex = model_translucent_normal_map_vert::getShader();
|
||||||
auto modelShadowVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
auto modelShadowVertex = model_shadow_vert::getShader();
|
||||||
auto skinModelVertex = gpu::Shader::createVertex(std::string(skin_model_vert));
|
auto skinModelVertex = skin_model_vert::getShader();
|
||||||
auto skinModelNormalMapVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_vert));
|
auto skinModelNormalMapVertex = skin_model_normal_map_vert::getShader();
|
||||||
auto skinModelShadowVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_vert));
|
auto skinModelShadowVertex = skin_model_shadow_vert::getShader();
|
||||||
auto modelLightmapFadeVertex = gpu::Shader::createVertex(std::string(model_lightmap_fade_vert));
|
auto modelLightmapFadeVertex = model_lightmap_fade_vert::getShader();
|
||||||
auto modelLightmapNormalMapFadeVertex = gpu::Shader::createVertex(std::string(model_lightmap_normal_map_fade_vert));
|
auto modelLightmapNormalMapFadeVertex = model_lightmap_normal_map_fade_vert::getShader();
|
||||||
auto skinModelFadeVertex = gpu::Shader::createVertex(std::string(skin_model_fade_vert));
|
auto skinModelFadeVertex = skin_model_fade_vert::getShader();
|
||||||
auto skinModelNormalMapFadeVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_fade_vert));
|
auto skinModelNormalMapFadeVertex = skin_model_normal_map_fade_vert::getShader();
|
||||||
auto skinModelTranslucentVertex = skinModelFadeVertex; // We use the same because it ouputs world position per vertex
|
auto skinModelTranslucentVertex = skinModelFadeVertex; // We use the same because it ouputs world position per vertex
|
||||||
auto skinModelNormalMapTranslucentVertex = skinModelNormalMapFadeVertex; // We use the same because it ouputs world position per vertex
|
auto skinModelNormalMapTranslucentVertex = skinModelNormalMapFadeVertex; // We use the same because it ouputs world position per vertex
|
||||||
|
|
||||||
auto modelFadeVertex = gpu::Shader::createVertex(std::string(model_fade_vert));
|
auto modelFadeVertex = model_fade_vert::getShader();
|
||||||
auto modelNormalMapFadeVertex = gpu::Shader::createVertex(std::string(model_normal_map_fade_vert));
|
auto modelNormalMapFadeVertex = model_normal_map_fade_vert::getShader();
|
||||||
auto simpleFadeVertex = gpu::Shader::createVertex(std::string(simple_fade_vert));
|
auto simpleFadeVertex = simple_fade_vert::getShader();
|
||||||
auto modelShadowFadeVertex = gpu::Shader::createVertex(std::string(model_shadow_fade_vert));
|
auto modelShadowFadeVertex = model_shadow_fade_vert::getShader();
|
||||||
auto skinModelShadowFadeVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_fade_vert));
|
auto skinModelShadowFadeVertex = skin_model_shadow_fade_vert::getShader();
|
||||||
|
|
||||||
// Pixel shaders
|
// Pixel shaders
|
||||||
auto simplePixel = gpu::Shader::createPixel(std::string(simple_textured_frag));
|
auto simplePixel = simple_textured_frag::getShader();
|
||||||
auto simpleUnlitPixel = gpu::Shader::createPixel(std::string(simple_textured_unlit_frag));
|
auto simpleUnlitPixel = simple_textured_unlit_frag::getShader();
|
||||||
auto simpleTranslucentPixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_frag));
|
auto simpleTranslucentPixel = simple_transparent_textured_frag::getShader();
|
||||||
auto simpleTranslucentUnlitPixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_unlit_frag));
|
auto simpleTranslucentUnlitPixel = simple_transparent_textured_unlit_frag::getShader();
|
||||||
auto modelPixel = gpu::Shader::createPixel(std::string(model_frag));
|
auto modelPixel = model_frag::getShader();
|
||||||
auto modelUnlitPixel = gpu::Shader::createPixel(std::string(model_unlit_frag));
|
auto modelUnlitPixel = model_unlit_frag::getShader();
|
||||||
auto modelNormalMapPixel = gpu::Shader::createPixel(std::string(model_normal_map_frag));
|
auto modelNormalMapPixel = model_normal_map_frag::getShader();
|
||||||
auto modelSpecularMapPixel = gpu::Shader::createPixel(std::string(model_specular_map_frag));
|
auto modelSpecularMapPixel = model_specular_map_frag::getShader();
|
||||||
auto modelNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(model_normal_specular_map_frag));
|
auto modelNormalSpecularMapPixel = model_normal_specular_map_frag::getShader();
|
||||||
auto modelTranslucentPixel = gpu::Shader::createPixel(std::string(model_translucent_frag));
|
auto modelTranslucentPixel = model_translucent_frag::getShader();
|
||||||
auto modelTranslucentNormalMapPixel = gpu::Shader::createPixel(std::string(model_translucent_normal_map_frag));
|
auto modelTranslucentNormalMapPixel = model_translucent_normal_map_frag::getShader();
|
||||||
auto modelTranslucentUnlitPixel = gpu::Shader::createPixel(std::string(model_translucent_unlit_frag));
|
auto modelTranslucentUnlitPixel = model_translucent_unlit_frag::getShader();
|
||||||
auto modelShadowPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
auto modelShadowPixel = model_shadow_frag::getShader();
|
||||||
auto modelLightmapPixel = gpu::Shader::createPixel(std::string(model_lightmap_frag));
|
auto modelLightmapPixel = model_lightmap_frag::getShader();
|
||||||
auto modelLightmapNormalMapPixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_map_frag));
|
auto modelLightmapNormalMapPixel = model_lightmap_normal_map_frag::getShader();
|
||||||
auto modelLightmapSpecularMapPixel = gpu::Shader::createPixel(std::string(model_lightmap_specular_map_frag));
|
auto modelLightmapSpecularMapPixel = model_lightmap_specular_map_frag::getShader();
|
||||||
auto modelLightmapNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_specular_map_frag));
|
auto modelLightmapNormalSpecularMapPixel = model_lightmap_normal_specular_map_frag::getShader();
|
||||||
auto modelLightmapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_fade_frag));
|
auto modelLightmapFadePixel = model_lightmap_fade_frag::getShader();
|
||||||
auto modelLightmapNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_map_fade_frag));
|
auto modelLightmapNormalMapFadePixel = model_lightmap_normal_map_fade_frag::getShader();
|
||||||
auto modelLightmapSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_specular_map_fade_frag));
|
auto modelLightmapSpecularMapFadePixel = model_lightmap_specular_map_fade_frag::getShader();
|
||||||
auto modelLightmapNormalSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_specular_map_fade_frag));
|
auto modelLightmapNormalSpecularMapFadePixel = model_lightmap_normal_specular_map_fade_frag::getShader();
|
||||||
|
|
||||||
auto modelFadePixel = gpu::Shader::createPixel(std::string(model_fade_frag));
|
auto modelFadePixel = model_fade_frag::getShader();
|
||||||
auto modelUnlitFadePixel = gpu::Shader::createPixel(std::string(model_unlit_fade_frag));
|
auto modelUnlitFadePixel = model_unlit_fade_frag::getShader();
|
||||||
auto modelNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_normal_map_fade_frag));
|
auto modelNormalMapFadePixel = model_normal_map_fade_frag::getShader();
|
||||||
auto modelSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_specular_map_fade_frag));
|
auto modelSpecularMapFadePixel = model_specular_map_fade_frag::getShader();
|
||||||
auto modelNormalSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_normal_specular_map_fade_frag));
|
auto modelNormalSpecularMapFadePixel = model_normal_specular_map_fade_frag::getShader();
|
||||||
auto modelShadowFadePixel = gpu::Shader::createPixel(std::string(model_shadow_fade_frag));
|
auto modelShadowFadePixel = model_shadow_fade_frag::getShader();
|
||||||
auto modelTranslucentFadePixel = gpu::Shader::createPixel(std::string(model_translucent_fade_frag));
|
auto modelTranslucentFadePixel = model_translucent_fade_frag::getShader();
|
||||||
auto modelTranslucentNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_translucent_normal_map_fade_frag));
|
auto modelTranslucentNormalMapFadePixel = model_translucent_normal_map_fade_frag::getShader();
|
||||||
auto modelTranslucentUnlitFadePixel = gpu::Shader::createPixel(std::string(model_translucent_unlit_fade_frag));
|
auto modelTranslucentUnlitFadePixel = model_translucent_unlit_fade_frag::getShader();
|
||||||
auto simpleFadePixel = gpu::Shader::createPixel(std::string(simple_textured_fade_frag));
|
auto simpleFadePixel = simple_textured_fade_frag::getShader();
|
||||||
auto simpleUnlitFadePixel = gpu::Shader::createPixel(std::string(simple_textured_unlit_fade_frag));
|
auto simpleUnlitFadePixel = simple_textured_unlit_fade_frag::getShader();
|
||||||
auto simpleTranslucentFadePixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_fade_frag));
|
auto simpleTranslucentFadePixel = simple_transparent_textured_fade_frag::getShader();
|
||||||
auto simpleTranslucentUnlitFadePixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_unlit_fade_frag));
|
auto simpleTranslucentUnlitFadePixel = simple_transparent_textured_unlit_fade_frag::getShader();
|
||||||
|
|
||||||
using Key = render::ShapeKey;
|
using Key = render::ShapeKey;
|
||||||
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3, _4, _5);
|
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3, _4, _5);
|
||||||
|
@ -448,19 +448,19 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
||||||
|
|
||||||
void initForwardPipelines(ShapePlumber& plumber, const render::ShapePipeline::BatchSetter& batchSetter, const render::ShapePipeline::ItemSetter& itemSetter) {
|
void initForwardPipelines(ShapePlumber& plumber, const render::ShapePipeline::BatchSetter& batchSetter, const render::ShapePipeline::ItemSetter& itemSetter) {
|
||||||
// Vertex shaders
|
// Vertex shaders
|
||||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_vert));
|
auto modelVertex = model_vert::getShader();
|
||||||
auto modelNormalMapVertex = gpu::Shader::createVertex(std::string(model_normal_map_vert));
|
auto modelNormalMapVertex = model_normal_map_vert::getShader();
|
||||||
auto skinModelVertex = gpu::Shader::createVertex(std::string(skin_model_vert));
|
auto skinModelVertex = skin_model_vert::getShader();
|
||||||
auto skinModelNormalMapVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_vert));
|
auto skinModelNormalMapVertex = skin_model_normal_map_vert::getShader();
|
||||||
auto skinModelNormalMapFadeVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_fade_vert));
|
auto skinModelNormalMapFadeVertex = skin_model_normal_map_fade_vert::getShader();
|
||||||
|
|
||||||
// Pixel shaders
|
// Pixel shaders
|
||||||
auto modelPixel = gpu::Shader::createPixel(std::string(forward_model_frag));
|
auto modelPixel = forward_model_frag::getShader();
|
||||||
auto modelUnlitPixel = gpu::Shader::createPixel(std::string(forward_model_unlit_frag));
|
auto modelUnlitPixel = forward_model_unlit_frag::getShader();
|
||||||
auto modelNormalMapPixel = gpu::Shader::createPixel(std::string(forward_model_normal_map_frag));
|
auto modelNormalMapPixel = forward_model_normal_map_frag::getShader();
|
||||||
auto modelSpecularMapPixel = gpu::Shader::createPixel(std::string(forward_model_specular_map_frag));
|
auto modelSpecularMapPixel = forward_model_specular_map_frag::getShader();
|
||||||
auto modelNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(forward_model_normal_specular_map_frag));
|
auto modelNormalSpecularMapPixel = forward_model_normal_specular_map_frag::getShader();
|
||||||
auto modelNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_normal_map_fade_frag));
|
auto modelNormalMapFadePixel = model_normal_map_fade_frag::getShader();
|
||||||
|
|
||||||
using Key = render::ShapeKey;
|
using Key = render::ShapeKey;
|
||||||
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3, _4, _5);
|
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3, _4, _5);
|
||||||
|
@ -590,29 +590,29 @@ void lightBatchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderAr
|
||||||
}
|
}
|
||||||
|
|
||||||
void initZPassPipelines(ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
void initZPassPipelines(ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
||||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
auto modelVertex = model_shadow_vert::getShader();
|
||||||
auto modelPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
auto modelPixel = model_shadow_frag::getShader();
|
||||||
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(modelVertex, modelPixel);
|
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(modelVertex, modelPixel);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withoutSkinned().withoutFade(),
|
ShapeKey::Filter::Builder().withoutSkinned().withoutFade(),
|
||||||
modelProgram, state);
|
modelProgram, state);
|
||||||
|
|
||||||
auto skinVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_vert));
|
auto skinVertex = skin_model_shadow_vert::getShader();
|
||||||
auto skinPixel = gpu::Shader::createPixel(std::string(skin_model_shadow_frag));
|
auto skinPixel = skin_model_shadow_frag::getShader();
|
||||||
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(skinVertex, skinPixel);
|
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(skinVertex, skinPixel);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned().withoutFade(),
|
ShapeKey::Filter::Builder().withSkinned().withoutFade(),
|
||||||
skinProgram, state);
|
skinProgram, state);
|
||||||
|
|
||||||
auto modelFadeVertex = gpu::Shader::createVertex(std::string(model_shadow_fade_vert));
|
auto modelFadeVertex = model_shadow_fade_vert::getShader();
|
||||||
auto modelFadePixel = gpu::Shader::createPixel(std::string(model_shadow_fade_frag));
|
auto modelFadePixel = model_shadow_fade_frag::getShader();
|
||||||
gpu::ShaderPointer modelFadeProgram = gpu::Shader::createProgram(modelFadeVertex, modelFadePixel);
|
gpu::ShaderPointer modelFadeProgram = gpu::Shader::createProgram(modelFadeVertex, modelFadePixel);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withoutSkinned().withFade(),
|
ShapeKey::Filter::Builder().withoutSkinned().withFade(),
|
||||||
modelFadeProgram, state);
|
modelFadeProgram, state);
|
||||||
|
|
||||||
auto skinFadeVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_fade_vert));
|
auto skinFadeVertex = skin_model_shadow_fade_vert::getShader();
|
||||||
auto skinFadePixel = gpu::Shader::createPixel(std::string(skin_model_shadow_fade_frag));
|
auto skinFadePixel = skin_model_shadow_fade_frag::getShader();
|
||||||
gpu::ShaderPointer skinFadeProgram = gpu::Shader::createProgram(skinFadeVertex, skinFadePixel);
|
gpu::ShaderPointer skinFadeProgram = gpu::Shader::createProgram(skinFadeVertex, skinFadePixel);
|
||||||
shapePlumber.addPipeline(
|
shapePlumber.addPipeline(
|
||||||
ShapeKey::Filter::Builder().withSkinned().withFade(),
|
ShapeKey::Filter::Builder().withSkinned().withFade(),
|
||||||
|
|
|
@ -60,7 +60,7 @@ gpu::PipelinePointer PrepareStencil::getMeshStencilPipeline() {
|
||||||
gpu::PipelinePointer PrepareStencil::getPaintStencilPipeline() {
|
gpu::PipelinePointer PrepareStencil::getPaintStencilPipeline() {
|
||||||
if (!_paintStencilPipeline) {
|
if (!_paintStencilPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(stencil_drawMask_frag));
|
auto ps = stencil_drawMask_frag::getShader();
|
||||||
auto program = gpu::Shader::createProgram(vs, ps);
|
auto program = gpu::Shader::createProgram(vs, ps);
|
||||||
gpu::Shader::makeProgram((*program));
|
gpu::Shader::makeProgram((*program));
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@ void diffuseProfileGPU(gpu::TexturePointer& profileMap, RenderArgs* args) {
|
||||||
gpu::PipelinePointer makePipeline;
|
gpu::PipelinePointer makePipeline;
|
||||||
{
|
{
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_makeProfile_frag));
|
auto ps = subsurfaceScattering_makeProfile_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -344,7 +344,7 @@ void diffuseScatterGPU(const gpu::TexturePointer& profileMap, gpu::TexturePointe
|
||||||
gpu::PipelinePointer makePipeline;
|
gpu::PipelinePointer makePipeline;
|
||||||
{
|
{
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_makeLUT_frag));
|
auto ps = subsurfaceScattering_makeLUT_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -382,7 +382,7 @@ void computeSpecularBeckmannGPU(gpu::TexturePointer& beckmannMap, RenderArgs* ar
|
||||||
gpu::PipelinePointer makePipeline;
|
gpu::PipelinePointer makePipeline;
|
||||||
{
|
{
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_makeSpecularBeckmann_frag));
|
auto ps = subsurfaceScattering_makeSpecularBeckmann_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -457,7 +457,7 @@ void DebugSubsurfaceScattering::configure(const Config& config) {
|
||||||
gpu::PipelinePointer DebugSubsurfaceScattering::getScatteringPipeline() {
|
gpu::PipelinePointer DebugSubsurfaceScattering::getScatteringPipeline() {
|
||||||
if (!_scatteringPipeline) {
|
if (!_scatteringPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_drawScattering_frag));
|
auto ps = subsurfaceScattering_drawScattering_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -212,7 +212,7 @@ void LinearDepthPass::run(const render::RenderContextPointer& renderContext, con
|
||||||
const gpu::PipelinePointer& LinearDepthPass::getLinearDepthPipeline() {
|
const gpu::PipelinePointer& LinearDepthPass::getLinearDepthPipeline() {
|
||||||
if (!_linearDepthPipeline) {
|
if (!_linearDepthPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(surfaceGeometry_makeLinearDepth_frag));
|
auto ps = surfaceGeometry_makeLinearDepth_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -239,7 +239,7 @@ const gpu::PipelinePointer& LinearDepthPass::getLinearDepthPipeline() {
|
||||||
const gpu::PipelinePointer& LinearDepthPass::getDownsamplePipeline() {
|
const gpu::PipelinePointer& LinearDepthPass::getDownsamplePipeline() {
|
||||||
if (!_downsamplePipeline) {
|
if (!_downsamplePipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(surfaceGeometry_downsampleDepthNormal_frag));
|
auto ps = surfaceGeometry_downsampleDepthNormal_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -540,7 +540,7 @@ void SurfaceGeometryPass::run(const render::RenderContextPointer& renderContext,
|
||||||
const gpu::PipelinePointer& SurfaceGeometryPass::getCurvaturePipeline() {
|
const gpu::PipelinePointer& SurfaceGeometryPass::getCurvaturePipeline() {
|
||||||
if (!_curvaturePipeline) {
|
if (!_curvaturePipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(surfaceGeometry_makeCurvature_frag));
|
auto ps = surfaceGeometry_makeCurvature_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -28,7 +28,7 @@ ToneMappingEffect::ToneMappingEffect() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToneMappingEffect::init() {
|
void ToneMappingEffect::init() {
|
||||||
auto blitPS = gpu::ShaderPointer(gpu::Shader::createPixel(std::string(toneMapping_frag)));
|
auto blitPS = toneMapping_frag::getShader();
|
||||||
|
|
||||||
auto blitVS = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
auto blitVS = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||||
auto blitProgram = gpu::ShaderPointer(gpu::Shader::createProgram(blitVS, blitPS));
|
auto blitProgram = gpu::ShaderPointer(gpu::Shader::createProgram(blitVS, blitPS));
|
||||||
|
|
|
@ -78,7 +78,7 @@ void SetupZones::run(const RenderContextPointer& context, const Inputs& inputs)
|
||||||
const gpu::PipelinePointer& DebugZoneLighting::getKeyLightPipeline() {
|
const gpu::PipelinePointer& DebugZoneLighting::getKeyLightPipeline() {
|
||||||
if (!_keyLightPipeline) {
|
if (!_keyLightPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(zone_drawKeyLight_frag));
|
auto ps = zone_drawKeyLight_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -99,7 +99,7 @@ const gpu::PipelinePointer& DebugZoneLighting::getKeyLightPipeline() {
|
||||||
const gpu::PipelinePointer& DebugZoneLighting::getAmbientPipeline() {
|
const gpu::PipelinePointer& DebugZoneLighting::getAmbientPipeline() {
|
||||||
if (!_ambientPipeline) {
|
if (!_ambientPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(zone_drawAmbient_frag));
|
auto ps = zone_drawAmbient_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -120,7 +120,7 @@ const gpu::PipelinePointer& DebugZoneLighting::getAmbientPipeline() {
|
||||||
const gpu::PipelinePointer& DebugZoneLighting::getBackgroundPipeline() {
|
const gpu::PipelinePointer& DebugZoneLighting::getBackgroundPipeline() {
|
||||||
if (!_backgroundPipeline) {
|
if (!_backgroundPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(zone_drawSkybox_frag));
|
auto ps = zone_drawSkybox_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -223,9 +223,9 @@ void Font::setupGPU() {
|
||||||
|
|
||||||
// Setup render pipeline
|
// Setup render pipeline
|
||||||
{
|
{
|
||||||
auto vertexShader = gpu::Shader::createVertex(std::string(sdf_text3D_vert));
|
auto vertexShader = sdf_text3D_vert::getShader();
|
||||||
auto pixelShader = gpu::Shader::createPixel(std::string(sdf_text3D_frag));
|
auto pixelShader = sdf_text3D_frag::getShader();
|
||||||
auto pixelShaderTransparent = gpu::Shader::createPixel(std::string(sdf_text3D_transparent_frag));
|
auto pixelShaderTransparent = sdf_text3D_transparent_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader);
|
||||||
gpu::ShaderPointer programTransparent = gpu::Shader::createProgram(vertexShader, pixelShaderTransparent);
|
gpu::ShaderPointer programTransparent = gpu::Shader::createProgram(vertexShader, pixelShaderTransparent);
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ BlurGaussian::BlurGaussian(bool generateOutputFramebuffer, unsigned int downsamp
|
||||||
gpu::PipelinePointer BlurGaussian::getBlurVPipeline() {
|
gpu::PipelinePointer BlurGaussian::getBlurVPipeline() {
|
||||||
if (!_blurVPipeline) {
|
if (!_blurVPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianV_frag));
|
auto ps = blurGaussianV_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -232,7 +232,7 @@ gpu::PipelinePointer BlurGaussian::getBlurVPipeline() {
|
||||||
gpu::PipelinePointer BlurGaussian::getBlurHPipeline() {
|
gpu::PipelinePointer BlurGaussian::getBlurHPipeline() {
|
||||||
if (!_blurHPipeline) {
|
if (!_blurHPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianH_frag));
|
auto ps = blurGaussianH_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -324,7 +324,7 @@ BlurGaussianDepthAware::BlurGaussianDepthAware(bool generateOutputFramebuffer, c
|
||||||
gpu::PipelinePointer BlurGaussianDepthAware::getBlurVPipeline() {
|
gpu::PipelinePointer BlurGaussianDepthAware::getBlurVPipeline() {
|
||||||
if (!_blurVPipeline) {
|
if (!_blurVPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianDepthAwareV_frag));
|
auto ps = blurGaussianDepthAwareV_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -347,7 +347,7 @@ gpu::PipelinePointer BlurGaussianDepthAware::getBlurVPipeline() {
|
||||||
gpu::PipelinePointer BlurGaussianDepthAware::getBlurHPipeline() {
|
gpu::PipelinePointer BlurGaussianDepthAware::getBlurHPipeline() {
|
||||||
if (!_blurHPipeline) {
|
if (!_blurHPipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianDepthAwareH_frag));
|
auto ps = blurGaussianDepthAwareH_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -34,8 +34,8 @@ using namespace render;
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
||||||
if (!_drawCellBoundsPipeline) {
|
if (!_drawCellBoundsPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(drawCellBounds_vert));
|
auto vs = drawCellBounds_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(drawCellBounds_frag));
|
auto ps = drawCellBounds_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -59,7 +59,7 @@ const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
||||||
const gpu::PipelinePointer DrawSceneOctree::getDrawLODReticlePipeline() {
|
const gpu::PipelinePointer DrawSceneOctree::getDrawLODReticlePipeline() {
|
||||||
if (!_drawLODReticlePipeline) {
|
if (!_drawLODReticlePipeline) {
|
||||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(drawLODReticle_frag));
|
auto ps = drawLODReticle_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -162,8 +162,8 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {
|
const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {
|
||||||
if (!_drawItemBoundPipeline) {
|
if (!_drawItemBoundPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(drawItemBounds_vert));
|
auto vs = drawItemBounds_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(drawItemBounds_frag));
|
auto ps = drawItemBounds_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -35,8 +35,8 @@ void DrawStatusConfig::dirtyHelper() {
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
||||||
if (!_drawItemBoundsPipeline) {
|
if (!_drawItemBoundsPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(drawItemBounds_vert));
|
auto vs = drawItemBounds_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(drawItemBounds_frag));
|
auto ps = drawItemBounds_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
@ -63,8 +63,8 @@ const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
||||||
if (!_drawItemStatusPipeline) {
|
if (!_drawItemStatusPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(drawItemStatus_vert));
|
auto vs = drawItemStatus_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(drawItemStatus_frag));
|
auto ps = drawItemStatus_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
#include <gpu/Context.h>
|
#include <gpu/Context.h>
|
||||||
#include <gpu/StandardShaderLib.h>
|
#include <gpu/StandardShaderLib.h>
|
||||||
|
|
||||||
#include <drawItemBounds_vert.h>
|
#include "drawItemBounds_vert.h"
|
||||||
#include <drawItemBounds_frag.h>
|
#include "drawItemBounds_frag.h"
|
||||||
|
|
||||||
using namespace render;
|
using namespace render;
|
||||||
|
|
||||||
|
@ -155,8 +155,8 @@ void DrawLight::run(const RenderContextPointer& renderContext, const ItemBounds&
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawBounds::getPipeline() {
|
const gpu::PipelinePointer DrawBounds::getPipeline() {
|
||||||
if (!_boundsPipeline) {
|
if (!_boundsPipeline) {
|
||||||
auto vs = gpu::Shader::createVertex(std::string(drawItemBounds_vert));
|
auto vs = drawItemBounds_vert::getShader();
|
||||||
auto ps = gpu::Shader::createPixel(std::string(drawItemBounds_frag));
|
auto ps = drawItemBounds_frag::getShader();
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
|
|
|
@ -15,7 +15,6 @@ in vec4 varColor;
|
||||||
in vec2 varTexcoord;
|
in vec2 varTexcoord;
|
||||||
out vec4 outFragColor;
|
out vec4 outFragColor;
|
||||||
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
float var = step(fract(varTexcoord.x * varTexcoord.y * 1.0), 0.5);
|
float var = step(fract(varTexcoord.x * varTexcoord.y * 1.0), 0.5);
|
||||||
|
|
||||||
|
|
|
@ -636,14 +636,9 @@
|
||||||
openLoginWindow();
|
openLoginWindow();
|
||||||
break;
|
break;
|
||||||
case 'disableHmdPreview':
|
case 'disableHmdPreview':
|
||||||
isHmdPreviewDisabled = Menu.isOptionChecked("Disable Preview");
|
break; // do nothing here, handled in marketplaces.js
|
||||||
DesktopPreviewProvider.setPreviewDisabledReason("SECURE_SCREEN");
|
|
||||||
Menu.setIsOptionChecked("Disable Preview", true);
|
|
||||||
break;
|
|
||||||
case 'maybeEnableHmdPreview':
|
case 'maybeEnableHmdPreview':
|
||||||
DesktopPreviewProvider.setPreviewDisabledReason("USER");
|
break; // do nothing here, handled in marketplaces.js
|
||||||
Menu.setIsOptionChecked("Disable Preview", isHmdPreviewDisabled);
|
|
||||||
break;
|
|
||||||
case 'passphraseReset':
|
case 'passphraseReset':
|
||||||
onButtonClicked();
|
onButtonClicked();
|
||||||
onButtonClicked();
|
onButtonClicked();
|
||||||
|
@ -731,11 +726,7 @@
|
||||||
// -Called when the TabletScriptingInterface::screenChanged() signal is emitted. The "type" argument can be either the string
|
// -Called when the TabletScriptingInterface::screenChanged() signal is emitted. The "type" argument can be either the string
|
||||||
// value of "Home", "Web", "Menu", "QML", or "Closed". The "url" argument is only valid for Web and QML.
|
// value of "Home", "Web", "Menu", "QML", or "Closed". The "url" argument is only valid for Web and QML.
|
||||||
function onTabletScreenChanged(type, url) {
|
function onTabletScreenChanged(type, url) {
|
||||||
var onWalletScreenNow = (type === "QML" && url === WALLET_QML_SOURCE);
|
onWalletScreen = (type === "QML" && url === WALLET_QML_SOURCE);
|
||||||
if (!onWalletScreenNow && onWalletScreen) {
|
|
||||||
DesktopPreviewProvider.setPreviewDisabledReason("USER");
|
|
||||||
}
|
|
||||||
onWalletScreen = onWalletScreenNow;
|
|
||||||
wireEventBridge(onWalletScreen);
|
wireEventBridge(onWalletScreen);
|
||||||
// Change button to active when window is first openend, false otherwise.
|
// Change button to active when window is first openend, false otherwise.
|
||||||
if (button) {
|
if (button) {
|
||||||
|
|
|
@ -112,11 +112,23 @@ var selectionDisplay = null; // for gridTool.js to ignore
|
||||||
|
|
||||||
var referrerURL; // Used for updating Purchases QML
|
var referrerURL; // Used for updating Purchases QML
|
||||||
var filterText; // Used for updating Purchases QML
|
var filterText; // Used for updating Purchases QML
|
||||||
|
|
||||||
|
var onWalletScreen = false;
|
||||||
function onScreenChanged(type, url) {
|
function onScreenChanged(type, url) {
|
||||||
onMarketplaceScreen = type === "Web" && url.indexOf(MARKETPLACE_URL) !== -1;
|
onMarketplaceScreen = type === "Web" && url.indexOf(MARKETPLACE_URL) !== -1;
|
||||||
onWalletScreen = url.indexOf(MARKETPLACE_WALLET_QML_PATH) !== -1;
|
var onWalletScreenNow = url.indexOf(MARKETPLACE_WALLET_QML_PATH) !== -1;
|
||||||
onCommerceScreen = type === "QML" && (url.indexOf(MARKETPLACE_CHECKOUT_QML_PATH) !== -1 || url === MARKETPLACE_PURCHASES_QML_PATH
|
onCommerceScreen = type === "QML" && (url.indexOf(MARKETPLACE_CHECKOUT_QML_PATH) !== -1 || url === MARKETPLACE_PURCHASES_QML_PATH
|
||||||
|| url.indexOf(MARKETPLACE_INSPECTIONCERTIFICATE_QML_PATH) !== -1);
|
|| url.indexOf(MARKETPLACE_INSPECTIONCERTIFICATE_QML_PATH) !== -1);
|
||||||
|
|
||||||
|
if (!onWalletScreenNow && onWalletScreen) { // exiting wallet screen
|
||||||
|
if (isHmdPreviewDisabledBySecurity) {
|
||||||
|
DesktopPreviewProvider.setPreviewDisabledReason("USER");
|
||||||
|
Menu.setIsOptionChecked("Disable Preview", false);
|
||||||
|
isHmdPreviewDisabledBySecurity = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onWalletScreen = onWalletScreenNow;
|
||||||
wireEventBridge(onMarketplaceScreen || onCommerceScreen || onWalletScreen);
|
wireEventBridge(onMarketplaceScreen || onCommerceScreen || onWalletScreen);
|
||||||
|
|
||||||
if (url === MARKETPLACE_PURCHASES_QML_PATH) {
|
if (url === MARKETPLACE_PURCHASES_QML_PATH) {
|
||||||
|
@ -480,7 +492,7 @@ var selectionDisplay = null; // for gridTool.js to ignore
|
||||||
// Description:
|
// Description:
|
||||||
// -Called when a message is received from Checkout.qml. The "message" argument is what is sent from the Checkout QML
|
// -Called when a message is received from Checkout.qml. The "message" argument is what is sent from the Checkout QML
|
||||||
// in the format "{method, params}", like json-rpc.
|
// in the format "{method, params}", like json-rpc.
|
||||||
var isHmdPreviewDisabled = true;
|
var isHmdPreviewDisabledBySecurity = false;
|
||||||
function fromQml(message) {
|
function fromQml(message) {
|
||||||
switch (message.method) {
|
switch (message.method) {
|
||||||
case 'purchases_openWallet':
|
case 'purchases_openWallet':
|
||||||
|
@ -548,11 +560,19 @@ var selectionDisplay = null; // for gridTool.js to ignore
|
||||||
openLoginWindow();
|
openLoginWindow();
|
||||||
break;
|
break;
|
||||||
case 'disableHmdPreview':
|
case 'disableHmdPreview':
|
||||||
isHmdPreviewDisabled = Menu.isOptionChecked("Disable Preview");
|
var isHmdPreviewDisabled = Menu.isOptionChecked("Disable Preview");
|
||||||
|
if (!isHmdPreviewDisabled) {
|
||||||
|
DesktopPreviewProvider.setPreviewDisabledReason("SECURE_SCREEN");
|
||||||
Menu.setIsOptionChecked("Disable Preview", true);
|
Menu.setIsOptionChecked("Disable Preview", true);
|
||||||
|
isHmdPreviewDisabledBySecurity = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'maybeEnableHmdPreview':
|
case 'maybeEnableHmdPreview':
|
||||||
Menu.setIsOptionChecked("Disable Preview", isHmdPreviewDisabled);
|
if (isHmdPreviewDisabledBySecurity) {
|
||||||
|
DesktopPreviewProvider.setPreviewDisabledReason("USER");
|
||||||
|
Menu.setIsOptionChecked("Disable Preview", false);
|
||||||
|
isHmdPreviewDisabledBySecurity = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'purchases_openGoTo':
|
case 'purchases_openGoTo':
|
||||||
tablet.loadQMLSource("hifi/tablet/TabletAddressDialog.qml");
|
tablet.loadQMLSource("hifi/tablet/TabletAddressDialog.qml");
|
||||||
|
|
|
@ -101,6 +101,7 @@ public:
|
||||||
|
|
||||||
show();
|
show();
|
||||||
makeCurrent();
|
makeCurrent();
|
||||||
|
gl::initModuleGl();
|
||||||
gpu::Context::init<gpu::gl::GLBackend>();
|
gpu::Context::init<gpu::gl::GLBackend>();
|
||||||
makeCurrent();
|
makeCurrent();
|
||||||
resize(QSize(800, 600));
|
resize(QSize(800, 600));
|
||||||
|
@ -135,7 +136,7 @@ const std::string PIXEL_SHADER_DEFINES{ R"GLSL(
|
||||||
#define GPU_TRANSFORM_STEREO_SPLIT_SCREEN
|
#define GPU_TRANSFORM_STEREO_SPLIT_SCREEN
|
||||||
)GLSL" };
|
)GLSL" };
|
||||||
|
|
||||||
void testShaderBuild(const char* vs_src, const char * fs_src) {
|
void testShaderBuild(const std::string& vs_src, const std::string& fs_src) {
|
||||||
std::string error;
|
std::string error;
|
||||||
std::vector<char> binary;
|
std::vector<char> binary;
|
||||||
GLuint vs, fs;
|
GLuint vs, fs;
|
||||||
|
@ -160,54 +161,54 @@ void QTestWindow::draw() {
|
||||||
|
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&]{
|
std::call_once(once, [&]{
|
||||||
testShaderBuild(sdf_text3D_vert, sdf_text3D_frag);
|
testShaderBuild(sdf_text3D_vert::getSource(), sdf_text3D_frag::getSource());
|
||||||
|
|
||||||
testShaderBuild(DrawTransformUnitQuad_vert, DrawTexture_frag);
|
testShaderBuild(DrawTransformUnitQuad_vert::getSource(), DrawTexture_frag::getSource());
|
||||||
testShaderBuild(DrawTexcoordRectTransformUnitQuad_vert, DrawTexture_frag);
|
testShaderBuild(DrawTexcoordRectTransformUnitQuad_vert::getSource(), DrawTexture_frag::getSource());
|
||||||
testShaderBuild(DrawViewportQuadTransformTexcoord_vert, DrawTexture_frag);
|
testShaderBuild(DrawViewportQuadTransformTexcoord_vert::getSource(), DrawTexture_frag::getSource());
|
||||||
testShaderBuild(DrawTransformUnitQuad_vert, DrawTextureOpaque_frag);
|
testShaderBuild(DrawTransformUnitQuad_vert::getSource(), DrawTextureOpaque_frag::getSource());
|
||||||
testShaderBuild(DrawTransformUnitQuad_vert, DrawColoredTexture_frag);
|
testShaderBuild(DrawTransformUnitQuad_vert::getSource(), DrawColoredTexture_frag::getSource());
|
||||||
|
|
||||||
testShaderBuild(skybox_vert, skybox_frag);
|
testShaderBuild(skybox_vert::getSource(), skybox_frag::getSource());
|
||||||
testShaderBuild(simple_vert, simple_frag);
|
testShaderBuild(simple_vert::getSource(), simple_frag::getSource());
|
||||||
testShaderBuild(simple_vert, simple_textured_frag);
|
testShaderBuild(simple_vert::getSource(), simple_textured_frag::getSource());
|
||||||
testShaderBuild(simple_vert, simple_textured_unlit_frag);
|
testShaderBuild(simple_vert::getSource(), simple_textured_unlit_frag::getSource());
|
||||||
testShaderBuild(deferred_light_vert, directional_ambient_light_frag);
|
testShaderBuild(deferred_light_vert::getSource(), directional_ambient_light_frag::getSource());
|
||||||
testShaderBuild(deferred_light_vert, directional_skybox_light_frag);
|
testShaderBuild(deferred_light_vert::getSource(), directional_skybox_light_frag::getSource());
|
||||||
testShaderBuild(standardTransformPNTC_vert, standardDrawTexture_frag);
|
testShaderBuild(standardTransformPNTC_vert::getSource(), standardDrawTexture_frag::getSource());
|
||||||
testShaderBuild(standardTransformPNTC_vert, DrawTextureOpaque_frag);
|
testShaderBuild(standardTransformPNTC_vert::getSource(), DrawTextureOpaque_frag::getSource());
|
||||||
|
|
||||||
testShaderBuild(model_vert, model_frag);
|
testShaderBuild(model_vert::getSource(), model_frag::getSource());
|
||||||
testShaderBuild(model_normal_map_vert, model_normal_map_frag);
|
testShaderBuild(model_normal_map_vert::getSource(), model_normal_map_frag::getSource());
|
||||||
testShaderBuild(model_vert, model_specular_map_frag);
|
testShaderBuild(model_vert::getSource(), model_specular_map_frag::getSource());
|
||||||
testShaderBuild(model_normal_map_vert, model_normal_specular_map_frag);
|
testShaderBuild(model_normal_map_vert::getSource(), model_normal_specular_map_frag::getSource());
|
||||||
testShaderBuild(model_vert, model_translucent_frag);
|
testShaderBuild(model_vert::getSource(), model_translucent_frag::getSource());
|
||||||
testShaderBuild(model_normal_map_vert, model_translucent_frag);
|
testShaderBuild(model_normal_map_vert::getSource(), model_translucent_frag::getSource());
|
||||||
testShaderBuild(model_lightmap_vert, model_lightmap_frag);
|
testShaderBuild(model_lightmap_vert::getSource(), model_lightmap_frag::getSource());
|
||||||
testShaderBuild(model_lightmap_normal_map_vert, model_lightmap_normal_map_frag);
|
testShaderBuild(model_lightmap_normal_map_vert::getSource(), model_lightmap_normal_map_frag::getSource());
|
||||||
testShaderBuild(model_lightmap_vert, model_lightmap_specular_map_frag);
|
testShaderBuild(model_lightmap_vert::getSource(), model_lightmap_specular_map_frag::getSource());
|
||||||
testShaderBuild(model_lightmap_normal_map_vert, model_lightmap_normal_specular_map_frag);
|
testShaderBuild(model_lightmap_normal_map_vert::getSource(), model_lightmap_normal_specular_map_frag::getSource());
|
||||||
|
|
||||||
testShaderBuild(skin_model_vert, model_frag);
|
testShaderBuild(skin_model_vert::getSource(), model_frag::getSource());
|
||||||
testShaderBuild(skin_model_normal_map_vert, model_normal_map_frag);
|
testShaderBuild(skin_model_normal_map_vert::getSource(), model_normal_map_frag::getSource());
|
||||||
testShaderBuild(skin_model_vert, model_specular_map_frag);
|
testShaderBuild(skin_model_vert::getSource(), model_specular_map_frag::getSource());
|
||||||
testShaderBuild(skin_model_normal_map_vert, model_normal_specular_map_frag);
|
testShaderBuild(skin_model_normal_map_vert::getSource(), model_normal_specular_map_frag::getSource());
|
||||||
testShaderBuild(skin_model_vert, model_translucent_frag);
|
testShaderBuild(skin_model_vert::getSource(), model_translucent_frag::getSource());
|
||||||
testShaderBuild(skin_model_normal_map_vert, model_translucent_frag);
|
testShaderBuild(skin_model_normal_map_vert::getSource(), model_translucent_frag::getSource());
|
||||||
|
|
||||||
testShaderBuild(model_shadow_vert, model_shadow_frag);
|
testShaderBuild(model_shadow_vert::getSource(), model_shadow_frag::getSource());
|
||||||
testShaderBuild(textured_particle_vert, textured_particle_frag);
|
testShaderBuild(textured_particle_vert::getSource(), textured_particle_frag::getSource());
|
||||||
/* FIXME: Bring back the ssao shader tests
|
/* FIXME: Bring back the ssao shader tests
|
||||||
testShaderBuild(gaussian_blur_vertical_vert, gaussian_blur_frag);
|
testShaderBuild(gaussian_blur_vert::getSource()ical_vert::getSource(), gaussian_blur_frag::getSource());
|
||||||
testShaderBuild(gaussian_blur_horizontal_vert, gaussian_blur_frag);
|
testShaderBuild(gaussian_blur_horizontal_vert::getSource(), gaussian_blur_frag::getSource());
|
||||||
testShaderBuild(ambient_occlusion_vert, ambient_occlusion_frag);
|
testShaderBuild(ambient_occlusion_vert::getSource(), ambient_occlusion_frag::getSource());
|
||||||
testShaderBuild(ambient_occlusion_vert, occlusion_blend_frag);
|
testShaderBuild(ambient_occlusion_vert::getSource(), occlusion_blend_frag::getSource());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
testShaderBuild(overlay3D_vert, overlay3D_frag);
|
testShaderBuild(overlay3D_vert::getSource(), overlay3D_frag::getSource());
|
||||||
|
|
||||||
testShaderBuild(paintStroke_vert,paintStroke_frag);
|
testShaderBuild(paintStroke_vert::getSource(),paintStroke_frag::getSource());
|
||||||
testShaderBuild(polyvox_vert, polyvox_frag);
|
testShaderBuild(polyvox_vert::getSource(), polyvox_frag::getSource());
|
||||||
|
|
||||||
});
|
});
|
||||||
_context.swapBuffers(this);
|
_context.swapBuffers(this);
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
set(TARGET_NAME scribe)
|
set(TARGET_NAME scribe)
|
||||||
|
|
||||||
setup_hifi_project()
|
# don't use the setup_hifi_project macro as we don't want Qt or GLM dependencies
|
||||||
|
file(GLOB TARGET_SRCS src/*)
|
||||||
|
add_executable(${TARGET_NAME} ${TARGET_SRCS})
|
||||||
|
if (WIN32)
|
||||||
|
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG "/OPT:NOREF /OPT:NOICF")
|
||||||
|
endif()
|
||||||
|
|
|
@ -41,9 +41,23 @@ int main (int argc, char** argv) {
|
||||||
GRAB_VAR_VALUE,
|
GRAB_VAR_VALUE,
|
||||||
GRAB_INCLUDE_PATH,
|
GRAB_INCLUDE_PATH,
|
||||||
GRAB_TARGET_NAME,
|
GRAB_TARGET_NAME,
|
||||||
|
GRAB_SHADER_TYPE,
|
||||||
EXIT,
|
EXIT,
|
||||||
} mode = READY;
|
} mode = READY;
|
||||||
|
|
||||||
|
enum Type {
|
||||||
|
VERTEX = 0,
|
||||||
|
FRAGMENT,
|
||||||
|
GEOMETRY,
|
||||||
|
} type = VERTEX;
|
||||||
|
static const char* shaderTypeString[] = {
|
||||||
|
"VERTEX", "PIXEL", "GEOMETRY"
|
||||||
|
};
|
||||||
|
static const char* shaderCreateString[] = {
|
||||||
|
"Vertex", "Pixel", "Geometry"
|
||||||
|
};
|
||||||
|
std::string shaderStage{ "vert" };
|
||||||
|
|
||||||
for (int ii = 1; (mode != EXIT) && (ii < argc); ii++) {
|
for (int ii = 1; (mode != EXIT) && (ii < argc); ii++) {
|
||||||
inputs.push_back(argv[ii]);
|
inputs.push_back(argv[ii]);
|
||||||
|
|
||||||
|
@ -66,6 +80,8 @@ int main (int argc, char** argv) {
|
||||||
} else if (inputs.back() == "-c++") {
|
} else if (inputs.back() == "-c++") {
|
||||||
makeCPlusPlus = true;
|
makeCPlusPlus = true;
|
||||||
mode = READY;
|
mode = READY;
|
||||||
|
} else if (inputs.back() == "-T") {
|
||||||
|
mode = GRAB_SHADER_TYPE;
|
||||||
} else {
|
} else {
|
||||||
// just grabbed the source filename, stop parameter parsing
|
// just grabbed the source filename, stop parameter parsing
|
||||||
srcFilename = inputs.back();
|
srcFilename = inputs.back();
|
||||||
|
@ -106,6 +122,24 @@ int main (int argc, char** argv) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GRAB_SHADER_TYPE:
|
||||||
|
{
|
||||||
|
if (inputs.back() == "frag") {
|
||||||
|
shaderStage = inputs.back();
|
||||||
|
type = FRAGMENT;
|
||||||
|
} else if (inputs.back() == "geom") {
|
||||||
|
shaderStage = inputs.back();
|
||||||
|
type = GEOMETRY;
|
||||||
|
} else if (inputs.back() == "vert") {
|
||||||
|
shaderStage = inputs.back();
|
||||||
|
type = VERTEX;
|
||||||
|
} else {
|
||||||
|
cerr << "Unrecognized shader type. Supported is vert, frag or geom" << endl;
|
||||||
|
}
|
||||||
|
mode = READY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case EXIT: {
|
case EXIT: {
|
||||||
// THis shouldn't happen
|
// THis shouldn't happen
|
||||||
}
|
}
|
||||||
|
@ -123,11 +157,13 @@ int main (int argc, char** argv) {
|
||||||
cerr << " varname and varvalue must be made of alpha numerical characters with no spaces." << endl;
|
cerr << " varname and varvalue must be made of alpha numerical characters with no spaces." << endl;
|
||||||
cerr << " -listVars : Will list the vars name and value in the standard output." << endl;
|
cerr << " -listVars : Will list the vars name and value in the standard output." << endl;
|
||||||
cerr << " -showParseTree : Draw the tree obtained while parsing the source" << endl;
|
cerr << " -showParseTree : Draw the tree obtained while parsing the source" << endl;
|
||||||
cerr << " -c++ : Generate a c++ header file containing the output file stream stored as a char[] variable" << endl;
|
cerr << " -c++ : Generate a c++ source file containing the output file stream stored as a char[] variable" << endl;
|
||||||
|
cerr << " -T vert/frag/geom : define the type of the shader. Defaults to VERTEX if not specified." << endl;
|
||||||
|
cerr << " This is necessary if the -c++ option is used." << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define targetName: if none, get destFilenmae, if none get srcFilename
|
// Define targetName: if none, get destFilename, if none get srcFilename
|
||||||
if (targetName.empty()) {
|
if (targetName.empty()) {
|
||||||
if (destFilename.empty()) {
|
if (destFilename.empty()) {
|
||||||
targetName = srcFilename;
|
targetName = srcFilename;
|
||||||
|
@ -163,7 +199,7 @@ int main (int argc, char** argv) {
|
||||||
srcStream.open(srcFilename, std::fstream::in);
|
srcStream.open(srcFilename, std::fstream::in);
|
||||||
if (!srcStream.is_open()) {
|
if (!srcStream.is_open()) {
|
||||||
cerr << "Failed to open source file <" << srcFilename << ">" << endl;
|
cerr << "Failed to open source file <" << srcFilename << ">" << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto scribe = std::make_shared<TextTemplate>(srcFilename, config);
|
auto scribe = std::make_shared<TextTemplate>(srcFilename, config);
|
||||||
|
@ -173,7 +209,7 @@ int main (int argc, char** argv) {
|
||||||
int numErrors = scribe->scribe(destStringStream, srcStream, vars);
|
int numErrors = scribe->scribe(destStringStream, srcStream, vars);
|
||||||
if (numErrors) {
|
if (numErrors) {
|
||||||
cerr << "Scribe " << srcFilename << "> failed: " << numErrors << " errors." << endl;
|
cerr << "Scribe " << srcFilename << "> failed: " << numErrors << " errors." << endl;
|
||||||
return 0;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,7 +222,6 @@ int main (int argc, char** argv) {
|
||||||
scribe->displayTree(cerr, level);
|
scribe->displayTree(cerr, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostringstream targetStringStream;
|
|
||||||
if (makeCPlusPlus) {
|
if (makeCPlusPlus) {
|
||||||
// Because there is a maximum size for literal strings declared in source we need to partition the
|
// Because there is a maximum size for literal strings declared in source we need to partition the
|
||||||
// full source string stream into pages that seems to be around that value...
|
// full source string stream into pages that seems to be around that value...
|
||||||
|
@ -208,35 +243,108 @@ int main (int argc, char** argv) {
|
||||||
pageSize += lineSize;
|
pageSize += lineSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
targetStringStream << "// File generated by Scribe " << vars["_SCRIBE_DATE"] << std::endl;
|
std::stringstream headerStringStream;
|
||||||
targetStringStream << "#ifndef scribe_" << targetName << "_h" << std::endl;
|
std::stringstream sourceStringStream;
|
||||||
targetStringStream << "#define scribe_" << targetName << "_h" << std::endl << std::endl;
|
std::string headerFileName = destFilename + ".h";
|
||||||
|
std::string sourceFileName = destFilename + ".cpp";
|
||||||
|
|
||||||
targetStringStream << "const char " << targetName << "[] = \n";
|
sourceStringStream << "// File generated by Scribe " << vars["_SCRIBE_DATE"] << std::endl;
|
||||||
|
|
||||||
|
// Write header file
|
||||||
|
headerStringStream << "#ifndef " << targetName << "_h" << std::endl;
|
||||||
|
headerStringStream << "#define " << targetName << "_h\n" << std::endl;
|
||||||
|
headerStringStream << "#include <gpu/Shader.h>\n" << std::endl;
|
||||||
|
headerStringStream << "class " << targetName << " {" << std::endl;
|
||||||
|
headerStringStream << "public:" << std::endl;
|
||||||
|
headerStringStream << "\tstatic gpu::Shader::Type getType() { return gpu::Shader::" << shaderTypeString[type] << "; }" << std::endl;
|
||||||
|
headerStringStream << "\tstatic const std::string& getSource() { return _source; }" << std::endl;
|
||||||
|
headerStringStream << "\tstatic gpu::ShaderPointer getShader();" << std::endl;
|
||||||
|
headerStringStream << "private:" << std::endl;
|
||||||
|
headerStringStream << "\tstatic const std::string _source;" << std::endl;
|
||||||
|
headerStringStream << "\tstatic gpu::ShaderPointer _shader;" << std::endl;
|
||||||
|
headerStringStream << "};\n" << std::endl;
|
||||||
|
headerStringStream << "#endif // " << targetName << "_h" << std::endl;
|
||||||
|
|
||||||
|
bool mustOutputHeader = destFilename.empty();
|
||||||
|
// Compare with existing file
|
||||||
|
{
|
||||||
|
std::fstream headerFile;
|
||||||
|
headerFile.open(headerFileName, std::fstream::in);
|
||||||
|
if (headerFile.is_open()) {
|
||||||
|
// Skip first line
|
||||||
|
std::string line;
|
||||||
|
std::stringstream previousHeaderStringStream;
|
||||||
|
std::getline(headerFile, line);
|
||||||
|
|
||||||
|
previousHeaderStringStream << headerFile.rdbuf();
|
||||||
|
mustOutputHeader = mustOutputHeader || previousHeaderStringStream.str() != headerStringStream.str();
|
||||||
|
} else {
|
||||||
|
mustOutputHeader = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mustOutputHeader) {
|
||||||
|
if (!destFilename.empty()) {
|
||||||
|
// File content has changed so write it
|
||||||
|
std::fstream headerFile;
|
||||||
|
headerFile.open(headerFileName, std::fstream::out);
|
||||||
|
if (headerFile.is_open()) {
|
||||||
|
// First line contains the date of modification
|
||||||
|
headerFile << sourceStringStream.str();
|
||||||
|
headerFile << headerStringStream.str();
|
||||||
|
} else {
|
||||||
|
cerr << "Scribe output file <" << headerFileName << "> failed to open." << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cerr << sourceStringStream.str();
|
||||||
|
cerr << headerStringStream.str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write source file
|
||||||
|
sourceStringStream << "#include \"" << targetName << ".h\"\n" << std::endl;
|
||||||
|
sourceStringStream << "gpu::ShaderPointer " << targetName << "::_shader;" << std::endl;
|
||||||
|
sourceStringStream << "const std::string " << targetName << "::_source = std::string()";
|
||||||
// Write the pages content
|
// Write the pages content
|
||||||
for (auto page : pages) {
|
for (auto page : pages) {
|
||||||
targetStringStream << "R\"SCRIBE(\n" << page->str() << "\n)SCRIBE\"\n";
|
sourceStringStream << "+ std::string(R\"SCRIBE(\n" << page->str() << "\n)SCRIBE\")\n";
|
||||||
}
|
}
|
||||||
targetStringStream << ";\n" << std::endl << std::endl;
|
sourceStringStream << ";\n" << std::endl << std::endl;
|
||||||
|
|
||||||
targetStringStream << "#endif" << std::endl;
|
sourceStringStream << "gpu::ShaderPointer " << targetName << "::getShader() {" << std::endl;
|
||||||
|
sourceStringStream << "\tif (_shader==nullptr) {" << std::endl;
|
||||||
|
sourceStringStream << "\t\t_shader = gpu::Shader::create" << shaderCreateString[type] << "(std::string(_source));" << std::endl;
|
||||||
|
sourceStringStream << "\t}" << std::endl;
|
||||||
|
sourceStringStream << "\treturn _shader;" << std::endl;
|
||||||
|
sourceStringStream << "}\n" << std::endl;
|
||||||
|
|
||||||
|
// Destination stream
|
||||||
|
if (!destFilename.empty()) {
|
||||||
|
std::fstream sourceFile;
|
||||||
|
sourceFile.open(sourceFileName, std::fstream::out);
|
||||||
|
if (!sourceFile.is_open()) {
|
||||||
|
cerr << "Scribe output file <" << sourceFileName << "> failed to open." << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sourceFile << sourceStringStream.str();
|
||||||
} else {
|
} else {
|
||||||
targetStringStream << destStringStream.str();
|
cerr << sourceStringStream.str();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
// Destination stream
|
// Destination stream
|
||||||
if (!destFilename.empty()) {
|
if (!destFilename.empty()) {
|
||||||
std::fstream destFileStream;
|
std::fstream destFileStream;
|
||||||
destFileStream.open(destFilename, std::fstream::out);
|
destFileStream.open(destFilename, std::fstream::out);
|
||||||
if (!destFileStream.is_open()) {
|
if (!destFileStream.is_open()) {
|
||||||
cerr << "Scribe output file " << destFilename << "> failed to open." << endl;
|
cerr << "Scribe output file <" << destFilename << "> failed to open." << endl;
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
destFileStream << targetStringStream.str();
|
destFileStream << destStringStream.str();
|
||||||
} else {
|
} else {
|
||||||
cerr << targetStringStream.str();
|
cerr << destStringStream.str();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|