Main Menu

Recent posts

#1
News / Re: Forum upgraded to 2.1.4
Last post by AGP - November 24, 2024, 12:32:49 AM
Now all we need is support for a current lwjgl. ; )
#2
News / Forum upgraded to 2.1.4
Last post by EgonOlsen - October 14, 2024, 04:33:43 PM
Eventhing looks new and shiny now!
#3
Support / Re: Polygon limitations on scr...
Last post by Lima - July 31, 2024, 01:39:33 AM
Thank you!! You're a lifesaver! I had set the far clipping plane very close and removed some of the objects to "kind of" solve this, but for my purposes is not ideal, I really needed to put more things in scene.

p.s.: Again! Can't forgive myself for not seeing that in the documentation.
#4
Support / Re: Polygon limitations on scr...
Last post by EgonOlsen - July 30, 2024, 10:50:01 AM
There is a setting for max. objects (it's called differently for historic reasons though): https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#maxPolysVisible
#5
Support / Polygon limitations on screen
Last post by Lima - July 28, 2024, 11:56:40 PM
I have this terrain with some planes scattered on it. About 2000 planes. when the camera faces many of them, the terrain and my player model stop being rendered. I have to make the camera look at where they aren't in order to be able to see the terrain and the player model again. Any tips?
Also, the planes were cloned using the cloneObject() method. I don't really know what to do now.

few planes on camera:
https://imgur.com/k3PNGug

many planes on camera:
https://imgur.com/T18Kh3r

update:
It seems to be a limit of objects on screen; when I move the camera some planes disappear e others appear, for some reason my player model and the terrain are not a priority and are ignored when there are many planes on screen. I removed some of the copies and this no longer happens. But I still would like to place many of them around my map.
#6
Support / Re: 3D modeler app made with J...
Last post by MichaelJPCT - July 05, 2024, 02:09:23 PM
Hi, i have worked on the new project for some time, i think it can work, but it's not finished yet. here is a quick demo of what it would look like.
#7
Support / Re: setUniform with int array ...
Last post by MichaelJPCT - April 26, 2024, 03:54:37 PM
Thanks Egon,
i found that setUniform(float array) can be used to set boolean uniform too, if the uniform in glsl program is written as 'bool'.

to AeroShark333:
i tried gles3.0 and i am quite sure the app was in es3, but i still can't use bitwise operation (shader doesn't compile if '&' is used).
i just used 3 as the argument when calling the setglesclientversion() method.
#8
Support / Re: setUniform with int array ...
Last post by AeroShark333 - April 25, 2024, 02:41:15 PM
Quote from: MichaelJPCT on April 24, 2024, 05:53:52 AM
another question , can there be uniform short array?
You can't specify different integers (byte, short, integer, long, etc.) but you can set the overall integer precision (but this is device specific...).
As of OpenGLES 3.0, you can do more with integers such as bit manipulation. So I could imagine you could store two shorts in a 32-bit integer variable. (idea can be extended to arrays, of course)
You'll need to make sure your renderer supports OpenGLES3.0 and the device also supports it (as well as bit manipulation).

Quote from: MichaelJPCT on April 24, 2024, 05:53:52 AM
another question , can a uniform array be longer than 1024 elements?
From my experience this is very device specific. Modern devices usually have allow for more than 256 uniform values.
That means that you should take around 240 as your uniform array size limit. (as other uniform variables are also counted for the device limit).
#9
Support / Re: setUniform with int array ...
Last post by EgonOlsen - April 25, 2024, 12:57:15 PM
Should be doable. You can implement an IRenderHook and attach it to the objects in question. In it, implement the https://www.jpct.net/jpct-ae/doc/com/threed/jpct/IRenderHook.html#setCurrentShader-com.threed.jpct.GLSLShader--method and then do something like:


int handle = GLES20.glGetUniformLocation(shader.getProgram(), "your_uniforms_name");
GLES20.glUniform1iv(handle, intArray.length, intArray, 0);


in it...that should work...I guess... ;)
#10
Support / Re: setUniform with int array ...
Last post by MichaelJPCT - April 25, 2024, 12:07:51 PM
i was thinking about more flexibilities of data format.
for example, since 'short' is not possible, i may use 1 int to store 2 short values. i could save some ram in this way.

but now i found a bigger problem:
i can't use bitwise operation in shader(like int&2 ). so i can't use 1 int to store 32 boolean values. and jpct-ae doesn't provide setUniform(string,bool val). i guess i could use 1 int to store 4 booleans by some calculation, but it's not convenient.

can i call GL functions directly so jpct-ae doesn't need to provide all possible signatures of setUniform?

Thanks.