Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Fragment shader functions not in working order

Aperta
#727 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript

Direzione di ricerca

Inizia eseguendo l’esempio gpgpuTest collegato e confrontando lo shader generato con reorganizedFragmentShader.js e originalFragmentShader.js, soprattutto gli intervalli di funzioni a cui si fa riferimento nell’issue. Traccia il modo in cui GPU.js assembla il fragment shader e riproduci il fallimento della compilazione WebGL. Il lavoro è completato quando l’esempio compila e viene eseguito senza dover riordinare manualmente le funzioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What is wrong?

I have a problem with a shader. The functions in the shader are not in the correct order. I am trying to add roughly 20 functions, and they are breaking the compiled fragment shader. The problematic shader has some functions defined before functions it depends on, which apparently does not work in webGL. I rearranged the shader functions by hand and it works fine.

Where does it happen?

A website running GPU.js on my desktop Mac mini (specifically this website https://m0ose.github.io/jsSketches/gpgpuTest/index2.html)

How do we replicate the issue?

I put the example webpage here https://m0ose.github.io/jsSketches/gpgpuTest/index2.html , and the source code for it is here https://github.com/m0ose/jsSketches/tree/master/gpgpuTest .
The first time it tries to run the kernel it uses the compiled shader, and throws an error. Then, it sets the shader to the hand edited one(with the functions in a different order) and it works.
Specifically, I had to change the order of these functions to get it to work, https://github.com/m0ose/jsSketches/blob/master/gpgpuTest/reorganizedFragmentShader.js#L473-L531 .
Here is the original runtime compiled shader for reference, https://github.com/m0ose/jsSketches/blob/master/gpgpuTest/originalFragmentShader.js#L540-L545 .

How important is this (1-5)?

𝜋

Expected behavior (i.e. solution)

I am not sure what is causing this bug. I was not able to extract a smaller example, which might show the problem better. Could it be caused by the function names?

Other Comments

This is an Amazing library.

Lingua principale
JavaScript
Stelle
15.5k
Fork
663
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gpujs/gpu.js

Tutte le issue di gpujs/gpu.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.