Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suddenly Shadows Disappear, then the whole frame becomes white. #1872

Open
JYamihud opened this issue Jan 29, 2024 · 1 comment
Open

Suddenly Shadows Disappear, then the whole frame becomes white. #1872

JYamihud opened this issue Jan 29, 2024 · 1 comment

Comments

@JYamihud
Copy link

I make a game on GNU / Linux Pop_OS! using UPBGE 0.36

I have 32 GB RAM from which the whole setup uses only 17 GB ( blender ( upbge ) takes only about 3 GB )
CPU is working during the game only at about 20%

I have an AMD GPU and I head that there are problems with those ( the UI flickers for example ). Maybe I just need to restart my computer. But still this is some hella crazy bug.

Graphics_Gliches0001-1933.mp4
@JYamihud
Copy link
Author

I did some tests:

Restarted computer: Didn't help.

Found what does the trick. I noticed that the white frame started when the car hit the light stand. So I did that a few times. And most of the other times it was from hitting a light stand. ( Perhaps in other times, NPC were hitting light stands ).

I had a Rolling Friction setting on the light stand to be 1.0 I reduced it to 0.0 and it stopped crashing the rendering. I put it back to 1.0 and it started crashing the rendering again.

Here is the code I use to spawn light stands:

for i in bge.logic.globalDict.get("light-spawns", []):
    
    inview = cam.pointInsideFrustum(i.worldPosition) == cam.INSIDE
    
    if i["to_spawn"] and i.getDistanceTo(dani) < spawnAtDistance and inview:
    
        if i["LightSpawn"] not in bge.logic.globalDict["all-lights"]:
            bge.logic.globalDict["all-lights"][i["LightSpawn"]] = []
    
        found = False
        for obj in bge.logic.globalDict["all-lights"][i["LightSpawn"]]:
            if cam.pointInsideFrustum(obj.worldPosition) == cam.OUTSIDE and obj.getDistanceTo(dani) > spawnAtDistance/3:
                found = True
                obj.suspendDynamics(True)
                obj.position = i.worldPosition
                obj.position[2] += 5
                obj.orientation = i.worldOrientation
                obj["spawner"]["to_spawn"] = True
                break
        if not found:
            
            obj = scene.addObject(i["LightSpawn"], i["LightSpawn"])
            obj.suspendDynamics(True)
            obj.position = i.worldPosition
            obj.position[2] += 5
            obj.orientation = i.worldOrientation
            bge.logic.globalDict["all-lights"][i["LightSpawn"]].append(obj)
            
        obj["spawner"] = i
            
        i["to_spawn"]= False

Here is the logic bricks of the light stand.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant