puniverse / spaceships-demo

SpaceBase demo application: a simulation of tens of thousands of spaceships in battle
94 stars 19 forks source link

Black screen at ~20fps #4

Closed vocsong closed 10 years ago

vocsong commented 10 years ago

Only see a black screen with console continuing at ~20fps Here's the console printout

:compileJava UP-TO-DATE :copyShaders UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar UP-TO-DATE :assemble UP-TO-DATE :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build UP-TO-DATE :run COMPILER: Java HotSpot(TM) 64-Bit Server VM VERSION: 1.7.0_60 OS: Windows 7 PROCESSORS: 4

Initializing... World bounds: ([-15000.0, 15000.0]x[-10500.0, 10500.0]x[-15000.0, 15000.0]) N: 3000 Parallelism: 4 Phaser: false Extrapolate: true

SpaceBase properties Optimistic: true Optimistic height: 0 Optimistic retry limit: 3 Node width: 20 Compressed: false Single precision: false

LICENSE: License file not set. Using spacebase-lite.lic. Set with -Dco.parallelu niverse.spacebase.license.file SpaceBase edition: Lite SpaceBase maximum elements allowed: 20000 UI Component: NEWT Running... ERROR StatusLogger Invalid URL C:/Test/spaceships-demo-master/spaceships-demo-ma ster/log4j.xml java.net.MalformedURLException: unknown protocol: c at java.net.URL.(URL.java:592) at java.net.URL.(URL.java:482) at java.net.URL.(URL.java:431) at java.net.URI.toURL(URI.java:1096) at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFro mURI(ConfigurationFactory.java:258) at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.get Configuration(ConfigurationFactory.java:374) at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext .java:385) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java: 149) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log 4jContextFactory.java:84) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log 4jContextFactory.java:35) at org.apache.logging.log4j.LogManager.getContext(LogManager.java:257) at org.slf4j.helpers.Log4jLoggerFactory$PrivateManager.getContext(Log4jL oggerFactory.java:104) at org.slf4j.helpers.Log4jLoggerFactory.getContext(Log4jLoggerFactory.ja va:90) at org.slf4j.helpers.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.jav a:46) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:277) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288) at co.paralleluniverse.actors.behaviors.SupervisorActor.(Supervi sorActor.java:63) at co.paralleluniverse.spaceships.Spaceships.run(Spaceships.java:191) at co.paralleluniverse.spaceships.Spaceships.main(Spaceships.java:64)

WARNING: fiber Fiber@10000001[task: ParkableForkJoinTask@3d2f3481(Fiber@10000001 ), target: co.paralleluniverse.actors.ActorRunner@118eb9f, scheduler: co.paralle luniverse.fibers.FiberForkJoinScheduler@b151449] is hogging the CPU (Thread[Fork JoinPool-default-fiber-pool-worker-5,5,main]). at java.lang.ThreadLocal.get(ThreadLocal.java:143) at java.util.concurrent.ThreadLocalRandom.current(ThreadLocalRandom.java :113) at co.paralleluniverse.spaceships.RandSpatial.getRandom(RandSpatial.java :45) at co.paralleluniverse.spaceships.RandSpatial.randRange(RandSpatial.java :88) at co.paralleluniverse.spaceships.Spaceship.(Spaceship.java:107) at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC

onstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at co.paralleluniverse.actors.ActorSpec.build(ActorSpec.java:97) at co.paralleluniverse.actors.behaviors.SupervisorActor.start(Supervisor Actor.java:512) at co.paralleluniverse.actors.behaviors.SupervisorActor.addChild(Supervi sorActor.java:387) at co.paralleluniverse.spaceships.Spaceships$1.init(Spaceships.java:195)

    at co.paralleluniverse.actors.behaviors.BehaviorActor.onStart(BehaviorAc

tor.java:185) at co.paralleluniverse.actors.behaviors.SupervisorActor.onStart(Supervis orActor.java:317) at co.paralleluniverse.actors.behaviors.BehaviorActor.doRun(BehaviorActo r.java:285) at co.paralleluniverse.actors.behaviors.BehaviorActor.doRun(BehaviorActo r.java:34) at co.paralleluniverse.actors.Actor.run0(Actor.java:623) at co.paralleluniverse.actors.ActorRunner.run(ActorRunner.java:50) at co.paralleluniverse.fibers.Fiber.run(Fiber.java:897) WARNING: fiber Fiber@10000001[task: ParkableForkJoinTask@3d2f3481(Fiber@10000001 ), target: co.paralleluniverse.actors.ActorRunner@118eb9f, scheduler: co.paralle luniverse.fibers.FiberForkJoinScheduler@b151449] is hogging the CPU (Thread[Fork JoinPool-default-fiber-pool-worker-5,5,main]). at java.lang.ThreadLocal$ThreadLocalMap.(ThreadLocal.java:342) at java.lang.ThreadLocal$ThreadLocalMap.(ThreadLocal.java:261) at java.lang.ThreadLocal.createInheritedMap(ThreadLocal.java:236) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at co.paralleluniverse.concurrent.util.ThreadAccess.createInheritedMap(T hreadAccess.java:98) at co.paralleluniverse.fibers.Fiber.(Fiber.java:157) at co.paralleluniverse.fibers.Fiber.(Fiber.java:171) at co.paralleluniverse.fibers.Fiber.(Fiber.java:369) at co.paralleluniverse.actors.behaviors.SupervisorActor.createStrandForA ctor(SupervisorActor.java:636) at co.paralleluniverse.actors.behaviors.SupervisorActor.start(Supervisor Actor.java:527) at co.paralleluniverse.actors.behaviors.SupervisorActor.addChild(Supervi sorActor.java:387) at co.paralleluniverse.spaceships.Spaceships$1.init(Spaceships.java:195)

    at co.paralleluniverse.actors.behaviors.BehaviorActor.onStart(BehaviorAc

tor.java:185) at co.paralleluniverse.actors.behaviors.SupervisorActor.onStart(Supervis orActor.java:317) at co.paralleluniverse.actors.behaviors.BehaviorActor.doRun(BehaviorActo r.java:285) at co.paralleluniverse.actors.behaviors.BehaviorActor.doRun(BehaviorActo r.java:34) at co.paralleluniverse.actors.Actor.run0(Actor.java:623) at co.paralleluniverse.actors.ActorRunner.run(ActorRunner.java:50) at co.paralleluniverse.fibers.Fiber.run(Fiber.java:897) WARNING: fiber Fiber@10000001[task: ParkableForkJoinTask@3d2f3481(Fiber@10000001 ), target: co.paralleluniverse.actors.ActorRunner@118eb9f, scheduler: co.paralle luniverse.fibers.FiberForkJoinScheduler@b151449] is hogging the CPU (Thread[Fork JoinPool-default-fiber-pool-worker-5,5,main]). at co.paralleluniverse.actors.behaviors.SupervisorActor.addChild1(Superv isorActor.java:368) at co.paralleluniverse.actors.behaviors.SupervisorActor.addChild(Supervi sorActor.java:383) at co.paralleluniverse.spaceships.Spaceships$1.init(Spaceships.java:195)

    at co.paralleluniverse.actors.behaviors.BehaviorActor.onStart(BehaviorAc

tor.java:185) at co.paralleluniverse.actors.behaviors.SupervisorActor.onStart(Supervis orActor.java:317) at co.paralleluniverse.actors.behaviors.BehaviorActor.doRun(BehaviorActo r.java:285) at co.paralleluniverse.actors.behaviors.BehaviorActor.doRun(BehaviorActo r.java:34) at co.paralleluniverse.actors.Actor.run0(Actor.java:623) at co.paralleluniverse.actors.ActorRunner.run(ActorRunner.java:50) at co.paralleluniverse.fibers.Fiber.run(Fiber.java:897)

Building 92% > :run

vocsong commented 10 years ago

I downloaded the demo Release 2.0 instead.. Gradle seems to have some wrong version.. copied the Gradle folder from master.. Still black screen but with a different error here..

:compileJava :copyShaders :processResources :classes :jar :assemble :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build :run COMPILER: Java HotSpot(TM) 64-Bit Server VM VERSION: 1.7.0_60 OS: Windows 7 PROCESSORS: 4

Initializing... World bounds: ([-20000.0, 20000.0]x[-14000.0, 14000.0]x[-20000.0, 20000.0]) N: 5000 Parallelism: 4 Phaser: false Extrapolate: true

SpaceBase properties Optimistic: true Optimistic height: 0 Optimistic retry limit: 3 Node width: 20 Compressed: false Single precision: false

LICENSE: License file not set. Using spacebase-lite.lic. Set with -Dco.parallelu niverse.spacebase.license.file SpaceBase edition: Lite SpaceBase maximum elements allowed: 20000 UI Component: NEWT Running... FPSAnimator P1:Thread[main-FPSAWTAnimator-Timer0,5,main]: Task[thread Thread[mai n-FPSAWTAnimator-Timer0,5,main], stopped false, paused false shouldRun true, sho uldStop false -- started true, animating true, paused false, drawable 1, drawabl esEmpty false] Shader status invalid: Geometry shader failed to compile with the following erro rs: Exception in thread "main-FPSAWTAnimator-Timer0" javax.media.opengl.GLException: Couldn't compile shader: ShaderCode[id=2, type=GEOMETRY_SHADER, valid=false, sh ader: 2, source] at co.paralleluniverse.spaceships.render.GLPort.init(GLPort.java:252) at jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:540) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:586)

    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:572)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:379)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:103

4) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:909) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:608) at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:7 4) at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:440) at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:167)

    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

0 RATE: 53.454141889897144 fps 1 RATE: 8.319590475172301 fps 2 RATE: 14.816508534559027 fps 3 RATE: 13.771623419264044 fps

pron commented 10 years ago

It seems like an OpenGL issue. Do you have recent driver for OpenGL 3? The demo uses a geometry shader.

BTW, the use of such advanced GL features is not at all necessitated by the program. All actual processing is done on the CPU; nothing but the graphics is done on the GPU. We just wanted the CPU to do as little rendering related stuff as possible, so that it would be free to do all the logic -- hence the geometry shader.

vocsong commented 10 years ago

Thanks. Updated Driver and it worked.