Main Menu

Recent posts

#21
Support / Re: GLB
Last post by EgonOlsen - December 21, 2023, 06:56:41 AM
Nice one!
#22
Projects / Re: OpenRoad - Arcade racing
Last post by MichaelJPCT - December 20, 2023, 06:30:55 AM
Great!
i also wished for a game that has auto-generated roads, preferably a rally game, so i would have unlimited stages to drive on. but that project would be too difficult for me.
#23
Support / Re: GLB
Last post by AGP - December 19, 2023, 11:20:24 PM
#24
Projects / OpenRoad - Arcade racing
Last post by EgonOlsen - December 09, 2023, 12:20:24 PM
Long time no new project here...so I thought that I might as well contribute something.

It's not really a "project", but something that I'm working on from time to time. It started out as an experiment to see, how feasible it is to generate a road based on the random number generator alone. Over the months, it turned into something that you can actually "play" albeit it's far from being a game of some sort.

The road and the AI vehicles are all generated, nothing has been placed by hand. It has basic sounds, arcade like vehicle controls, traffic and a very crude collision "model".

Here's a video: https://youtu.be/o3MthgPRDsE?si=GEl1AJA2DRFxJCaJ

And this is how it looks:



#25
Support / Re: Obtain normals to adjust v...
Last post by EgonOlsen - November 28, 2023, 07:35:36 AM
If that's the case, I guess that there must have been a reason for it... ;)

...I just can't remember it...
#26
Support / Re: Obtain normals to adjust v...
Last post by AeroShark333 - November 27, 2023, 07:58:18 PM
Quote from: EgonOlsen on November 27, 2023, 10:57:32 AM
I see. If you call refreshMeshData() on the controller, the newly calculated normals should be updated in the controller and you can obtain them from there.
Thank you, works perfectly! :D

Also, this might be a minor bug: I think the 'shininess' value is not seem to be passed to the fragment shader (while the other uniform variables from the default vertex shader seem accessible though in the fragment shader). I don't need this as I can put custom shader code anyway... But I thought it would be nice to know.
#27
Support / Re: Obtain normals to adjust v...
Last post by EgonOlsen - November 27, 2023, 10:57:32 AM
I see. If you call refreshMeshData() on the controller, the newly calculated normals should be updated in the controller and you can obtain them from there.
#28
Support / Re: Obtain normals to adjust v...
Last post by AeroShark333 - November 24, 2023, 02:56:35 PM
Hmmm, I'll try to explain better:

Currently, I have an animation where I deform the mesh (through its vertices).
I can't calculate the normals in the vertexcontroller because they depend on neighboring vertices.
However, if I use Object3D.calcNormals() after applying the vertexcontroller, then I suppose I will have the normals for the deformed mesh.
Is it possible to obtain these normals for future use, so in that case I could feed them into the vertexcontroller instead of having to call calcNormals() again.
Essentially, I am trying to create a cache of normals to avoid having to call calcNormals() during runtime.

I hope this makes sense...
#29
Support / Re: Obtain normals to adjust v...
Last post by EgonOlsen - November 24, 2023, 07:51:31 AM
I'm not sure what you mean exactly...the vertex controller can access the normals already, so you can modify them there. The issue with that is, as the docs state, that this calculation isn't trivial, because vertex normals depend on adjacent polygons as well.

What do mean by

QuoteIs it possible to obtain the calculated normals so they could be fed into the vertexcontroller immediately?

Which calculated normals?
#30
Support / Obtain normals to adjust verte...
Last post by AeroShark333 - November 21, 2023, 05:52:46 PM
Hello,

Currently I have an Object3D with a vertexcontroller attached to it. (Modify = false mode)
The vertexcontroller only changes the vertices positions of the mesh and doesn't touch the normals.
In the draw method I currently do the following three operations:
1. Apply vertexcontroller
2. Object3D#touch
3. Object3D#calcNormals

Is it possible to obtain the calculated normals so they could be fed into the vertexcontroller immediately? I wish to save calculation costs by not having to calculate the normals every frame.
In a sense I imagine I could pre-compute the normals with Object3D#calcNormals and then save the normals to be reused in the vertexcontroller. I looked at polygonmanager but no luck there...

Thanks in advance!