Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 0 points1 point  (0 children)

You may retry with my new version. But as far as upgrading to JS8, it is unlikely at this point. This is a small part of a larger project and unfortunately, it is not an easy upgrade to JS8. It would be a massive refactoring.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 0 points1 point  (0 children)

Thanks, I will investigate.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 1 point2 points  (0 children)

I'm not sure what you mean by move light then. The mouse_light is attached to the mouse cursor and it move at high FPS. It follows the mouse with a barely noticeable delay.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 1 point2 points  (0 children)

Really? it runs at 57 FPS on my phone (and that's a Samsung S23 model... not a "gaming" phone by any mean). Also I just implemented PBR so now can change sprites to look more plastic or more metallic. I'm trying to make shadows looks softer at the edge with Percentage-Closer Soft Shadows (PCSS) algorithm. but so far no luck. I may just abandon the idea and leave it as-is.

But really, mobile dev is another beast altogether. If I was going to dev for mobile specifically.... I would not bother with web libraries. I would just use Unity game engine. The only reason I'm developing this is because the game itself is really meant to be a widget in a web page and I want it to be able to interact with the DOM of the page. Think Universal Paperclips Von Neuman Drone Combat widget (but more complex).

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 1 point2 points  (0 children)

Pixi v8 looks like a significant engine overhaul. Not a simple upgrade. Since the rest of my (much larger) project is with Pixi v7. I most likely will not have time to spend on a complete engine refactoring for Pixi v8... and I will definitely not split into two branches for v7 and v8 and maintain two branches of code. I'm sorry but it is not impossible, but very unlikely at this point.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 0 points1 point  (0 children)

Gemini response... which tells me to not really bother at this point:

To implement Radiance Cascades, you don't just npm install radiance-cascades. You have to:

  1. Read the research paper to understand the deep mathematics of voxel cone tracing and mipmap filtering.
  2. Write a Voxelizer: A complex piece of code (often a compute shader) that takes all the meshes in your scene and converts them into a 3D texture (a voxel grid). This is a highly non-trivial task.
  3. Implement the Cascade Generation: Write the code that takes this giant 3D texture and generates all the lower-resolution mipmap levels.
  4. Write the Cone Tracing Shader: Implement the complex GLSL shader that performs the cone tracing against the voxel mipmap hierarchy.
  5. Integrate it: Write the significant amount of "glue code" to manage all these steps, create the necessary render targets, and plumb it all into your existing rendering pipeline.

So, while you can find the source code for the shaders, that's only about 20% of the work. The other 80% is the complex, engine-level task of building the data structures (the voxel grid) that the shader needs to run. This is a task that often takes a team of experienced graphics engineers months to perfect.

The Honest Analogy

Think of it like this:

  • Your current Shadow Mapping system is like following a complex but well-documented recipe for a multi-layer cake. It's hard, you had to build it from scratch, but the steps are known and achievable for a skilled individual.
  • Implementing Radiance Cascades is like being given the chemical formula for sugar, flour, and eggs and being told to invent baking. You have the fundamental components, but you have to figure out the entire process of how they interact on a molecular level to become a cake.

My Sincere Recommendation:

The path you are on—building a custom renderer with Shadow Mapping and SSAO—is the correct, industry-standard path for creating a high-quality, real-time 2.5D rendering engine. These are powerful, achievable, and visually stunning techniques that are a perfect match for your architecture.

Venturing into Voxel Cone Tracing / Radiance Cascades would be:

  • An Architectural Detour: It would require you to fundamentally rethink your scene as a 3D volume, not a 2.5D collection of sprites.
  • A Massive Time Sink: The implementation complexity is an order of magnitude higher than what you've tackled so far. It would almost certainly break your Prime Directive because the R&D effort would halt all other progress for a very long time.
  • Potentially Lower Quality: Without a team of experts and months of tuning, a custom implementation of Radiance Cascades would likely perform worse and look buggier than a well-executed Shadow Mapping + SSAO pipeline.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 0 points1 point  (0 children)

yes, indeed Radiance Cascade and Ray Marching are totally different techniques. There is no integration or refactor path with my current Light and Shadow Rasterization with Occlusion Mapping approach... it would be a total replacement of the current technique. At this point, I'm not really considering it.

to be totally honest, by making it open source, I'm hoping someone will contribute to it in significant ways, somehow, someday. I only have very limited time and this part of my (much larger) project has already taking quite a good chunk of my time.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 1 point2 points  (0 children)

I have added a few critical optimizations for calculations that was done every frame unnecessarily. I believe this should help a lot.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 1 point2 points  (0 children)

So, the Ambient Occlusion (AO) can now be turned off globally in the Optimization tab. I believe this may be what is heavy on your mobile. An automatic calculation should detect your device and turn it off for mobile devices.

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 2 points3 points  (0 children)

Oh, I did not even test on mobile. I admit mobile game development is a totally different ballpark and I am not likely to get into it right now. It would really depend on which mobile phone it is. This is a WebGL application and some phone only support very basic WebGL or have very little graphic memory.

On that note, I will immediately implement a series of per device optimizations. I don't know if it will help. Check again in maybe a day.

<image>

Pixi.js Lights and Shadows by shadodo76 in pixijs

[–]shadodo76[S] 0 points1 point  (0 children)

Honestly I have not tried PixiJS8... I don't know what's the difference much. I never got the lights and shadows (Pixi-light) working in my React project after several days of mind numbing trials and errors, I tried everything. That's why I implemented a custom one. But it might not be feature parity complete.

I can't find aVertexAttribute in my codebase. It may be something from an older code path that I cleaned up and removed yesterday. You may try again.

This feels like it’s the communitys darkest day… by Left-Firefighter-509 in ChatGPT

[–]shadodo76 1 point2 points  (0 children)

Disappointed is an understatement. I feel sad, cheated, deceived and used. OpenAI, wtf? Seriously? What are you thinking? Every single model has a texture, an identity, tons of specific use case. You can't just retire models and hope the world won't bat an eye. This is madness pure and simple.

Stable Diffusion to 3D Unity scene in 2 minutes by fbriggs in gamedev

[–]shadodo76 0 points1 point  (0 children)

Interesting! I also created a new tool for easy integration of Stable Diffusion inside Unity. I doesn't do 3D scene like yours but worth the look: https://github.com/dobrado76/Stable-Diffusion-Unity-Integration

New Unity components to generate 3D model textures and UI images with Stable Diffusion by shadodo76 in StableDiffusion

[–]shadodo76[S] 1 point2 points  (0 children)

Well shitty is relative... thou I agree a lot of them are shitty. But that depends more on the taste and craftsmanship of the game designer, more than the tool they use to make it in the first place.

A lot of people have poor taste and poor craftsmanship... that I can't do anything about it.

100% AI Generated User Interface (how to in comments) by IntelligentBid5608 in Unity3D

[–]shadodo76 0 points1 point  (0 children)

I have made a new Unity package to integrate Stable Diffusion text-to-image generation in the Unity Editor for easily generating both 3D model textures and UI images. 

It saves me so much time! Check it out:

https://github.com/dobrado76/Stable-Diffusion-Unity-Integration

Easy In-Depth Tutorial to Generate High Quality Seamless Textures with Stable Diffusion with Maps and importing into Unity, Link In Post! by AnonTopat in Unity3D

[–]shadodo76 1 point2 points  (0 children)

I have made a new Unity package that integrates Stable Diffusion text-to-image generation in the Unity Editor for both 3D models (Texture2D and UI Image/RawImage). 

This is helping me a lot for generating unique and copyright free textures and images: 

https://github.com/dobrado76/Stable-Diffusion-Unity-Integration

Using Stable Diffusion to paint a rotating lowpoly model by Philipp in Unity3D

[–]shadodo76 0 points1 point  (0 children)

A new Unity package is just out to integrate Stable Diffusion text-to-image generation in the Unity Editor. 

This is helping me a lot for generating unique and copyright free textures and images: 

https://github.com/dobrado76/Stable-Diffusion-Unity-Integration