Please provide a screenshot of how scene looked before and after adding ToneMapFilter.
Also please provide a simple test case so we can try it.
I have been using ToneMapFilter and have not had an issue.
Please provide a screenshot of how scene looked before and after adding ToneMapFilter.
Also please provide a simple test case so we can try it.
I have been using ToneMapFilter and have not had an issue.
Mesh must have a Color buffer on it if it uses vertex color.
To enable vertex color on material do
material.setBoolean("UseVertexColor", true);
Also, note we had an issue with vertex color not loading on gltf model, that is fixed in JME 3.6
ok made another project with start.jmonkey⌠with only one class extends simple application pretty much straightforward clean new project by only purpose to test the issue
here is the code:
public class TestFrisbee extends SimpleApplication {
public TestFrisbee() {
}
public TestFrisbee(AppState... initialStates) {
super(initialStates);
}
private Spatial frisebee;
private DirectionalLight dl;
@Override
public void simpleInitApp() {
frisebee = assetManager.
loadModel("Models/gaga/gagafrise.glb");
Node probeNode = (Node) assetManager.loadModel("Scenes/defaultProbe.j3o");
LightProbe probe = (LightProbe) probeNode.getLocalLightList().iterator().next();
rootNode.addLight(probe);
dl = new DirectionalLight();
dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
dl.setColor(ColorRGBA.White);
rootNode.addLight(dl);
rootNode.attachChild(frisebee);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
// fpp.addFilter(new FXAAFilter());
fpp.addFilter(new ToneMapFilter(Vector3f.UNIT_XYZ.mult(4.0f)));
// fpp.addFilter(new SSAOFilter(0.5f, 3, 0.2f, 0.2f));
viewPort.addProcessor(fpp);
Spatial sky = SkyFactory.createSky(assetManager, "Textures/Sky/4kresovled.hdr", SkyFactory.EnvMapType.EquirectMap);
rootNode.attachChild(sky);
}
}
EDIT: Iâm sure from modo side as information, since if i messed up with material or texutre modo 100% shows warning on export which didnât, another fact is modo has direct gltf shader, itâs really ease of use you choose gltf material, then you add gltf texture types with bunch of clicks all in shader tree.
What is modo?
3D modeling software, foundry modo
I noticed your model has an Emissive texture, so you need to add a BloomFilter to the scene.
fpp.addFilter(new BloomFilter(BloomFilter.GlowMode.Scene));
else remove the âEmissiveMapâ param from the material if you do not want emissive.
Yes you are right by deleting the emission texture model material appears, but that BloomFilter didnât worked out when i tested it still there was a white model. is there other solution than bloom for emission?
You need to reducing the emissive power and intensity.
frisebee.depthFirstTraversal(new SceneGraphVisitorAdapter() {
@Override
public void visit(Geometry geom) {
geom.getMaterial().setFloat("EmissivePower", 0.5f);
geom.getMaterial().setFloat("EmissiveIntensity", 0.5f);
}
});
The emissive texture is usually a black-and-white texture in which white indicates the parts that emit light and black indicates the parts does not emit light. (instead of white it can be another color also, for example, if it is blue then the part of model will emit blue light instead)
See this model for example
https://i.imgur.com/PCAN35k.png
it uses this emissive texture
https://i.imgur.com/PEd1pBt.png
But in your model, the emissive texture is plane white which means the whole model will emit white light.
wow thank you now i found out the problem, also my emissive multiplier in modo was pitch black i changed it to 1,1,1 fully white then the model turned to full white like in jme, in modo, so i reduced the the emissive level in modo and exported it again. i gonna fix it thank you so much. i gonna remake the emissive in adobe substance or just simply get rid of it
Edit: so in those softwares that model doesnât appear white means they calculate emissive multiplier on pitch black?
Hey @Ali_RS how are you, ok I built the frisebee completely now it has 5 materials, each material hast AO, Metal, Roughness, Normal, and Base Color and Transparent amount(alpha) which is set to Normal Map Blend , except one which is gaga face material which has emission map on her lips too.
When i tested the newly made model in beta3 the only one that appeared correctly was gaga face material it was funny that i tested the model with last stable version 3.5.2 despite the KHR_transform the model showed good, but except one thing I think jme doesnât apply the amount of Multipliers and Scales that i applied to the materials (Iâm not sure and i donât know how to read them from the model material in jme to see if im right or not), so it is like this if set Metalic multiplier in modo to 40% it is feel like at 100% in jme, like they are all 100% all metalic, emissive, ao, roughness except the base color multiplier that is applied in middle blue flowers. no code change i tested the new model with exact same single class code before up there in thread. these are screenshots:
Model in modo (final render):
JME Beta3 no gamma no bloom:
JME 3.5.2-stable with gamma and bloom:
JME 3.5.2-stable with bloom no gamma:
I made textures my self from vectors i found in adobe free stock. and combined the ao, metalic, roughnes in one rgb for all materials. Note that i only applied bloom to objects.
EDIT: I retested the exact glb file and exact code again with beta3 material looked like 3.5.2 so it is no longer like the first image, i mentioned from beta3 itâs now like 3.5.2-stable images i mentioned!
You can read them with material.getParamValue()
for example,
float metallic = material.getParamValue("Metallic");
You can also check if the exported gltf file (it is a JSON file) contains those multipliers, if so, then GltfLoader will pick them up for you when loading into JME.
And note that do not expect the result in mood and JME to look the same as they are different renderers, one is optimized for games while the other is for realistic rendering.
thank you, checked them you are right they are there but itâs the difference of renderers
would you please show me code to assign the material inside the spatial glb model to the material object, i tried it this way made a protected Geometry then i assinged a geometry from inside this code to it, then got material out of it, but it only has one of the materials of 5 materials on the model, how do i get all of them in a linkedList material or does a utility aleardy there that returns a list of materials on the model.
frisebee.depthFirstTraversal(new SceneGraphVisitorAdapter() {
@Override
public void visit(Geometry geom) {
geometry = geom;
}
});
material = geometry.getMaterial();
Heart library provides a utility method
I get the feeling sometimes that no one knows about this class:
https://javadoc.jmonkeyengine.org/v3.5.2-stable/com/jme3/scene/SceneGraphVisitorAdapter.html
Thanks
So according to PBRLighting I canât have a Normal scale to manipulate right? also there is no EmissiveColor Multiplier?! if i can set Normal Scale and EmissiveColor mult then how can i do it?
Edit: I guess that Emissive color must be the multiplier right? didnât notice
I test this on emissive color nothing happened yet still i have no clue on normal scale
List<Material> friseBeeMat = new ArrayList<>();
MySpatial.listMaterials(frisebee,friseBeeMat);
Vector4f emissiveColor = new Vector4f(0.99f,0.19f,0.19f,1f);
for(Material mat : friseBeeMat){
if(mat.getName().equals("FaceGaga")){
mat.setParam("Emissive", VarType.Vector4,emissiveColor);
//mat.getParam("Roughness").setValue(0);
}
}
Right, there is no Normal scale afaik.
It seems Emissive color is ignored when an EmissiveMap is set.
I agree with you that Emissive color should be used as a multiplier to EmissiveMap. That is how it is done for non PBR glow effect.
See
So guess there is no normal scale i need to make changes to normalmap file in ps then! and normalmap was the point jme doesnât read it actually read but at 100% scale, right?, since iâve set a scale of 50% in modo. any plan to get implemented in future?
Right, but actually I do not understand why normal scale is needed. Isnât normal meant to be a direction vector?
Note that you can still copy the built-in PBRLighting material and modify it for your own use-case.