Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - EgonOlsen

Pages: 1 ... 4 5 [6] 7 8 ... 823
76
I believe jPCT has support for mipmapping but I've found it a little buggy for myself... (Or I'm just not sure how to make use of it properly)
It's actually a hardware thing. If it doesn't work, it's a driver thing o, on very old devices, an issue with the graphics chip. But other than that, it should work just fine.... ???

77
Support / Re: Diffuse vs. Specular light color
« on: November 03, 2021, 03:38:31 pm »
Maybe that's the best approach after all. Just take a fitting default shader and modify it to do what you want. After all, you might want to do that anyway, because the specular implementation actually isn't that great IIRC and more of an afterthought. I didn't really expect it to be used by anybody, to be honest... ;)

The changes that you suggested would partly break compatibility with desktop jPCT as well.

78
Support / Re: Diffuse vs. Specular light color
« on: November 02, 2021, 07:33:32 am »
Are you using your own shaders or the default ones?

79
The lookAt()-method is prone to this flipping issue, because of the way in which the algorithm works. There's another method in Matrix that might help:

https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Matrix.html#setOrientation-com.threed.jpct.SimpleVector-com.threed.jpct.SimpleVector-

Assuming that you have the direction vector and also have/can create the matching up vector, it returns a rotation matrix, that aligns an object with these vectors. If you invert this matrix, you get something that you can feed into the camera as a view matrix using setBack(<Matrix>)...I guess... ;)

80
Support / Re: Light source every direction?
« on: October 25, 2021, 04:31:00 pm »
I don't want the shadow or the part where the light isn't reached to be dark.
I'm not sure if I understand, what you want. Without shadows, there's no light. If you want something to be uniformly "lit", you can adjust the ambient light's intensity and/or color. You can also give an object an additional color: https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setAdditionalColor-com.threed.jpct.RGBColor-

Maybe that helps? In general, all parts that aren't lit directly by a light source still have the ambient color and the additional color.

81
Projects / Re: Art of Earthify (3D live wallpaper)
« on: October 24, 2021, 03:20:32 pm »
Looks stunning.

82
Support / Re: Light source every direction?
« on: October 24, 2021, 03:20:05 pm »
You can't, because that's the way in which lighting works as it takes the angle between a vertex normal and the vector from the light source to that point. In case of backfaces, this angle is larger 90° hance the darkness. Would it be otherwise, then there would be no lighting at all, because it would never get darker.

83
Support / Re: Collision between two objects
« on: October 24, 2021, 03:17:54 pm »
You have to enable collisions on the object to be registered. Maybe this helps: https://www.jpct.net/wiki/index.php?title=Collision_detection

84
Support / Re: Vertices only visible in certain camera angles
« on: October 16, 2021, 03:59:05 pm »
I see. jPCT-AE isn't thread safe in a way that it can render into multiple views from different threads at the same time. The reason for this dates back to the early days of Android where performance was largely hindered by the JIT-less Dalvik VM and it's awful garbage collection behaviour. You might want to try to add a static sync object to your class, like

Code: [Select]
private final static Object SYNC = new Object();

and then wrap your rendering code into a synchronized block like so:

Code: [Select]
synchronized(SYNC) {
            if (touchTurn != 0) {
                object3D.rotateY(touchTurn);
                touchTurn = 0;
            }

            if (touchTurnUp != 0) {
                object3D.rotateX(touchTurnUp);
                touchTurnUp = 0;
            }

            buffer.clear(back);
            world.renderScene(buffer);
            world.draw(buffer);
            buffer.display();
}

Yes, that's an awful hack and it might not even work properly, but there's no other chance to make jPCT-AE behave when you are doing the rendering in parallel. Another option is to use one view and either only display one model at a time or render them both into a texture and blit the result onto the screen to simulate the two different views. But that leaves you with managing touch events and such for both simulated views and such annoyances.

85
Support / Re: Vertices only visible in certain camera angles
« on: October 16, 2021, 11:46:43 am »
"It behaves weirdly" doesn't really mean much. I can't possibly help based on this alone. Can you provide more details about what's going on exactly?

86
Support / Re: JPCT and Jide Docking Framework
« on: September 09, 2021, 11:05:23 am »
Oh, and one other thing: You can (and should) remove this line from the Renderer class:

Code: [Select]
_buffer.enableRenderer(IRenderer.RENDERER_OPENGL);

It's not needed here and will bite you once the window has the same dimensions as a valid fullscreen video mode by some coincidence.

87
Support / Re: JPCT and Jide Docking Framework
« on: September 09, 2021, 11:02:51 am »
The white box appeared after setting Config.glUseVBO and Config.glVertexArrays both to false. But that's not a good option, because it hinders performance and doesn't really help anyway.

About the exception: Actually, that's a NP in LWJGL, not in jPCT. I think it's a race condition when the AWT thread is still paiting while you switch the buffer in some other thread. This might cause LWJGL to lose the context und crash.

You somehow have to make sure that no painting happens when switching or switch in the AWT thread (an IPaintListener can help with that)...but I'm not sure that the latter is a good idea though.

88
Support / Re: JPCT and Jide Docking Framework
« on: September 08, 2021, 01:54:53 pm »
Yes, I did. I played around with it, but I can't see anything wrong in the way in which jPCT handles this. I think that this is either an issue with LWJGL's AWTGLCanvas or Jide is doing some hacky things to work its magic that interfere with what LWJGL expects from AWT/Swing.

I managed to configure jPCT in a way that at least the box shows up, but the colors were all white after an undock. I think what happens here, is that the GL context that is bound to the AWTGLCanvas by some magic is lost when Jide undocks the canvas. When talking to an invalid context, it often happens that some things still work while others fail. This is more a driver bug than a feature, because actually, rendering into an invalid context should give you no rendering at all.

If that's the issue, I think that recreating the FrameBuffer actually is the correct solution here.

89
Support / Re: JPCT and Jide Docking Framework
« on: September 07, 2021, 08:15:38 pm »
You can try to call dispose on the renderer and create a new one. I'm not sure how the underlying AWTGL implementation handles this though, but it's worth a try. Feel free to send me your test as well, so that I can see for myself and at least admire the problem... ;)

90
Support / Re: JPCT and Jide Docking Framework
« on: September 02, 2021, 07:14:09 pm »
Another difference is, that you compile the non-batched objects as dynamic, but not the batched ones. Have you tried to use the exact same compile-call for the batched ones as for the non-batched ones?

Pages: 1 ... 4 5 [6] 7 8 ... 823