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 2 3 [4] 5 6 ... 22
46
Support / Re: Diffuse vs. Specular light color
« on: November 06, 2021, 08:52:36 am »
Okay, thank you! I'll probably do that then

Just out of curiosity, would the first suggestion also break things..?
Quote
- Allow Object3D#setAdditionalColor(r,g,b) to have negative values for r, g and b so they can cancel out the World's ambient lighting (rather than having to do it in the opposite way...)

In the shader it seems that
Code: [Select]
vertexColor = ambientColor + additionalColor;I don't think shaders would mind additionalColor to be negative valued

47
Hey!

I believe the distance-based texture quality thing you're talking about could be done with mipmapping with distance-based level of detail (LOD) texture fetching.

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)
I'm not sure if default shaders use this...

I believe for this technique, you should take into account that twice the memory consumption of the base texture is necessary. (With a peak of 4 times the memory consumption of a single base texture with default jPCT texture loading (I'm not entirely sure about this, however)).

LODResolution
Level 0 (base)8x * 4x
Level 14x * 2x
Level 22x * 1x
Level 31x * 0.5x
Level 4etc...
with x being some resolution scaling factor...

I believe if your texture loading 'algorithm' is efficiënt you could probably get away with loading textures at at a maximum peak memory consumption of just twice the base texture memory consumption.

The memory consumption of a single texture can be calculated approximately as follows:(https://www.jpct.net/wiki/index.php/Reducing_memory_usage)
Remember: 8 bits = 1 byte

Higher color quality:
For 32-bit: width * height * 4 bytes
For 24-bit: width * height * 3 bytes (no alpha)

Lower color quality:
For 16-bit: width * height * 2 bytes
For 12-bit: width * height * 1.5 bytes (no alpha)

So for example:
Let's say you have a 32-bit texture of 8192 by 4096 pixels.
The memory consumption can be calculated with the above formula.
This would result in approximately 130 MB.
When doing mipmapping, the memory consumption will be nearly doubled, so that'd be 260MB.
I believe that with jPCT's default texture loading algorithm, it'd be doubled in peak memory consumption for both scenarios.
260 MB without mipmapping, 520 MB with mipmapping.

Maybe something else that could be useful:
https://www.jpct.net/forum2/index.php/topic,5135.0.html
I guess it could be extended to allow for more efficient texture loading and also mipmapping... Mind that Android makes a distinction between loading textures to (J)VM memory and native memory, where the first is usually more limited...

Hope this was useful in some way! :)

48
Support / Re: Diffuse vs. Specular light color
« on: November 02, 2021, 03:01:59 pm »
Default ones but I guess I could write custom shaders too to work around this

49
Support / Diffuse vs. Specular light color
« on: November 01, 2021, 07:12:56 am »
Hello,

I was trying to create a glass/mirror-like object.
For this I needed to get rid of the World's ambient lighting and the Light's diffuse lighting.

I was able to get rid of the World's ambient lighting (which affected all objects in the scene unfortunately, but for those objects I used Object3D#setAdditionalColor again to mimic ambient lighting)
However, I wasn't able to change the diffuse nor specular color seperately..? Or I wouldn't know how to...
The Light class has a Light#setIntensity() method but I suppose that works on both diffuse and specular color.

According to the Wiki, the shaders do seem ready to support distinctive diffuse and specular lighting colors
(https://www.jpct.net/wiki/index.php/OpenGL_ES_2.0_support)
Code: [Select]
uniform vec3 diffuseColors[8]; - The diffuse color of each light source.
uniform vec3 specularColors[8]; - The specular color of each light source.
It seemed a little odd to me that these variables are seperately declared there but they seem to always be the same arrays basically..? (If I'm not mistaken and didn't overlook something)

I believe the following three (or four) things would help me a lot:
- Allow Object3D#setAdditionalColor(r,g,b) to have negative values for r, g and b so they can cancel out the World's ambient lighting (rather than having to do it in the opposite way...)
- Add Light#setSpecularIntensity(r,g,b) to control specular lighting intensity seperately
- Add Light#setDiffuseIntensity(r,g,b) to control diffuse lighting intensity seperately
(- Perhaps extra Object3D lighting modes (ambient only, additional only, diffuse only, specular only; and different combinations of these 4).)

Thank you for your time :)

Cheers,
AeroShark333

50
Support / Re: Light source every direction?
« on: October 31, 2021, 10:31:56 pm »
I just realized there's also:
Code: [Select]
World#setAmbientLight(255,255,255);... Might be useful

51
Support / Re: Light source every direction?
« on: October 25, 2021, 04:35:15 am »
Maybe you could have 0 light sources and use https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setAdditionalColor-com.threed.jpct.RGBColor- to 'add' your own lighting...
But I'm not sure if this would give the desired result...
I believe the best way to work yourself around the default lighting system of jPCT is to write your own shaders which take care of the lighting themselves... Could be tricky however

52
Projects / Re: Art of Earthify (3D live wallpaper)
« on: October 21, 2021, 11:43:26 am »
https://imgur.com/a/JCB5jh9

Just to show the progress...

53
Support / Re: 3ds Object not displayed correctly
« on: October 20, 2021, 07:00:58 pm »
I assume your model should be fine...
You probably have to tweak jPCT a little so it shows all polygons (or polygons in the far-plane) properly

I'd recommend tweaking with these options:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#maxPolysVisible
Code: [Select]
Config.maxPolysVisible = 2048;
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#nearPlane
Code: [Select]
Config.nearPlane = 1E-3;
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#farPlane
Code: [Select]
Config.farPlane = 1E9;

54
Projects / Re: Physics example
« on: May 29, 2021, 10:18:49 pm »
Thanks, I hope you see a cool game this year.
I need something like object.clearRotation and preferably object.clearTranslation to apply to sourceMesh.clearRotation and sourceMesh.clearTranslation.
Good luck ;)

55
Projects / Re: Physics example
« on: May 29, 2021, 09:12:28 pm »
I believe if values are repetitively added, I suppose you should do an inverse operation at the end of what you are doing..? So maybe the inverse matrix or something would help (Matrix.invert()).

What you could also do is not apply the initial rotation at first but only at the end maybe. So after your vertex controller things..?

I'm not sure if I entirely understand your problem. It's hard to understand if you don't see what's happening

56
Projects / Re: Physics example
« on: May 29, 2021, 08:28:16 pm »
When i do - aaa[f].matMul(cyl7.getRotationMatrix());   // or  aaa[f].rotate(cyl7.getRotationMatrix());         
                    X77[f] = aaa[f].x + cyl7.getTranslation().x;
                    Y77[f] = aaa[f].y + cyl7.getTranslation().y;
                    Z77[f] = aaa[f].z + cyl7.getTranslation().z; all good(coordinates,and the shape of the object) but object wrong(infinite) rotation,instead of the original turn
Then do you need the inverse matrix of the rotationmatrix? I believe there's an option... You can also manually align the sourcemesh to the object mesh I guess...
I'm not sure if it is easily possible

57
Projects / Re: Physics example
« on: May 29, 2021, 02:07:10 pm »
Maybe this would work:

aaa[f].matMul(cyl7.getRotationMatrix());
Then:
aaa[f].matMul(cyl7.getTranslationMatrix());

I'm not sure if this will work... I can't test this out right now, but it would somewhat make sense I hoped... 😅 Otherwise, maybe Egon has better ideas

58
Projects / Re: Physics example
« on: May 29, 2021, 12:20:59 pm »
I thought you only wanted to look up the coordinates of each vertex in world space rather than object space... I don't think the destination mesh should be given in world space coordinates, however...

59
Projects / Re: Physics example
« on: May 27, 2021, 09:41:18 pm »
How get global(world) coordinate of vertex from mesh?In GenerateVertexController
I guess you'd need to pass your Object3D instance to your custom implementation of GenericVertexController.
Then using Object3D.getTransfornedCenter() to find the mesh's center in world coordinates. And using the rotations applied to the Object3D and GenericVertexController.getSourceMesh() to find the individual world coordinates.
...

However, maybe multiplying the sourceMesh with object3d.getWorldTransformation() could work too... Seems to go from object space to world space..?

60
Projects / Re: Physics example
« on: May 22, 2021, 12:12:17 pm »
I believe you would want the 'joints' to appear smoothly visually?

I guess you could try this: https://github.com/raftAtGit/Bones
(see also: https://www.jpct.net/forum2/index.php/board,10.0.html)

I am not entirely sure how it works but I believe you'd need one complete mesh of the person (including arms, legs, etc.)
And somehow define the body parts using the library

Pages: 1 2 3 [4] 5 6 ... 22