# HG changeset patch # User "Joseph Andresen" # Date 1383154757 25200 # Node ID ecabbae6666beeae6389e97c6f4208b55bc6eefb # Parent acd1dc2d8b8109d2a4e9287deb36c9573400757f [mq]: CorrectSpecularImpl diff -r acd1dc2d8b81 -r ecabbae6666b apps/experiments/3DViewer/nbproject/build-impl.xml --- a/apps/experiments/3DViewer/nbproject/build-impl.xml Thu Oct 17 13:37:25 2013 -0700 +++ b/apps/experiments/3DViewer/nbproject/build-impl.xml Wed Oct 30 10:39:17 2013 -0700 @@ -1,1453 +1,1448 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set platform.home - Must set platform.bootcp - Must set platform.java - Must set platform.javac - - The J2SE Platform is not correctly set up. - Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. - Either open the project in the IDE and setup the Platform with the same name or add it manually. - For example like this: - ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) - or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.java.dir - Must set src.resources.dir - Must set test.java.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No tests executed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - - - - - - ${platform.java} -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - ${platform.java} -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - Must select one file in the IDE or set profile.class - This target only works when run from inside the NetBeans IDE. - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - Must select some files in the IDE or set test.includes - - - - - Must select one file in the IDE or set run.class - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - Must select some files in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - Must select one file in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set platform.home + Must set platform.bootcp + Must set platform.java + Must set platform.javac + + The J2SE Platform is not correctly set up. + Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. + Either open the project in the IDE and setup the Platform with the same name or add it manually. + For example like this: + ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) + or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.java.dir + Must set src.resources.dir + Must set test.java.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + ${platform.java} -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r acd1dc2d8b81 -r ecabbae6666b apps/experiments/3DViewer/nbproject/genfiles.properties --- a/apps/experiments/3DViewer/nbproject/genfiles.properties Thu Oct 17 13:37:25 2013 -0700 +++ b/apps/experiments/3DViewer/nbproject/genfiles.properties Wed Oct 30 10:39:17 2013 -0700 @@ -1,8 +1,8 @@ -build.xml.data.CRC32=053bf8d6 -build.xml.script.CRC32=0419b6b5 -build.xml.stylesheet.CRC32=28e38971@1.56.1.46 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=053bf8d6 -nbproject/build-impl.xml.script.CRC32=07a39b29 -nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46 +build.xml.data.CRC32=053bf8d6 +build.xml.script.CRC32=0419b6b5 +build.xml.stylesheet.CRC32=28e38971@1.56.1.46 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=053bf8d6 +nbproject/build-impl.xml.script.CRC32=b6adadd8 +nbproject/build-impl.xml.stylesheet.CRC32=5a01deb7@1.68.1.46 diff -r acd1dc2d8b81 -r ecabbae6666b apps/experiments/3DViewer/nbproject/project.properties --- a/apps/experiments/3DViewer/nbproject/project.properties Thu Oct 17 13:37:25 2013 -0700 +++ b/apps/experiments/3DViewer/nbproject/project.properties Wed Oct 30 10:39:17 2013 -0700 @@ -1,76 +1,76 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -application.title=3DViewer -application.vendor=jpotts -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/3DViewer.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.jfxrt.jar=../../../../artifacts/sdk/rt/lib/ext/jfxrt.jar -includes=** -jar.compress=false -javac.classpath=\ - ${file.reference.jfxrt.jar} -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding=${source.encoding} -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class=com.javafx.experiments.jfx3dviewer.Jfx3dViewerApp -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=JDK_1.8_Without_FX -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project. -# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. -# To set system properties for unit tests define test-sys-prop.name=value: -run.jvmargs=-Djava.ext.dirs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -source.encoding=UTF-8 -src.java.dir=src/main/java -src.resources.dir=src/main/resources -test.java.dir=src/test/java +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=3DViewer +application.vendor=jpotts +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/3DViewer.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.jfxrt.jar=../../../../artifacts/sdk/rt/lib/ext/jfxrt.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.jfxrt.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=com.javafx.experiments.jfx3dviewer.Jfx3dViewerApp +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=JDK_1.8_Without_FX +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs=-Djava.ext.dirs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.java.dir=src/main/java +src.resources.dir=src/main/resources +test.java.dir=src/test/java diff -r acd1dc2d8b81 -r ecabbae6666b build.gradle --- a/build.gradle Thu Oct 17 13:37:25 2013 -0700 +++ b/build.gradle Wed Oct 30 10:39:17 2013 -0700 @@ -1113,6 +1113,9 @@ ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s1s.h", "/DSpec=1", "/DSType=2", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s2s.h", "/DSpec=2", "/DSType=2", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s3s.h", "/DSpec=3", "/DSType=2", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s1sb.h", "/DSpec=1", "/DSType=3", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s2sb.h", "/DSpec=2", "/DSType=3", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s3sb.h", "/DSpec=3", "/DSType=3", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b1n.h", "/DSpec=1", "/DSType=0", "/DBump=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b2n.h", "/DSpec=2", "/DSType=0", "/DBump=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b3n.h", "/DSpec=3", "/DSType=0", "/DBump=1", "$PS_3D_SRC"], @@ -1122,6 +1125,9 @@ ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b1s.h", "/DSpec=1", "/DSType=2", "/DBump=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b2s.h", "/DSpec=2", "/DSType=2", "/DBump=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b3s.h", "/DSpec=3", "/DSType=2", "/DBump=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b1sb.h", "/DSpec=1", "/DSType=3", "/DBump=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b2sb.h", "/DSpec=2", "/DSType=3", "/DBump=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b3sb.h", "/DSpec=3", "/DSType=3", "/DBump=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s1ni.h", "/DSpec=1", "/DSType=0", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s2ni.h", "/DSpec=2", "/DSType=0", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s3ni.h", "/DSpec=3", "/DSType=0", "/DIllumMap=1", "$PS_3D_SRC"], @@ -1131,6 +1137,9 @@ ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s1si.h", "/DSpec=1", "/DSType=2", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s2si.h", "/DSpec=2", "/DSType=2", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s3si.h", "/DSpec=3", "/DSType=2", "/DIllumMap=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s1sbi.h", "/DSpec=1", "/DSType=3", "/DIllumMap=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s2sbi.h", "/DSpec=2", "/DSType=3", "/DIllumMap=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_s3sbi.h", "/DSpec=3", "/DSType=3", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b1ni.h", "/DSpec=1", "/DSType=0", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b2ni.h", "/DSpec=2", "/DSType=0", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b3ni.h", "/DSpec=3", "/DSType=0", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], @@ -1140,6 +1149,9 @@ ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b1si.h", "/DSpec=1", "/DSType=2", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b2si.h", "/DSpec=2", "/DSType=2", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b3si.h", "/DSpec=3", "/DSType=2", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b1sbi.h", "/DSpec=1", "/DSType=3", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b2sbi.h", "/DSpec=2", "/DSType=3", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], + ["$FXC", "/nologo", "/T", "ps_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1PS_b3sbi.h", "/DSpec=3", "/DSType=3", "/DBump=1", "/DIllumMap=1", "$PS_3D_SRC"], ["$FXC", "/nologo", "/T", "vs_2_0", "/Fh", "$buildDir/headers/PrismD3D/hlsl/Mtl1VS_Obj.h", "/DVertexType=ObjVertex", "$VS_3D_SRC"] ] final ExecutorService executor = Executors.newFixedThreadPool(Integer.parseInt(project.NUM_COMPILE_THREADS.toString())); diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGPhongMaterial.java --- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGPhongMaterial.java Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGPhongMaterial.java Wed Oct 30 10:39:17 2013 -0700 @@ -67,11 +67,11 @@ if (diffuseColorDirty) { if (diffuseColor != null) { - material.setSolidColor( + material.setDiffuseColor( diffuseColor.getRed(), diffuseColor.getGreen(), diffuseColor.getBlue(), diffuseColor.getAlpha()); } else { - material.setSolidColor(0, 0, 0, 0); + material.setDiffuseColor(0, 0, 0, 0); } diffuseColorDirty = false; } @@ -88,25 +88,29 @@ if (selfIllumMap.isDirty()) { material.setTextureMap(selfIllumMap); } - if (specularMap.isDirty() || specularColorDirty || specularPowerDirty) { - Image specular = specularMap.getImage(); - if (!hasSpecularMap && specularColor != null) { - int ia = (int) (255.0 * specularPower); - int ir = (int) (255.0 * specularColor.getRed()); - int ig = (int) (255.0 * specularColor.getGreen()); - int ib = (int) (255.0 * specularColor.getBlue()); - int pixel = (ia << 24) | (ir << 16) | (ig << 8) | (ib << 0); - - if (ir != 0 || ig != 0 || ib != 0) { - specular = Image.fromIntArgbPreData(new int[]{pixel}, 1, 1); - // NOTE: Need to manually mark specularMap dirty when it is - // a color so that native texture can be updated. - specularMap.setDirty(true); - } + + if (specularMap.isDirty()) { + material.setTextureMap(specularMap); + specularMap.setDirty(false); + } + + if (specularColorDirty) { + if (specularColor != null ) { + material.setSpecularColor( + specularColor.getRed(), specularColor.getGreen(), + specularColor.getBlue(), specularColor.getAlpha()); + } else { + material.setSpecularColor(0, 0, 0, 0); } - specularMap.setImage(specular); - material.setTextureMap(specularMap); specularColorDirty = false; + } + + if (specularPowerDirty) { + if (specularColor != null) { + material.setSpecularPower(specularPower); + } else { + material.setSpecularPower(1); + } specularPowerDirty = false; } } diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/java/com/sun/prism/PhongMaterial.java --- a/modules/graphics/src/main/java/com/sun/prism/PhongMaterial.java Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/java/com/sun/prism/PhongMaterial.java Wed Oct 30 10:39:17 2013 -0700 @@ -39,7 +39,9 @@ public static final int SELF_ILLUM = MapType.SELF_ILLUM.ordinal(); public static final int MAX_MAP_TYPE = MapType.values().length; - public void setSolidColor(float r, float g, float b, float a); + public void setDiffuseColor(float r, float g, float b, float a); + public void setSpecularColor(float r, float g, float b, float a); + public void setSpecularPower(float power); public void setTextureMap(TextureMap map); diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/java/com/sun/prism/d3d/D3DContext.java --- a/modules/graphics/src/main/java/com/sun/prism/d3d/D3DContext.java Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/java/com/sun/prism/d3d/D3DContext.java Wed Oct 30 10:39:17 2013 -0700 @@ -373,7 +373,11 @@ private static native void nSetSolidColor(long pContext, long nativePhongMaterial, float r, float g, float b, float a); private static native void nSetMap(long pContext, long nativePhongMaterial, - int mapType, long texID, boolean isSpecularAlpha, boolean isBumpAlpha); + int mapType, long texID); + private static native void nSetSpecularColor(long pContext, long nativePhongMaterial, + float r, float g, float b, float a); + private static native void nSetSpecularPower(long pContext, long nativePhongMaterial, + float power); private static native long nCreateD3DMeshView(long pContext, long nativeMesh); private static native void nReleaseD3DMeshView(long pContext, long nativeHandle); private static native void nSetCullingMode(long pContext, long nativeMeshView, @@ -464,11 +468,17 @@ void setSolidColor(long nativePhongMaterial, float r, float g, float b, float a) { nSetSolidColor(pContext, nativePhongMaterial, r, g, b, a); } + + void setSpecularColor(long nativePhongMaterial, float r, float g, float b, float a) { + nSetSpecularColor(pContext, nativePhongMaterial, r, g, b, a); + } + + void setSpecularPower(long nativePhongMaterial, float power) { + nSetSpecularPower(pContext, nativePhongMaterial, power); + } - void setMap(long nativePhongMaterial, int mapType, long nativeTexture, - boolean isSpecularAlpha, boolean isBumpAlpha) { - nSetMap(pContext, nativePhongMaterial, mapType, nativeTexture, - isSpecularAlpha, isBumpAlpha); + void setMap(long nativePhongMaterial, int mapType, long nativeTexture) { + nSetMap(pContext, nativePhongMaterial, mapType, nativeTexture); } long createD3DMeshView(long nativeMesh) { diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/java/com/sun/prism/d3d/D3DPhongMaterial.java --- a/modules/graphics/src/main/java/com/sun/prism/d3d/D3DPhongMaterial.java Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/java/com/sun/prism/d3d/D3DPhongMaterial.java Wed Oct 30 10:39:17 2013 -0700 @@ -61,26 +61,22 @@ return nativeHandle; } - public void setSolidColor(float r, float g, float b, float a) { + public void setDiffuseColor(float r, float g, float b, float a) { context.setSolidColor(nativeHandle, r, g, b, a); } - + public void setTextureMap(TextureMap map) { maps[map.getType().ordinal()] = map; } private Texture setupTexture(TextureMap map) { - boolean isSpecularAlpha = false; - boolean isBumpAlpha = false; Image image = map.getImage(); Texture texture = (image == null) ? null : context.getResourceFactory().getCachedTexture(image, Texture.WrapMode.CLAMP_TO_EDGE); switch (map.getType()) { case SPECULAR: - isSpecularAlpha = texture == null ? false : !texture.getPixelFormat().isOpaque(); break; case BUMP: - isBumpAlpha = texture == null ? false : !texture.getPixelFormat().isOpaque(); break; case DIFFUSE: break; @@ -91,7 +87,7 @@ } long hTexture = (texture != null) ? ((D3DTexture) texture).getNativeTextureObject() : 0; context.setMap(nativeHandle, map.getType().ordinal(), - hTexture, isSpecularAlpha, isBumpAlpha); + hTexture); return texture; } @@ -134,6 +130,16 @@ return count; } + @Override + public void setSpecularColor(float r, float g, float b, float a) { + context.setSpecularColor(nativeHandle, r, g, b, a); + } + + @Override + public void setSpecularPower(float power) { + context.setSpecularPower(nativeHandle, power); + } + static class D3DPhongMaterialDisposerRecord implements Disposer.Record { private final D3DContext context; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongMaterial.java --- a/modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongMaterial.java Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongMaterial.java Wed Oct 30 10:39:17 2013 -0700 @@ -46,9 +46,7 @@ Color diffuseColor = Color.WHITE; Color specularColor = Color.WHITE; - - boolean isSpecularAlpha = false; - boolean isBumpAlpha = false; + float specularPower = 0; private ES2PhongMaterial(ES2Context context, long nativeHandle, Disposer.Record disposerRecord) { @@ -67,7 +65,7 @@ return nativeHandle; } - public void setSolidColor(float r, float g, float b, float a) { + public void setDiffuseColor(float r, float g, float b, float a) { diffuseColor = new Color(r,g,b,a); } @@ -81,10 +79,8 @@ : context.getResourceFactory().getCachedTexture(image, Texture.WrapMode.CLAMP_TO_EDGE); switch (map.getType()) { case SPECULAR: - isSpecularAlpha = texture == null ? false : !texture.getPixelFormat().isOpaque(); break; case BUMP: - isBumpAlpha = texture == null ? false : !texture.getPixelFormat().isOpaque(); break; case DIFFUSE: break; @@ -135,6 +131,16 @@ return count; } + @Override + public void setSpecularColor(float r, float g, float b, float a) { + this.specularColor = new Color(r,g,b,a); + } + + @Override + public void setSpecularPower(float power) { + this.specularPower = power; + } + static class ES2PhongMaterialDisposerRecord implements Disposer.Record { private final ES2Context context; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongShader.java --- a/modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongShader.java Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongShader.java Wed Oct 30 10:39:17 2013 -0700 @@ -49,7 +49,8 @@ NONE, SPECULARCOLOR, - TEXTURE + TEXTURE, + BOTH } enum SelfIllumState { @@ -88,6 +89,8 @@ ES2Shader.readStreamIntoString(ES2ResourceFactory.class.getResourceAsStream("glsl/specular_color.frag")); SpecularShaderParts[SpecularState.TEXTURE.ordinal()] = ES2Shader.readStreamIntoString(ES2ResourceFactory.class.getResourceAsStream("glsl/specular_texture.frag")); + SpecularShaderParts[SpecularState.BOTH.ordinal()] = + ES2Shader.readStreamIntoString(ES2ResourceFactory.class.getResourceAsStream("glsl/specular_both.frag")); selfIllumShaderParts[SelfIllumState.NONE.ordinal()] = ES2Shader.readStreamIntoString(ES2ResourceFactory.class.getResourceAsStream("glsl/selfIllum_none.frag")); @@ -122,19 +125,16 @@ } SpecularState specularState = SpecularState.NONE; - //TODO: 3D - determine proper check (does a TEXTURE override a color?) if (material.specularColor != null) { - specularState = SpecularState.SPECULARCOLOR; - } - - if (material.maps[ES2PhongMaterial.SPECULAR].getTexture() != null) { - if (material.isSpecularAlpha) { - specularState = SpecularState.TEXTURE; - } else { + if (material.maps[ES2PhongMaterial.SPECULAR].getTexture() != null) { + specularState = SpecularState.BOTH; + } else { specularState = SpecularState.SPECULARCOLOR; } + } else if (material.maps[ES2PhongMaterial.SPECULAR].getTexture() != null) { + specularState = SpecularState.TEXTURE; } - + BumpMapState bumpState = BumpMapState.NONE; if (material.maps[ES2PhongMaterial.BUMP].getTexture() != null) { bumpState = BumpMapState.TEXTURE; @@ -190,6 +190,12 @@ shader.setConstant("diffuseColor", material.diffuseColor.getRed(), material.diffuseColor.getGreen(), material.diffuseColor.getBlue(), material.diffuseColor.getAlpha()); + + shader.setConstant("specularColor", material.specularColor.getRed(), + material.specularColor.getGreen(), material.specularColor.getBlue(), + material.specularColor.getAlpha()); + + shader.setConstant("specularPower", material.specularPower); context.updateTexture(0, material.maps[ES2PhongMaterial.DIFFUSE].getTexture()); context.updateTexture(1, material.maps[ES2PhongMaterial.SPECULAR].getTexture()); diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DContext.cc --- a/modules/graphics/src/main/native-prism-d3d/D3DContext.cc Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DContext.cc Wed Oct 30 10:39:17 2013 -0700 @@ -311,17 +311,45 @@ /* * Class: com_sun_prism_d3d_D3DContext + * Method: nSetSpecularColor + * Signature: (JJFFFF)V + */ +JNIEXPORT void JNICALL Java_com_sun_prism_d3d_D3DContext_nSetSpecularColor + (JNIEnv *env, jclass, jlong ctx, jlong nativePhongMaterial, + jfloat r, jfloat g, jfloat b, jfloat a) +{ + TraceLn(NWT_TRACE_INFO, "D3DContext_nSetSolidColor"); + D3DPhongMaterial *phongMaterial = (D3DPhongMaterial *) jlong_to_ptr(nativePhongMaterial); + phongMaterial->setSpecularColor(r, g, b, a); +} + +/* + * Class: com_sun_prism_d3d_D3DContext + * Method: nSetSpecularPower + * Signature: (JJF)V + */ +JNIEXPORT void JNICALL Java_com_sun_prism_d3d_D3DContext_nSetSpecularPower + (JNIEnv *env, jclass, jlong ctx, jlong nativePhongMaterial, + jfloat power) +{ + TraceLn(NWT_TRACE_INFO, "D3DContext_nSetSolidColor"); + D3DPhongMaterial *phongMaterial = (D3DPhongMaterial *) jlong_to_ptr(nativePhongMaterial); + phongMaterial->setSpecularPower(power); +} + +/* + * Class: com_sun_prism_d3d_D3DContext * Method: nSetMap - * Signature: (JJIJZZ)V + * Signature: (JJIJ)V */ JNIEXPORT void JNICALL Java_com_sun_prism_d3d_D3DContext_nSetMap (JNIEnv *env, jclass, jlong ctx, jlong nativePhongMaterial, - jint mapType, jlong nativeTexture, jboolean isSpecularAlpha, jboolean isBumpAlpha) + jint mapType, jlong nativeTexture) { TraceLn(NWT_TRACE_INFO, "D3DContext_nSetMap"); D3DPhongMaterial *phongMaterial = (D3DPhongMaterial *) jlong_to_ptr(nativePhongMaterial); IDirect3DBaseTexture9 *texMap = (IDirect3DBaseTexture9 *) jlong_to_ptr(nativeTexture); - phongMaterial->setMap(mapType, texMap, isSpecularAlpha ? true : false, isBumpAlpha ? true : false); + phongMaterial->setMap(mapType, texMap); } /* diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DMeshView.cc --- a/modules/graphics/src/main/native-prism-d3d/D3DMeshView.cc Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DMeshView.cc Wed Oct 30 10:39:17 2013 -0700 @@ -170,10 +170,18 @@ if (!status) { cout << "D3DMeshView.render() - SetPixelShaderConstantF (PSR_LIGHTCOLOR) failed !!!" << endl; } + status = SUCCEEDED(device->SetPixelShaderConstantF(PSR_SPECULARCOLOR, material->getSpecularColor(), 1)); + if (!status) { + cout << "D3DMeshView.render() - SetPixelShaderConstantF (PSR_SPECULARCOLOR) failed !!!" << endl; + } + status = SUCCEEDED(device->SetPixelShaderConstantF(PSR_SPECULARPOWER, (material->getSpecularPower()), 1)); + if (!status) { + cout << "D3DMeshView.render() - SetPixelShaderConstantF (PSR_SPECULARPOWER) failed !!!" << endl; + } int bm = pShader->getBumpMode(material->isBumpMap()); int sm = pShader->getSpecularMode(material->isSpecularMap(), - material->isSpecularAlpha()); + material->getIsSpecularColorUsed()); int im = material->isSelfIllumMap() ? 1 : 0; status = pShader->setPixelShader(numLights, sm, bm, im); diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DPhongMaterial.cc --- a/modules/graphics/src/main/native-prism-d3d/D3DPhongMaterial.cc Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DPhongMaterial.cc Wed Oct 30 10:39:17 2013 -0700 @@ -46,12 +46,17 @@ diffuseColor[1] = 0; diffuseColor[2] = 0; diffuseColor[3] = 0; + specularColor[0] = 0; + specularColor[1] = 0; + specularColor[2] = 0; + specularColor[3] = 0; + specularPower = 1; map[DIFFUSE] = NULL; map[SPECULAR] = NULL; map[BUMP] = NULL; map[SELFILLUMINATION] = NULL; - specularAlpha = false; - bumpAlpha = false; + isSpecularColorUsed = false; + isSpecularMapUsed = false; } void D3DPhongMaterial::setSolidColor(float r, float g, float b, float a) { @@ -61,6 +66,34 @@ diffuseColor[3] = a; } +void D3DPhongMaterial::setSpecularColor(float r, float g, float b, float a) { + if (r != NULL || g != NULL || b != NULL || a != NULL) + { + fprintf(stderr, "setSpecularColor Native\n"); + fflush(stderr); + + isSpecularColorUsed = true; + specularColor[0] = r; + specularColor[1] = g; + specularColor[2] = b; + specularColor[3] = a; + } else { + isSpecularColorUsed = false; + } +} + +void D3DPhongMaterial::setSpecularPower(float power) { + specularPower = power; +} + +float * D3DPhongMaterial::getSpecularColor() { + return specularColor; +} + +float *D3DPhongMaterial::getSpecularPower() { + return &specularPower; +} + float * D3DPhongMaterial::getSolidColor() { return diffuseColor; } @@ -77,8 +110,8 @@ return map[SELFILLUMINATION] ? true : false; } -bool D3DPhongMaterial::isSpecularAlpha() { - return specularAlpha; +bool D3DPhongMaterial::getIsSpecularColorUsed() { + return isSpecularColorUsed; } IDirect3DBaseTexture9 * D3DPhongMaterial::getMap(int type) { @@ -90,9 +123,6 @@ return NULL; } -void D3DPhongMaterial::setMap(int mapID, IDirect3DBaseTexture9 *texMap, - bool isSA, bool isBA) { +void D3DPhongMaterial::setMap(int mapID, IDirect3DBaseTexture9 *texMap) { map[mapID] = texMap; - specularAlpha = isSA; - bumpAlpha = isBA; } diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DPhongMaterial.h --- a/modules/graphics/src/main/native-prism-d3d/D3DPhongMaterial.h Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DPhongMaterial.h Wed Oct 30 10:39:17 2013 -0700 @@ -43,9 +43,14 @@ D3DPhongMaterial(D3DContext *pCtx); virtual ~D3DPhongMaterial(); void setSolidColor(float r, float g, float b, float a); + void setSpecularColor(float r, float g, float b, float a); + void setSpecularPower(float power); float *getSolidColor(); - void setMap(int mapID, IDirect3DBaseTexture9 *texMap, bool isSA, bool isBA); + float *getSpecularColor(); + float *getSpecularPower(); + void setMap(int mapID, IDirect3DBaseTexture9 *texMap); bool isBumpMap(); + bool getIsSpecularColorUsed(); bool isSpecularMap(); bool isSelfIllumMap(); bool isSpecularAlpha(); @@ -54,9 +59,11 @@ private: D3DContext *context; float diffuseColor[4]; + float specularColor[4]; + float specularPower; IDirect3DBaseTexture9 *map[4]; - bool specularAlpha, bumpAlpha; - + bool isSpecularColorUsed; + bool isSpecularMapUsed; }; #endif /* D3DPHONGMATERIAL_H */ diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DPhongShader.cc --- a/modules/graphics/src/main/native-prism-d3d/D3DPhongShader.cc Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DPhongShader.cc Wed Oct 30 10:39:17 2013 -0700 @@ -67,23 +67,27 @@ { { psMtl1_s1n, psMtl1_s2n, psMtl1_s3n}, { psMtl1_s1a, psMtl1_s2a, psMtl1_s3a}, - { psMtl1_s1s, psMtl1_s2s, psMtl1_s3s} + { psMtl1_s1s, psMtl1_s2s, psMtl1_s3s}, + { psMtl1_s1sb, psMtl1_s2sb, psMtl1_s3sb} }, { { psMtl1_b1n, psMtl1_b2n, psMtl1_b3n}, { psMtl1_b1a, psMtl1_b2a, psMtl1_b3a}, - { psMtl1_b1s, psMtl1_b2s, psMtl1_b3s} + { psMtl1_b1s, psMtl1_b2s, psMtl1_b3s}, + { psMtl1_b1sb, psMtl1_b2sb, psMtl1_b3sb} }}, { { { psMtl1_s1ni, psMtl1_s2ni, psMtl1_s3ni}, { psMtl1_s1ai, psMtl1_s2ai, psMtl1_s3ai}, - { psMtl1_s1si, psMtl1_s2si, psMtl1_s3si} + { psMtl1_s1si, psMtl1_s2si, psMtl1_s3si}, + { psMtl1_s1sbi, psMtl1_s2sbi, psMtl1_s3sbi} }, { { psMtl1_b1ni, psMtl1_b2ni, psMtl1_b3ni}, { psMtl1_b1ai, psMtl1_b2ai, psMtl1_b3ai}, - { psMtl1_b1si, psMtl1_b2si, psMtl1_b3si} + { psMtl1_b1si, psMtl1_b2si, psMtl1_b3si}, + { psMtl1_b1sbi, psMtl1_b2sbi, psMtl1_b3sbi} }} }; @@ -111,9 +115,16 @@ return isBumpMap ? BUMP_SPECIFIED : BUMP_NONE; } -int D3DPhongShader::getSpecularMode(bool isSpecularMap, bool isSpecularAlpha){ - return isSpecularMap ? - isSpecularAlpha ? SPECULAR_SPECIFIED : SPECULAR_AUTO : SPECULAR_NONE; +int D3DPhongShader::getSpecularMode(bool isSpecularMapUsed, bool isSpecularColorUsed){ + if (isSpecularMapUsed && isSpecularColorUsed) { + return SPECULAR_BOTH; + } else if (isSpecularMapUsed) { + return SPECULAR_MAP; + } else if (isSpecularColorUsed) { + return SPECULAR_COLOR; + } else { + return SPECULAR_NONE; + } } HRESULT D3DPhongShader::setPixelShader(int numLights, int specularMode, diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DPhongShader.h --- a/modules/graphics/src/main/native-prism-d3d/D3DPhongShader.h Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DPhongShader.h Wed Oct 30 10:39:17 2013 -0700 @@ -45,6 +45,8 @@ // we have 32 constants for ps 2.0 #define PSR_CONSTANTCOLOR 0 #define PSR_LIGHTCOLOR 4 +#define PSR_SPECULARCOLOR 8 +#define PSR_SPECULARPOWER 12 // SR implies Sampler Registers #define SR_DIFFUSEMAP 0 @@ -53,8 +55,9 @@ #define SR_SELFILLUMMAP 3 #define SPECULAR_NONE 0 -#define SPECULAR_AUTO 1 -#define SPECULAR_SPECIFIED 2 +#define SPECULAR_MAP 1 +#define SPECULAR_COLOR 2 +#define SPECULAR_BOTH 3 #define BUMP_NONE 0 #define BUMP_SPECIFIED 1 @@ -65,18 +68,22 @@ psMtl1_s1n(), psMtl1_s2n(), psMtl1_s3n(), psMtl1_s1a(), psMtl1_s2a(), psMtl1_s3a(), psMtl1_s1s(), psMtl1_s2s(), psMtl1_s3s(), +psMtl1_s1sb(), psMtl1_s2sb(), psMtl1_s3sb(), psMtl1_b1n(), psMtl1_b2n(), psMtl1_b3n(), psMtl1_b1a(), psMtl1_b2a(), psMtl1_b3a(), psMtl1_b1s(), psMtl1_b2s(), psMtl1_b3s(), +psMtl1_b1sb(), psMtl1_b2sb(), psMtl1_b3sb(), psMtl1_s1ni(), psMtl1_s2ni(), psMtl1_s3ni(), psMtl1_s1ai(), psMtl1_s2ai(), psMtl1_s3ai(), psMtl1_s1si(), psMtl1_s2si(), psMtl1_s3si(), +psMtl1_s1sbi(), psMtl1_s2sbi(), psMtl1_s3sbi(), psMtl1_b1ni(), psMtl1_b2ni(), psMtl1_b3ni(), psMtl1_b1ai(), psMtl1_b2ai(), psMtl1_b3ai(), -psMtl1_b1si(), psMtl1_b2si(), psMtl1_b3si(); +psMtl1_b1si(), psMtl1_b2si(), psMtl1_b3si(), +psMtl1_b1sbi(), psMtl1_b2sbi(), psMtl1_b3sbi(); class D3DPhongShader { public: @@ -88,7 +95,7 @@ HRESULT setPixelShader(int numLights, int specularMode, int bumpMode, int selfIllumMode); static const int BumpTotal = 2; -static const int SpecTotal = 3; +static const int SpecTotal = 4; static const int SelfIlllumTotal = 2; static const int maxLights = 3; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/D3DPhongShaderGen.cc --- a/modules/graphics/src/main/native-prism-d3d/D3DPhongShaderGen.cc Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/D3DPhongShaderGen.cc Wed Oct 30 10:39:17 2013 -0700 @@ -186,3 +186,52 @@ shader(psMtl1_b3si) #include "hlsl/Mtl1PS_b3si.h" endshader(ps, 20) + +shader(psMtl1_s1sb) +#include "hlsl/Mtl1PS_s1sb.h" +endshader(ps, 20) + +shader(psMtl1_s2sb) +#include "hlsl/Mtl1PS_s2sb.h" +endshader(ps, 20) + +shader(psMtl1_s3sb) +#include "hlsl/Mtl1PS_s3sb.h" +endshader(ps, 20) + +shader(psMtl1_b1sb) +#include "hlsl/Mtl1PS_b1sb.h" +endshader(ps, 20) + +shader(psMtl1_b2sb) +#include "hlsl/Mtl1PS_b2sb.h" +endshader(ps, 20) + +shader(psMtl1_b3sb) +#include "hlsl/Mtl1PS_b3sb.h" +endshader(ps, 20) + +shader(psMtl1_s1sbi) +#include "hlsl/Mtl1PS_s1sbi.h" +endshader(ps, 20) + +shader(psMtl1_s2sbi) +#include "hlsl/Mtl1PS_s2sbi.h" +endshader(ps, 20) + +shader(psMtl1_s3sbi) +#include "hlsl/Mtl1PS_s3sbi.h" +endshader(ps, 20) + +shader(psMtl1_b1sbi) +#include "hlsl/Mtl1PS_b1sbi.h" +endshader(ps, 20) + +shader(psMtl1_b2sbi) +#include "hlsl/Mtl1PS_b2sbi.h" +endshader(ps, 20) + +shader(psMtl1_b3sbi) +#include "hlsl/Mtl1PS_b3sbi.h" +endshader(ps, 20) + diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/hlsl/Mtl1PS.hlsl --- a/modules/graphics/src/main/native-prism-d3d/hlsl/Mtl1PS.hlsl Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/hlsl/Mtl1PS.hlsl Wed Oct 30 10:39:17 2013 -0700 @@ -30,8 +30,9 @@ #endif #define SpecNone 0 -#define SpecAuto 1 -#define SpecAlpha 2 +#define SpecularMap 1 +#define SpecularColor 2 +#define SpecularBoth 3 static const int specType = SType; @@ -41,10 +42,6 @@ sampler mapBumpHeight : register(s2); sampler mapSelfIllum : register(s3); -float autoSpecular (float3 diffuseRGB, float3 specRGB) { - return NTSC_Gray(specRGB); -} - float4 debug() { return float4(0,0,1,1); } @@ -73,11 +70,17 @@ float4 tSpec = float4(0,0,0,0); float sLevel = 0; - if ( specType > 0 ) { - tSpec = tex2D(mapSpecular, objAttr.texD); - sLevel = (specType==SpecAuto) ? autoSpecular(tDiff.xyz, tSpec.rgb) : tSpec.a; - } - // return sLevel.xxxx; +#if specType == SpecularColor + tSpec = gSpecularColor; + sLevel = gSpecularPower; +#elif specType == SpecularMap + tSpec = tex2D(mapSpecular, objAttr.texD); + sLevel = gSpecularPower; +#elif specType == SpecularBoth + tSpec = tex2D(mapSpecular, objAttr.texD); + tSpec = gSpecularColor *tSpec; + sLevel = gSpecularPower; +#endif float3 diff = 0; float3 spec = 0; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/hlsl/psConstants.h --- a/modules/graphics/src/main/native-prism-d3d/hlsl/psConstants.h Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/hlsl/psConstants.h Wed Oct 30 10:39:17 2013 -0700 @@ -30,5 +30,5 @@ float4 gConstantColor : register(c0); float4 gReserved1 : register(c1); float4 gLightColor[numMaxLights] : register(c4); // [c4 .. c8] - -float4 gSomethingElse : register(c9); +float4 gSpecularColor : register(c9); +float gSpecularPower : register(c10); diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/native-prism-d3d/hlsl/psMath.h --- a/modules/graphics/src/main/native-prism-d3d/hlsl/psMath.h Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/native-prism-d3d/hlsl/psMath.h Wed Oct 30 10:39:17 2013 -0700 @@ -45,11 +45,6 @@ static const int nSpecular = Spec; static const bool isIlluminated = IllumMap; - -float NTSC_Gray(float3 color) { - return dot(color, float3(0.299, 0.587, 0.114)); -} - float3 getBumpNormal(float3 bumpMap, float3 N[3]) { return bumpMap.z*N[0]+bumpMap.x*N[1]+bumpMap.y*N[2]; } diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main1Light.frag --- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main1Light.frag Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main1Light.frag Wed Oct 30 10:39:17 2013 -0700 @@ -54,7 +54,7 @@ vec3 refl = reflect(normalize(eyePos), n); vec4 specular = apply_specular(); - float power = specular.a * 32.0 + 1.0; + float power = specular.a; vec3 l = normalize(lightTangentSpacePositions[0].xyz); d = clamp(dot(n,l), 0.0, 1.0)*(lights[0].color).rgb; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main2Lights.frag --- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main2Lights.frag Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main2Lights.frag Wed Oct 30 10:39:17 2013 -0700 @@ -53,7 +53,7 @@ vec3 refl = reflect(normalize(eyePos), n); vec4 specular = apply_specular(); - float power = specular.a * 32.0 + 1.0; + float power = specular.a; vec3 l = normalize(lightTangentSpacePositions[0].xyz); d = clamp(dot(n,l), 0.0, 1.0)*(lights[0].color).rgb; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main3Lights.frag --- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main3Lights.frag Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/main3Lights.frag Wed Oct 30 10:39:17 2013 -0700 @@ -54,7 +54,7 @@ vec3 refl = reflect(normalize(eyePos), n); vec4 specular = apply_specular(); - float power = specular.a * 32.0 + 1.0; + float power = specular.a; vec3 l = normalize(lightTangentSpacePositions[0].xyz); d = clamp(dot(n,l), 0.0, 1.0)*(lights[0].color).rgb; diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_both.frag --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_both.frag Wed Oct 30 10:39:17 2013 -0700 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// specular texture fragment shader +//#version 120 + +uniform sampler2D specularMap; +uniform vec4 specularColor; +uniform float specularPower; + +vec4 apply_specular() +{ + vec4 tSpec = texture2D(specularMap, oTexCoords); + vec4 retVal = tSpec * specularColor; + retVal.a = specularPower; + return retVal; +} diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_color.frag --- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_color.frag Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_color.frag Wed Oct 30 10:39:17 2013 -0700 @@ -27,10 +27,10 @@ //#version 120 uniform sampler2D specularMap; +uniform vec4 specularColor; +uniform float specularPower; vec4 apply_specular() { - vec3 tSpec = texture2D(specularMap, oTexCoords).rgb; - float sLevel = dot(tSpec, vec3(0.299, 0.587, 0.114)); - return vec4(tSpec, sLevel); + return vec4(specularColor.rgb, specularPower); } diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_none.frag --- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_none.frag Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_none.frag Wed Oct 30 10:39:17 2013 -0700 @@ -27,6 +27,8 @@ //#version 120 uniform sampler2D specularMap; +uniform sampler2D specularColor; +uniform sampler2D specularPower; vec4 apply_specular() { diff -r acd1dc2d8b81 -r ecabbae6666b modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_texture.frag --- a/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_texture.frag Thu Oct 17 13:37:25 2013 -0700 +++ b/modules/graphics/src/main/resources/com/sun/prism/es2/glsl/specular_texture.frag Wed Oct 30 10:39:17 2013 -0700 @@ -27,9 +27,12 @@ //#version 120 uniform sampler2D specularMap; +uniform vec4 specularColor; +uniform float specularPower; vec4 apply_specular() { vec4 tSpec = texture2D(specularMap, oTexCoords); + tSpec.a = specularPower; return tSpec; } diff -r acd1dc2d8b81 -r ecabbae6666b netbeans/graphics/nbproject/build-impl.xml --- a/netbeans/graphics/nbproject/build-impl.xml Thu Oct 17 13:37:25 2013 -0700 +++ b/netbeans/graphics/nbproject/build-impl.xml Wed Oct 30 10:39:17 2013 -0700 @@ -108,10 +108,11 @@ - + - - + + + @@ -128,12 +129,6 @@ - - - - - - @@ -152,24 +147,12 @@ - + - + - - - - - - - - - - - - @@ -224,7 +207,15 @@ - + + + + + + + + + @@ -305,6 +296,7 @@ + @@ -344,6 +336,7 @@ + @@ -482,7 +475,7 @@ - + @@ -881,8 +874,8 @@ - - + + @@ -894,7 +887,7 @@ - + @@ -1024,41 +1017,25 @@ - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - - - - - - ${platform.java} -cp "${run.classpath.with.dist.jar}" ${main.class} - - + - + - + - + + + + + + @@ -1066,23 +1043,41 @@ - + To run this application from the command line without Ant, try: ${platform.java} -jar "${dist.jar.resolved}" - + + + + + + + + + + + + + + + + + - + + - + +