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

Pages: [1] 2 3 ... 14
1
Hi Egon,
when i want to move some vertices of an object, the 1st method that comes to mind is using a shader.
but sometimes i dont like to write a new shader.
Animation and IVertexController seem to be my options.
but i worry about the performance.
among the 3 methods, is shader potentially the fastest one?
assuming:
the movements are simple maths.
i need to deform the object in every frame.
the quantity of moving vertices is below 100.

2
Support / Re: relationship between Object3D and Light
« on: June 05, 2020, 08:28:02 am »
it's good enough as long as the user can write clear code to manage it.
thanks.

3
Support / Re: relationship between Object3D and Light
« on: June 05, 2020, 05:15:30 am »
i thought of a method that saves memory and make program code more clean: sharing list between objects(or lights).
often several objects (or lights) have the same setting, they only need one list.
a good way in practice is like this: user creates a list, then set the list to several objects.

4
Support / Re: relationship between Object3D and Light
« on: June 05, 2020, 12:03:17 am »
thanks Egon, it works.
please also add object list for Light.
the logic is this, if a light has list and the object is not in list , the light is off for this object.

this test is needed only if object has null list.
if object1 has light1 in list and light1 has object2 in list, light1 in fact can lit object1 and 2.
or you may have other way to cross check these 2 types of list.

please use null list if list is empty, because null doesn't refer to additional memory space.

5
Support / Re: relationship between Object3D and Light
« on: June 04, 2020, 08:53:34 am »

when the engine select Lights for object3d, (hence there is setDistanceOverride method) can you do this ? -
Code: [Select]
if (there is light list) test lights in list;
else test all lights in World;
Code: [Select]
if (this light has object list) { if (object is in list) light on; else light off }
No, not really. Because these lights still have to be part of the World or otherwise, they won't be processed properly. But if they are part of the World, they will have an influence on all other objects as well. They would limit the lights for one object but not for all the others, which is actually what you want. You could of course use this to add a light list to ALL objects managing them all by yourself, but wouldn't that be a bit tedious?

my plan is this: obj1 without light list, engine process all lights[light 1 2 3 4 5 ... ]; obj2 has list [light1 and 2], engine process light 1 and 2 when drawing obj2; obj3 has list [light 2 and 3], engine process light 2 and 3 when dtawing obj3.
if lights cannot be isolated, can the engine modify the strength of unwanted lights to zero when drawing corresponding object?

6
Support / Re: relationship between Object3D and Light
« on: June 03, 2020, 05:51:02 pm »
for example, a scene is divided into rooms, a light in a room should not affect objects in another room, even if the light is near to the other room. with Object3D list for Light, this scene can be setup easier.
The things is, it's not designed that way. The idea was to have a world filled with lights, just like the real world, and objects moving around which will in turn be affected by the closest light sources. Lights per object were never planned. However, I see your point. I'm just not sure how to handle this. I can't add a list of lights to Object3D, because that would break too many things in the lighting code. The "best hack" that I can come up with ATM is to extend the IRenderHook-interface (or create a LightingHook interface) that allows you to suppress some world lights for an Object3D. That's not that great either, but it would fit the engine's render pipeline...I guess...I have to think about this some more...

when the engine select Lights for object3d, (hence there is setDistanceOverride method) can you do this ? -
Code: [Select]
if (there is light list) test lights in list;
else test all lights in World;
Code: [Select]
if (this light has object list) { if (object is in list) light on; else light off }

7
Support / Re: relationship between Object3D and Light
« on: June 03, 2020, 02:18:32 pm »
i am not sure about iRenderHook solution, but custom shader can work. custom shader can do a lot of things, but it is like last resort for me - i am not into graphics.
i think this problem can be solved easier from engine level. and i think relating Object3D and Light is a good thing, it gives more choices to the engine users. i can think of other cases where it is useful.
for example, a scene is divided into rooms, a light in a room should not affect objects in another room, even if the light is near to the other room. with Object3D list for Light, this scene can be setup easier.

8
Support / Re: relationship between Object3D and Light
« on: June 02, 2020, 09:22:23 pm »
right, turning off all lighting for an object is not what i want.
in my case , there is sun light as a base, then i add a light below an object, to simulate reflected light from the ground, and it's different from ambient lighting. and i want this only for the main character - for performance reason.
there can be other lights in the scene, so setMaxLights(1) for other objects is not a solution either.
this is not important though.

9
Support / relationship between Object3D and Light
« on: May 29, 2020, 08:27:51 pm »
Hi,
today i thought of a situation that within several object3d's i want a light to affect only one of them(or several of them).
so i wish there is Light list for Object3D or Object3D list for Light.
setMaxLights() and setDistanceOverride() methods are not enough in this case, because a light is far away from the object3d if i need parallel, directional light, a light can affect any object in range.
moving Object3D to another World also creates more trouble.
using light can't be substitude by additional color, because light has direction.

10
Projects / Re: my project - Vehicle Simulation
« on: May 11, 2020, 06:28:16 am »

11
phone rotates or resumes causes framebuffer change, gl context lost...
in that situation, framebuffer must be re-created, and any render-to-texture must be rendered again.
and if texel of a texture is not kept in system ram, you need to reload the texture from file.
in Config class and Texture class , there are some setting you must know about - you are new to the engine, it will take time for you to get familiar with the engine. i used jpct a few years and there are something i still don't know.

12
Support / Re: is point sprite supported?
« on: April 23, 2020, 11:52:58 pm »
i have tried using an object3d to hold 100 particles (my cloud effect) , using shader/uniform to locate every particle.
in this method, jpct doesn't need to sort all particles, only sort the object3d in a World. when particles within an object3d are close to each other, and the scene is not too complex, this method doesn't often cause sorting error, and it  saves sorting time, 1 vs 100(or 20 vs 2000) candidates to sort in my case, that should be quite some time.
imagine i want a particle emitter with varying quantity of particles, sometimes a few, sometimes 500 particles, adding/removing them as individual object3d, or only setting visibility while keeping them in a World,  not something i would prefer to do.
if they are only 1 object3d, i can use shader to easily make some of them disappear.
and 500 draw calls cost much more time than 1 drawcall.
so these are the benefits of using object3d like an emitter. not always good, but in some case, it's very good.
in my scene, there are often 20 clouds (2000 particles) on screen , my app runs 30fps without problem if they all look small on screen. test device has quadcore A53 which is low-end device now.
using quads can do it, but point sprites can save calculation.

13
Support / Re: Minor blitshader bug
« on: April 23, 2020, 05:10:17 am »
what about flush() or sync() ?

14
Support / Re: is point sprite supported?
« on: April 23, 2020, 05:06:26 am »
what about the point mode in drawWireframe() ?
the object is still made of polygons, but only points are rendered.

15
Support / Re: a suggestion for the future of JPCT-AE
« on: April 22, 2020, 06:01:11 pm »
i think i haven't learned enough about the engine - i have only used the simpler portion of the engine.
i just read the java doc and i saw the setExternalId() method.
since you say you have added options for people who want more direct control, i think all i would need are already in the engine.
i think JPCT misses some showcase of advanced effects. i used to use Panda3d, in its community there are showcase of advanced rendering techniques, such as physics based rendering , which looks modern.
i am not graphics enthusiast so i don't do advanced graphics effects. i use JPCT-AE because it's convevient and i don't aim for pretty graphics.
in Projects page of the website, there are screenshots of many projects, but there are no highlights of graphics effects, it's hard for me (or some other people) to find out the best effects JPCT can do. some people, such as me , at the beginning, would think JPCT is an engine which can do simple graphics. but that is not the whole truth.
perhaps more efforts in showcasing would help people know better about the engine?

Pages: [1] 2 3 ... 14