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
Support / Re: trying to get default shader code
« on: August 13, 2020, 07:58:53 pm »
adding "/" to file name solved my problem, thank you !

2
Support / Re: trying to get default shader code
« on: August 13, 2020, 06:31:09 am »
hi,
i know i can get code from jar file using winrar, but that's not my intention.
i want to let my app read shader code then modify something in it , then create another shader.
now the problem is how to read the source code into my java program.

3
Support / trying to get default shader code
« on: August 12, 2020, 12:46:15 pm »
hi Egon,
i try to modify some code of default shader by java programming.
when i call getshadercode , program crashes, but my app can work with default shader, why?
my code is like this:
locator=glslshader.getshaderlocator();
String s=locator.getshadercode("defaultVertexShaderFog.src");

4
Projects / Re: my project - Vehicle Simulation
« on: August 02, 2020, 11:14:17 am »
this is animated gif

5
thank you both .

6
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.

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

8
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.

9
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.

10
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?

11
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 }

12
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.

13
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.

14
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.

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

Pages: [1] 2 3 ... 14