If I do this in a seperate main class in the same project, everything works perfectly, I can see the effect on my object.
Though when I try to do it where it supposed to be It doesn’t work (with the same code and the same file locations). I do not get any errors, and if I debug, everything looks perfect.
I was wondering if someone has any idea what I would have to look at or check in the project that might be located in another place (that I haven’t seen yet) in order to find out what is wrong. Because I can’t debug this …
Not really necessairy but here is my code:
[java]Node node = new Node();
Geometry electric = (Geometry) assetManager.loadModel("Models_FA/timemachine/TimeMachine.j3o");
Material mat = assetManager.loadMaterial("Materials/electricity3_line1.j3m");
electric.setMaterial(mat);
node.attachChild(electric);
Geometry object = (Geometry) assetManager.loadModel("Models_FA/timemachine/TimeMachine.j3o");
Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
Texture tex = assetManager.loadTexture("Models_FA/timemachine/Prop_TimeMachineCompleteMap.tga");
material.setTexture("ColorMap", tex);
object.setMaterial(material);
node.setName("time_machine");
node.attachChild(object);
node.scale(0.037f);
node.move(new Vector3f(0.0f, 4.0f, -6.0f));
rootNode.attachChild(node);[/java]
It is a very strange problem. If I apply the effect on other objects in the scene I see that it works on some objects, but not all. And I can’t find something that differs between the objects it works on and the objects it doesn’t work on.
@Ojtwist said:
Scaling the object doesn't change anything.
It is a very strange problem. If I apply the effect on other objects in the scene I see that it works on some objects, but not all. And I can’t find something that differs between the objects it works on and the objects it doesn’t work on.
All of your objects have UVMap? Tried to scale UV?
I don’t think it has anything to do with that, because it works on the object it needs to work on when I execute the code in a seperate main file. Though it doesn’t work if I use exactly the same object (and texture) with the same code in the main file of the project. I thought it was because some settings were different, but if I apply the material on another object it works (sometimes).
I do wonder why it works well without this line of code in 1 instance and not in the other, although the same object, texture and code is used.
\
Glad you fixed it! Dunno know, need to check shader, material - how they work.
I’m also happy that shaderBlow is useful for some people. I started sthis project about 3 years ago and added/collected JME shaders.