Recent Posts

Pages: [1] 2 3 ... 10
1
Support / Re: setUniform with int array ?
« Last post by AeroShark333 on April 25, 2024, 02:41:15 pm »
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).

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).
2
Support / Re: setUniform with int array ?
« Last post by EgonOlsen on 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:

Code: [Select]
int handle = GLES20.glGetUniformLocation(shader.getProgram(), "your_uniforms_name");
GLES20.glUniform1iv(handle, intArray.length, intArray, 0);

in it...that should work...I guess... ;)
3
Support / Re: setUniform with int array ?
« Last post by MichaelJPCT on 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.
4
Support / Re: setUniform with int array ?
« Last post by EgonOlsen on April 25, 2024, 11:19:36 am »
No, there isn't. I guess, I never saw the need for it so I somehow overlooked it. Do you need support for this?

Internally, it's used (as you've noticed) for setting the blending modes, but that's the only part that uses it.

About the other questions:

  • There's no setter for short-arrays in the API, so I guess not...
  • I'm not limiting this, so I guess it depends on the GPU/driver what the limit is.
5
Support / setUniform with int array ?
« Last post by MichaelJPCT on April 24, 2024, 05:53:52 am »
hello Egon,
it seems that there is no setUniform(string,int[] val). but in java doc of glsl shader there is: uniform int blendingmode[4].
is that right?

another question , can there be uniform short array?
another question , can a uniform array be longer than 1024 elements?

thanks.
6
Projects / Re: Neuro Tennis
« Last post by aleks1283 on January 28, 2024, 03:14:05 pm »
It's a cool game but some things I noticed:

-> Is the game supposed to be played in landscape mode; I believe portrait mode might work as well
-> I found the controls a bit hard (on my Samsung Galaxy Note 9 (Android 11) the button hitboxes seem a bit too small that it doesn't always register my presses when I try to press a button)
-> Additionally, I think it would be nice to have gyroscope controls maybe for left and right movement (it would also reduce the amount of buttons on screen; or allow the remaining buttons to be enlarged)
-> Lastly, I am not sure about this but it feels like the ball speed does not reset to a slower speed once one of both players has scored... (this has lead to sometimes 3 goals in a row because there is not much time to react after a goal has been scored)
-> Another suggestion might be to let the ball start closer to the opponent instead of from the center of the screen (so that the ball travels a bit further and allows for a better reaction)


Hello. I made this application to study neural networks (although I didn’t implement in app), and if the game suddenly becomes popular, I’ll make your recommendations, thank you)))
7
Projects / Re: Neuro Tennis
« Last post by aleks1283 on January 28, 2024, 03:08:46 pm »
What's the minimum requirement for this game? I can't install it on any of my devices (granted, they are all a bit older now... ;D )...
Hi Egon, android 11+
8
Projects / Re: Neuro Tennis
« Last post by AeroShark333 on January 28, 2024, 02:23:59 pm »
It's a cool game but some things I noticed:

-> Is the game supposed to be played in landscape mode; I believe portrait mode might work as well
-> I found the controls a bit hard (on my Samsung Galaxy Note 9 (Android 11) the button hitboxes seem a bit too small that it doesn't always register my presses when I try to press a button)
-> Additionally, I think it would be nice to have gyroscope controls maybe for left and right movement (it would also reduce the amount of buttons on screen; or allow the remaining buttons to be enlarged)
-> Lastly, I am not sure about this but it feels like the ball speed does not reset to a slower speed once one of both players has scored... (this has lead to sometimes 3 goals in a row because there is not much time to react after a goal has been scored)
-> Another suggestion might be to let the ball start closer to the opponent instead of from the center of the screen (so that the ball travels a bit further and allows for a better reaction)
9
Projects / Re: Neuro Tennis
« Last post by EgonOlsen on January 28, 2024, 01:19:19 pm »
What's the minimum requirement for this game? I can't install it on any of my devices (granted, they are all a bit older now... ;D )...
10
Projects / Neuro Tennis
« Last post by aleks1283 on January 25, 2024, 08:14:33 am »
Pages: [1] 2 3 ... 10