Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ShaderBlow/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="bin.tests" path="test-src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry combineaccessrules="false" kind="src" path="/jme3libs"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ NUM_BONES : NumberOfBones
}

}


4 changes: 2 additions & 2 deletions ShaderBlow/assets/ShaderBlow/Shaders/Bubble/Bubble.vert
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void main(){

vec3 viewVec = normalize(vec4(g_CameraPosition,1.0) - vec4(newPos, 1.0) * g_WorldMatrix).xyz;

vNdotV = dot(inNormal, viewVec);
vNdotV = vec3(dot(inNormal, viewVec));

vPosition = vec4(newPos, 1.0) * g_WorldMatrix;
vTransformedNormal = inNormal*g_NormalMatrix;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void main() {
vec2 UV = uv;

vec4 noiseColor1 = texture2D(m_noise, uv * vec2(4.0) + vec2(g_Time, g_Time * 2.0) * vec2(0.01));
vec4 noiseColor2 = texture2D(m_noise, uv * vec2(4.0) - vec2(g_Time*3, -g_Time) * vec2(0.01));
vec4 noiseColor2 = texture2D(m_noise, uv * vec2(4.0) - vec2(g_Time*3.0, -g_Time) * vec2(0.01));

float noiseDotted = dot(noiseColor1, noiseColor2);

Expand Down Expand Up @@ -57,4 +57,4 @@ void main() {
gl_FragColor.a = mix(0.0, gl_FragColor.a, fogFactor);

#endif
}
}
4 changes: 2 additions & 2 deletions ShaderBlow/assets/ShaderBlow/Shaders/LightBlow/LightBlow.frag
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,9 @@ vec4 diffuseColor;

vec4 tempVec1;
#if defined (IBL_SIMPLE) && defined (NORMALMAP)
vec3 iblLight = texture2D(m_IblMap_Simple, vec2((((refVec) + mat * normal) * vec3(0.49)) + vec3(0.49)));
vec3 iblLight = texture2D(m_IblMap_Simple, vec2((((refVec) + mat * normal) * vec3(0.49)) + vec3(0.49))).rgb;
#elif defined (IBL_SIMPLE) && !defined (NORMALMAP)
vec3 iblLight = texture2D(m_IblMap_Simple, vec2((refVec * vec3(0.49)) + vec3(0.49)));
vec3 iblLight = texture2D(m_IblMap_Simple, vec2((refVec * vec3(0.49)) + vec3(0.49))).rgb;
#endif

//Albedo
Expand Down
117 changes: 117 additions & 0 deletions ShaderBlow/buildForEclipse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Shader Blow" default="package-all" basedir=".">
<description>simple build for eclipse</description>
<!-- <import file="nbproject/build-impl.xml"/> -->

<tstamp>
<format property="DATE_TIME_NOW" pattern="yyyyMMddHHmmss" locale="en,UK" />
</tstamp>

<!-- Copy asset folder content to build folder in order to package assets on library jar file -->
<property name="build.classes.dir" value="./bin/"/>
<property name="assets.folder.name" value="./assets/"/>
<property name="application.title" value="JME-ShaderBlow-${DATE_TIME_NOW}"/>

<target name="-pre-jar">
<copydir dest="${build.classes.dir}" src="${assets.folder.name}"></copydir>
</target>

<target description="build all" name="package-all" >
<antcall target="package-code" />
<antcall target="package-sources" />
<antcall target="package-test-sources" />
<!-- <antcall target="-javadoc-build" /> -->
</target>

<target description="build jar" name="package-code">
<jar destfile="dist/${application.title}-lib.jar" compress="true" excludes="">
<fileset dir="${build.classes.dir}" />
<fileset dir="${assets.folder.name}" />
</jar>
</target>
<target description="bundle sources in a jar" name="package-sources">
<jar destfile="dist/${application.title}-sources.jar" compress="true" excludes="">
<fileset dir="src" />
</jar>
</target>
<target description="bundle test sources in a jar" name="package-test-sources">
<jar destfile="dist/${application.title}-test.jar" compress="true" excludes="">
<fileset dir="test-src" />
<fileset dir="test-data" />
</jar>
</target>
<!-- <target depends="-javadoc-build" description="bundle javadoc in a jar" name="package-doc">
<jar basedir="${dist.javadoc.dir}" destfile="dist/${application.title}-javadoc.jar"/>
</target> -->

<!--

There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:

-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products

(Targets beginning with '-' are not intended to be called on their own.)

Example of inserting an obfuscator after compilation could look like this:

<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>

For list of available properties check the imported
nbproject/build-impl.xml file.


Another way to customize the build is by overriding existing main targets.
The targets of interest are:

-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation

An example of overriding the target for project execution could look like this:

<target name="run" depends="BasicGameTemplate-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>

Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.

-->

</project>
6 changes: 3 additions & 3 deletions ShaderBlow/src/com/shaderblow/skydome/SkyDomeControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ public float getCloudCycleSpeed() {
* @return r The resulting ColorRGBA
*/
private ColorRGBA mix(ColorRGBA c1, ColorRGBA c2, float amount) {
ColorRGBA r = new ColorRGBA();
r.interpolate(c1, c2, amount);
return r;
ColorRGBA r = new ColorRGBA();
r.interpolateLocal(c1, c2, amount);
return r;
}

// Day to night/night to day cycles
Expand Down
9 changes: 7 additions & 2 deletions ShaderBlow/test-src/com/shaderblow/test/bubble/Bubble.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.shaderblow.test.bubble;

import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.FileLocator;
import com.jme3.input.ChaseCamera;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
Expand All @@ -23,6 +24,9 @@ public void simpleInitApp() {

Geometry geom = new Geometry("Sphere", b);

this.assetManager.registerLocator("assets", FileLocator.class);
this.assetManager.registerLocator("test-data", FileLocator.class);

Material mat = new Material(assetManager,"ShaderBlow/MatDefs/Bubble/Bubble.j3md"); //"Common/MatDefs/Misc/Unshaded.j3md");//"MatDefs/bubbleMat.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("TestTextures/Bubble/rainbow.png"));
mat.setFloat("Shininess", 20f);
Expand All @@ -36,8 +40,9 @@ public void simpleInitApp() {
rootNode.attachChild(SkyFactory.createSky(
assetManager, "Textures/Sky/Bright/BrightSky.dds", false));

flyCam.setEnabled(false);
ChaseCamera chaseCam = new ChaseCamera(cam, geom, inputManager);
// flyCam.setEnabled(false);
this.flyCam.setMoveSpeed(40);
// ChaseCamera chaseCam = new ChaseCamera(cam, geom, inputManager);


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static void main(final String[] args) {
@Override
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

Texture t;
Material mat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static void main(String[] args) {
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
this.assetManager.registerLocator("test-data", FileLocator.class);

electro_01_2();
electro_01();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ public static void main(String[] args) {
@Override
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
this.assetManager.registerLocator("assets", FileLocator.class);
this.assetManager.registerLocator("test-data", FileLocator.class);

Spatial man = assetManager.loadModel("TestModels/LightBlow/jme_lightblow.mesh.xml");
Material matMan = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
man.setMaterial(matMan);

Electricity5Material mat = new Electricity5Material(assetManager, "ShaderBlow/MatDefs/Electricity/Electricity5.j3md");
Electricity5Material mat = new Electricity5Material(assetManager, "ShaderBlow/MatDefs/Electricity/Electricity5_2.j3md");
mat.setLayers(10);
mat.setWidth(0.2f);
mat.setFloat("speed", 0.1f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public class Electricity5Material extends Material {

public Electricity5Material(MaterialDef def){
super(def);
this.layers = layers;
// this.layers = layers;
}

public Electricity5Material(AssetManager contentMan, String defName){
super(contentMan, defName);
this.layers = layers;
// this.layers = layers;
}

public void setLayers(int layers){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.scene.Spatial;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.Type;
import com.jme3.util.SkyFactory;
import com.jme3.util.TangentBinormalGenerator;

Expand All @@ -53,10 +54,11 @@ public static void main(final String[] args) {
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

final TextureKey skylow = new TextureKey("TestTextures/Water32.dds", true);
skylow.setGenerateMips(true);
skylow.setAsCube(true);
skylow.setTextureTypeHint(Type.CubeMap); // skylow.setAsCube(true);
final Texture texlow = this.assetManager.loadTexture(skylow);

this.rootNode.attachChild(SkyFactory.createSky(this.assetManager, texlow, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Quad;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.Type;
import com.jme3.texture.Texture.WrapMode;
import com.jme3.util.SkyFactory;
import com.jme3.util.TangentBinormalGenerator;
Expand All @@ -56,12 +57,13 @@ public static void main(final String[] args) {
@Override
public void simpleInitApp() {
this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

this.flyCam.setMoveSpeed(55);

final TextureKey skylow = new TextureKey("TestTextures/Water256.dds", true);
skylow.setGenerateMips(true);
skylow.setAsCube(true);
skylow.setTextureTypeHint(Type.CubeMap); // skylow.setAsCube(true);
final Texture texlow = this.assetManager.loadTexture(skylow);
this.rootNode.attachChild(SkyFactory.createSky(this.assetManager, texlow, false));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public static void main(final String[] args) {

public void setupFilters() {

assetManager.registerLocator("assets", FileLocator.class);

this.fpp = new FilterPostProcessor(this.assetManager);

// BasicSSAO ssao = new BasicSSAO();
Expand All @@ -81,6 +79,8 @@ public void setupFilters() {

@Override
public void simpleInitApp() {
assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

final Spatial char_boy = this.assetManager.loadModel("TestModels/LightBlow/jme_lightblow.mesh.xml");
final Material mat = new Material(this.assetManager, "Common/MatDefs/Light/Lighting.j3md");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static void main(final String[] args) {
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

this.flyCam.setMoveSpeed(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static void main(final String[] args) {
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

this.flyCam.setMoveSpeed(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.jme3.renderer.Caps;
import com.jme3.scene.Spatial;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.Type;
import com.jme3.util.SkyFactory;
import com.jme3.util.TangentBinormalGenerator;
import com.shaderblow.filter.frostedglass.FrostedGlassFilter;
Expand All @@ -70,6 +71,7 @@ public static void main(final String[] args) {
@Override
public void simpleInitApp() {
assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

flyCam.setMoveSpeed(5);

Expand Down Expand Up @@ -106,7 +108,7 @@ public void onAction(String name, boolean isPressed, float tpf) {
private void buildScene() {
final TextureKey skyhi = new TextureKey("TestTextures/Water256.dds", true);
skyhi.setGenerateMips(true);
skyhi.setAsCube(true);
skyhi.setTextureTypeHint(Type.CubeMap); // skyhi.setAsCube(true);

final Texture texlow = this.assetManager.loadTexture(skyhi);
this.rootNode.attachChild(SkyFactory.createSky(this.assetManager, texlow, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static void main(final String[] args) {
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

this.flyCam.setMoveSpeed(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static void main(final String[] args) {
public void simpleInitApp() {

this.assetManager.registerLocator("assets", FileLocator.class);
assetManager.registerLocator("test-data", FileLocator.class);

TestObjectBuilder.buildTestModel(this.assetManager, this.rootNode);
TestObjectBuilder.buildSkybox(this.assetManager, this.rootNode);
Expand All @@ -67,6 +68,7 @@ public void simpleInitApp() {
this.fpp = new FilterPostProcessor(this.assetManager);

motionBlurFilter = new MotionBlurFilter();
// motionBlurFilter.setStrength(2f);

this.fpp.addFilter(motionBlurFilter);
this.viewPort.addProcessor(this.fpp);
Expand Down
Loading