Skip to content

Commit

Permalink
everything working!
Browse files Browse the repository at this point in the history
final fixes with the help of pspeed and Tryder at https://hub.jmonkeyengine.org/t/shaderblow-status/37429/5
thx!
  • Loading branch information
AquariusPower committed Nov 26, 2016
1 parent 699989b commit f96271c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
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;
}
}
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
9 changes: 3 additions & 6 deletions ShaderBlow/test-src/com/shaderblow/test/bubble/Bubble.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
import com.jme3.scene.shape.Sphere;
import com.jme3.util.SkyFactory;

/**
* @ERRORAT 46 vNdotV = dot(inNormal, viewVec);
* @ERROR SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main] com.jme3.renderer.RendererException: compile error in: ShaderSource[name=ShaderBlow/Shaders/Bubble/Bubble.vert, defines, type=Vertex, language=GLSL100] 0(46) : error C7011: implicit cast from "float" to "vec3"
*/
public class Bubble extends SimpleApplication {

public static void main(String[] args) {
Expand Down Expand Up @@ -44,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 @@ -16,12 +16,6 @@
import com.jme3.util.SkyFactory;
import com.jme3.util.TangentBinormalGenerator;

/**
*
* @ERRORAT 705 vec3 iblLight = texture2D(m_IblMap_Simple, vec2((((refVec) + mat * normal) * vec3(0.49)) + vec3(0.49)));
* @ERROR com.jme3.renderer.RendererException: compile error in: ShaderSource[name=ShaderBlow/Shaders/LightBlow/LightBlow.frag, defines, type=Fragment, language=GLSL100] 0(705) : error C7011: implicit cast from "vec4" to "vec3"
*
*/
public class TestLightBlowShadingSystem extends SimpleApplication {

public static void main(final String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
import com.jme3.scene.shape.Sphere;
import com.jme3.util.TangentBinormalGenerator;

/**
* @ERRORAT 705 vec3 iblLight = texture2D(m_IblMap_Simple, vec2((((refVec) + mat * normal) * vec3(0.49)) + vec3(0.49)));
* @ERROR com.jme3.renderer.RendererException: compile error in: ShaderSource[name=ShaderBlow/Shaders/LightBlow/LightBlow.frag, defines, type=Fragment, language=GLSL100] 0(705) : error C7011: implicit cast from "vec4" to "vec3"
*/
public class TestLightBlowSimpleIBL extends SimpleApplication {

public static void main(final String[] args) {
Expand Down

0 comments on commit f96271c

Please sign in to comment.