question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't create sky from an EquirectMap without a warning

See original GitHub issue

Seen in Jayfella’s jme-vehicles project:

Oct 23, 2020 5:37:55 PM com.jme3.material.Material checkSetParam
WARNING: Material parameter being set: Texture with type Texture2D doesn't match definition types TextureCubeMap

This diagnostic is triggered by

SkyFactory.createSky(assetManager, "Textures/Sky/quarry_03_4k.jpg", SkyFactory.EnvMapType.EquirectMap);

in Main.java.

The resulting render looks great; I just want to eliminate the diagnostic message. I tried to work around the warning without modifying either jme3-core or the JPEG, but was unsuccessful.

Sky.j3md has

    MaterialParameters {
        TextureCubeMap Texture

But I can’t use “quarry_03_4k.jpg” as a TextureCubeMap because it’s 4096x2048 (not square).

This is one case where type-checking material parameters is awkward.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
riccardoblcommented, Oct 25, 2020

I think there is a problem in the design of the material here.

The matdef wants a TextureCubeMap that should always be mapped to a samplerCube, passing anything that is not a cubemap there would be wrong by definition, this works because the Sky shader uses a macro to define Texture as a sampler2D if EQUIRECT_MAP or SPHERE_MAP are set.

Imo this is bad practice, the matdef should have two params, one for the cubemap and one for the texture2D, or be divided in two different materials.

1reaction
stephengoldcommented, Oct 25, 2020

I like the solution of 2 different material definitions for sky.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] COLOR_1 vertex buffer gltf emissive not implemented
So, I have several models I want to use in a scene, and they all have emissive lights in them. I noticed in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found