What happened to my normal maps?

I updated to 1.10.8, after doing so, I realized that my normal maps have all changed.
Before update:

After update

my code if it helps:

        self.water = loader.loadModel('assets/environment/arctic/nature/water.bam')
        self.water.setPos(location)
        self.water.setSx(sizeX)
        self.water.setSy(sizeY)
        self.newTS = TextureStage('ts')
        self.normal_TS = TextureStage('normal')
        self.normal_TS.setMode(TextureStage.MNormal)
        self.water.setTexture(self.newTS,loader.loadTexture('assets/environment/arctic/nature/textures/water_colormap.jpg'))
        self.water.setTexScale(self.newTS, 40)
        self.water.setTexture(self.normal_TS, loader.loadTexture('assets/environment/arctic/nature/textures/water_normalmap.jpg'))
        self.water.setTexScale(self.normal_TS, 40)
        ambiet = AmbientLight('ambient')
        ambiet.setColor((0.2, 0.2, 0.2, 1))
        alight = self.water.attachNewNode(ambiet)
        self.water.setLight(alight)
        self.water.reparentTo(render)

I have also called render.setShaderAuto() and simplepbr.init(use_normal_maps=True)

From which version did you update?

Do you see any error messages on the command-line?

Were you using simplepbr before you updated?

Please note that you cannot enable both simplepbr and setShaderAuto on the same model. Only one of them can take effect, because they apply different shaders to your objects.

1 Like

version 1.10.7

I get this:

Known pipe types:
  CocoaGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(warning): Shader created-shader produced the following warnings:
WARNING: Could not find vertex shader attribute 'p3d_Color' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'vertex' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'p3d_Normal' to match BindAttributeLocation request.
WARNING: Could not find fragment shader output 'p3d_FragData' to match FragDataBinding request.


Process finished with exit code 0

Yes

I have just tried commenting out simplepbr.init(use_normal_maps=True) and I got a dark environment, I uncommented simplepbr and commented self.render.setShaderAuto() and I got the entire environment black except for the player model, might need to add more lighting after these results.

EDIT: Plus when I commented out these lines individually I don’t get message above in the terminal.

The messages are harmless and can be ignored.

Could you make sure you are on the latest version of panda3d-simplepbr?

Would you be willing to share your code and assets with me so that I can try it for myself?

1 Like

my simplepbr is on version 0.7.

My code is at GitHub - azizalbastaki/Voyager, the files referenced previously are in game.py and water.py.

If you are going to run game.py, please note that you need to press escape if you want to stop the game.

were you able to access the code+assets? any issues regarding the code and its structure?

Is this what the water is supposed to look like? If so, it works fine for me.

1 Like

Wait so this is what you get when you run the code as it is without changing anything?

Should I reinstall Panda3D if that’s the case?

Yes.

You could try reinstalling Panda3D, and making sure your packages are up-to-date. Also make sure your graphics drivers are up-to-date.

1 Like

Hello,

I have reinstalled Panda3D 1.10.8, reinstalled simplepbr (0.7 to make sure) and I am on the latest OS (I am on a Mac and graphic drivers are part of the OS).

Any other potential solutions to this? Should I downgrade back to 1.10.7 if still no luck?

Many thanks by the way for the help.

Tried on my mac, with Panda3D 1.10.8 simplepbr 0.7, and I get the plain blue water instead of the expected waves.

I’m getting those same results, when downgrading to 1.10.7, the normal maps work normal again :thinking:

Looking at your code you seem to instantiate at least ShowBase twice, MyApp inherits from ShowBase, but also your Water object is. I don’t think that’s a good idea.
If you want to see the effect of your normal map, you need a directional or point light. However, as far as I can see you only have an ambient light.

I would say you are using an undefined behaviour (or a bug) that has been fixed in 1.10.8.

1 Like

I have removed the ShowBase parameter from the water object and that was the only object to inherit showbase other than MyApp, and I also added a directional light to the scene, no luck.

I’ve just updated the project on GitHub, would you mind having another look at the code?

Thanks for your help :slightly_smiling_face:

Oh, hang on, I feel silly for not checking this first. It actually looks like water.bam doesn’t have binormals and tangents generated for it. You need those to be present on your model if you want to apply normal mapping.

1 Like

I used egg-trans to add binormals and tangents to the file, yet it still seems that it doesn’t work.

I used the command egg-trans -tbnall water.egg >newwater.egg after converting water.bam to water.egg using bam2egg, should I have used something else for egg-trans?

Plus, if this is useful, I no longer get those error messages I mentioned earlier.

I have updated the GitHub page with the new .egg file.

I think I solved it.

I’m not sure whether I really have, but my waves are showing up again after commenting out self.normal_TS.setMode(TextureStage.MNormal)

Not sure whether it’s two layers of colormaps, but it satisfies me.

Hello all,

I tried loading in another model onto the scene (with binormals and tangents) and still seem to get a really flat-looking surface.

I tried running the bump mapping sample program and it says I don’t have supported video cards, which I find strange due to the fact that it used to work perfectly previously on the same machine. (I’m using a 2018 MacBook Pro)

@eldee if you have the time and don’t mind, could you please try running the bump mapping sample on your machine and see if it works?

Weird, I ran the bump-mapping sample and it warned me that “Video driver reports that Cg shaders are not supported” I don’t run the sample everyday but I’m pretty sure I didn’t encounter this in the past.

If I modify the code to ignore the warning, there is no bump mapping applied on the room walls.

1 Like

Perhaps newer cards/Mac drivers no longer support Cg?

1 Like