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 - AeroShark333

Pages: 1 ... 4 5 [6] 7 8 ... 22
76
Support / Re: getRenderTarget method?
« on: November 01, 2020, 04:57:58 pm »
I'm not sure what you entirely mean...
I think it wouldn't be necessary as the engine doesn't create RenderTextures on its own that are bound to the FrameBuffer.
The only RenderTextures that the FrameBuffer uses are made by you, so you should have control over these RenderTexture instances..?
If no RenderTexture is set, "null" is used.

78
Support / Re: Crash (native)
« on: September 21, 2020, 07:51:01 pm »
Hmmm, okay...

I think I'll fix it with:
Code: [Select]
frameBuffer.compileShader(shader, null);
                    frameBuffer.setBlittingShader(shader);
                    frameBuffer.blit(brightness, 0, 0, 0, 0, 2, 2, false);
                    frameBuffer.setBlittingShader(null);
to test every shader. This does seem to trigger errors/crashes and works for Object3D shaders too.

That way I can still catch the RuntimeException from World.renderScene/World.draw whenever it happens and not needing to blame it on faulty shaders because those can be checked beforehand now.
I'm still guessing the exception is thrown due to context pause/resume/change but I'm not entirely sure.

79
Support / Re: Crash (native)
« on: September 21, 2020, 03:40:21 pm »
I'm guessing then it's either context change, resuming of renderer or pausing of renderer...
I don't think it could be anything else..?

I believe I did have some issues with NullPointerExceptions before when resuming/pausing/changing context. I did catch it before and if I remember correctly the problem would fix itself..? So the NPE's would disappear shortly after such events if I remember correctly. But I removed catching the error/exception in this version because it also caught shader crashes which I didn't want to catch.

Is it possible to 'test' a written shader beforehand (when loading)? That it compiles well and could work well? I think I tried FrameBuffer.compileShader before but it doesn't throw a crash or error..?
Only when the Object3D, which is using the GLSLShader, is visible it'd crash.

I guess I could ignore it for now as it's only one occurrence...
But yeah, just letting you know

80
Support / Re: Crash (native)
« on: September 21, 2020, 03:04:28 pm »
I'm using the latest beta (which has 8 texturelayers support)
I'm only using a single light source at [0,0,0], which doesn't ever change actually...

I don't think I'm changing any lighting in any other thread actually...
I believe the only thing that could be altered from other threads that might consider the Object3D is: camera position/orientation and shader variables (uniforms).

81
Support / Re: Crash (native)
« on: September 21, 2020, 02:30:57 pm »
Judging from the line in World, which causes the actual problem (1095), there should also be this output somewhere in the log:

Quote
There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!

Are you any chance modifying the world's collection of objects in some other thread like when a touch event happens?
I think that line is only printed with a NullPointerException but I'm not sure about this RuntimeException...

I'm not modifying the world's collection of objects at that point any more... So I am confused...

I don't have access to any other logs however... So I'm puzzled...
I wonder what the Object3D.java:6595 line is all about though

82
Support / Re: Crash (native)
« on: September 19, 2020, 04:52:58 am »
Offtopic but any clue what could cause this crash?

Code: [Select]
java.lang.RuntimeException:
  at com.threed.jpct.Object3D.render (Object3D.java:6595)
  at com.threed.jpct.World.renderScene (World.java:1079)
  at com.aeroshark333.artofearthify.lw.ArtOfEarthify.onDrawFrame (ArtOfEarthify.java:2331)
  at com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame (LiveWallpaperRenderer.java:73)
  at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1571)
  at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1270)
  at com.threed.jpct.Logger.log
  at com.threed.jpct.Logger.log (Logger.java:150)
  at com.threed.jpct.World.renderScene (World.java:1095)
  at com.aeroshark333.artofearthify.lw.ArtOfEarthify.onDrawFrame (ArtOfEarthify.java:2331)
  at com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame (LiveWallpaperRenderer.java:73)
  at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1571)
  at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1270)

Device: Samsung Galaxy S8, 3GB RAM, Android 9 (not my device)

83
Support / Re: accessing sampler2D in vertex shader
« on: September 09, 2020, 04:55:02 pm »
I have tried myself and it should work (usually)...
Though I'd recommend using the 'additional color' variable you can assign to Object3D's, if you only want to use a single color.
Since not all devices allow texture access in the vertex shader stage.
However, these days I believe you can assume most devices do support it.

84
Projects / Re: Art of Earthify (3D live wallpaper)
« on: August 29, 2020, 01:24:58 pm »

85
Support / Re: Fitting an object inside the screen.
« on: August 28, 2020, 07:54:08 pm »
I don't see anything particularly wrong with it..? But it might be me...

Perhaps you could try playing with this:
Code: [Select]
Config.defaultCameraFOV = 0.5f; // default = 1.25fMake sure to call this before you're creating your camera/world.

86
Support / Re: Increase number of texture units
« on: August 26, 2020, 09:24:41 am »
can you use while loop?
int i=lightcount; while (i>0) { do something; i--; }
i never used a loop though.
using variable in array seems fine for me. i did something like this:
 int i=int(position.x); position.x=uniform[i*3+1];
I don't think that'd work for the general case.
Especially the "uniform[i*3+1]" part probably would not work.
That's because "i*3+1" is not a constant variable but a dynamically assigned one.
The reason why it might work for your device(s) is probably because of what I mentioned in my previous post. I believe more and more devices these days do support it, though. However, still not always... (It could be a driver bug too but I'm not sure why this is an issue for some devices). I have had report crashes in the past on the Google Play Store Console when I used a for-loop and accessed a variable in an array using a non-constant variable.

I believe one of the better solutions can be found here (under Edit2): https://stackoverflow.com/questions/16039515/glsl-for-loop-array-index

87
Support / Re: Increase number of texture units
« on: August 25, 2020, 01:49:04 am »
I suppose because the default shaders use an 'unwrapped' for loop, it'd be annoying to change it all.
Yes, I had to do that because using the index from a loop didn't work. I can't remember if in general or only on some devices (more likely), but that's how it is now.
Actually I believe it is generally like that. GLSL doesn't seem to allow non-constant variables for accessing arrays or something. I believe some devices might support it because they've added the support but overall generally not.

88
Support / Re: Increase number of texture units
« on: August 24, 2020, 11:11:19 am »
After looking at the example, I tried it myself with the updated version.
The example seemed pretty straightforward for how it'd work with 8 texture layers.

I suppose because the default shaders use an 'unwrapped' for loop, it'd be annoying to change it all.

Anyway, as expected, it works like a charm for my use case! :D
Thank you so much for your time and effort!

89
Support / Re: Fitting an object inside the screen.
« on: August 20, 2020, 08:29:30 am »
Hello,

Whether it fits on the screen or not properly depends on the FOV too.
3 implementations I can think of:
- Complete calculation of where the camera should move to using FOV, bounding box coordinates and screen resolution so it all fits in screen. I believe you can find the ideal position for the camera that way
- Reproject bounding box coordinates to screenspace and see if the coordinates are on the screen or out of the screen. First, you should probably zoom in untill one of the coordinates falls out of the screen size in screenspace. Then zoom out again until all bounding box coordinates are in the screen size in screenspace.
- A little more hacky but to find a correlation between bounding box size (largest distance I'd go for) and zoomfactor. Probably this option is easiest

Good luck

I hope this is helpful

90
Support / Re: place an object to top part of the screen
« on: August 18, 2020, 02:28:28 pm »
Ah yes, you can of course also scale up the Object3D instead of moving the Camera closer.

Well, no problem for the help, I'm glad you got it sorted :)

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