Reflections

Hi guys, I apologize if this is a silly question, but I do not know where to find most of the material definitions. The one I want to use is the Common/MatDefs/Light/Reflection.j3md and it appears in the code.google.com but not in the SDK itself. Is there a library I need to install in order to get these materials? I am currently using the Jme3 SDK 3.0RC2

1 Like

If that material is in the code base, its also in the SDK. It is just packaged in one of the Jar files, and the path to it is preloaded automatically.

You should be able to call them just fine by using Common/MatDefs/Light/ path. Ex from my coed “Common/MatDefs/Misc/ShowNormals.j3md”

However, I checked the Jar file in the SDK, and it seems to be missing the Reflection material. Maybe it was removed?

Where do you see that in code.google?

https://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core-data/Common/MatDefs/Light/?r=6462

I tried making new .vert and .frag files copying the code for the page but I got errors. I’m not all that familiar with materials, but I understand how to use the premade material definitions so I should be able to use the reflection one somehow. Thanks for replying quickly!

1 Like
@Jmonkier said: https://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core-data/Common/MatDefs/Light/?r=6462

I tried making new .vert and .frag files copying the code for the page but I got errors. I’m not all that familiar with materials, but I understand how to use the premade material definitions so I should be able to use the reflection one somehow. Thanks for replying quickly!

You are looking in some ancient branch, I think. You need to take the r=6462 off of that link as that’s like two years old or something.

And what is it that you think you are trying to accomplish? You can’t just slap a reflection material on an object and have it get reflections. Reflections require tons of other setup since it has to rerender the scene for the reflection plane, etc…

@pspeed said: And what is it that you think you are trying to accomplish? You can't just slap a reflection material on an object and have it get reflections. Reflections require tons of other setup since it has to rerender the scene for the reflection plane, etc..

Essentially I want to make a metallic material that is reflective like what you would see on a car. Is there a better way to do this?

1 Like

Well the simple way would be just to set the skybox to the enviroment map stuff of the lighting material.

I set a cube map of my skybox in the env map and I don’t see any results. Is there a Boolean that has to be at a certain value?

1 Like

Make sure you set up the fresnel values, they define how much “reflection” to apply to the material … see this post for more details.

1 Like
@thetoucher said: Make sure you set up the fresnel values, they define how much "reflection" to apply to the material ... see this post for more details.
Wow! Thanks guys! I didn't even know what fresnel Params are so I didn't set them. That explains why I have no reflection! I'll test it out tomorrow and tell you guys how it turned out! :)
2 Likes

Alright so I added values into the Fresnel params just like noobgamedev did but sadly it is still not working. Do I have to use a special image for the env map? Keeping in mind I am doing this in the SDK material editor.

1 Like

Ok so I think my computer is the problem…I tried it on a Mac and the env map showed up in the material editor just fine. It doesn’t look all too reflective though

1 Like

I dont know much about what youre working on, but if you dont know about it, check this out: https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:plugin:shaderblow

its a plugin that you can just install through the sdk (particularly look at MatCap.j3md on that page, which is what i first thought of when you said metallic)

@Jmonkier said: Ok so I think my computer is the problem...I tried it on a Mac and the env map showed up in the material editor just fine. It doesn't look all too reflective though

A specular map might help if I remember correctly.

As for your computer, are you sure you have the right graficdriver installed (aka not the one from windows update/ auto detection)