jMonkeyEngine / jMonkeyEngine/jmonkeyengine

Performance issue with DiffuseMap/DiffuseColor & directional light/shadow map

Open
#247 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

defect
Dominant language
Java
Stars
4.3k
Forks
1.2k
Avg merge
4d 7h
Merged PRs (30d)
14

Description

The bug is when two objects exist in the same viewport with two different material schemes fps goes from 60fps to 29fps (for me):

  • Scene has directional light with a shadow map
  • Scene has two objects: 1 object is DiffuseMap and the other is Diffuse (color)

Just copying over from Forum topic: http://hub.jmonkeyengine.org/t/settexture-diffusemap-way-faster-than-setcolor-diffuse/31066/3

Test case

See gist: https://gist.github.com/andychase/be168144ce117c653b5a

  • Needs: Textures/planter.png
  • press "Z" and "X" to switch on/off

Workaround

In the mean time you can use the DirectionalShadowFilter with a FilterPostProcessor. It doesn't exhibit the issue and you should have the same visual result.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked gist test case, using Textures/planter.png and the Z/X controls to reproduce the FPS drop. Compare a scene with a directional light and shadow map containing DiffuseMap and Diffuse-color materials, then compare the DirectionalShadowFilter workaround. Done means the mixed-material scene no longer shows the reported performance regression while retaining the same visual result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.