Skip to content

Commit 42389f8

Browse files
authored
Merge branch 'main' into experimental-features
2 parents 5ec15ec + 1f1b4ed commit 42389f8

12 files changed

Lines changed: 405 additions & 52 deletions

contributor_docs/contributor_guidelines.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ If you are looking to contribute outside of the p5.js repositories (writing tuto
88

99
This is a relatively long and comprehensive document but we will try to signpost all steps and points as clearly as possible. Do utilize the table of contents to find sections relevant to you. Feel free to skip sections if they are not relevant to your planned contributions.
1010

11-
**If you are a new contributor, you may want to start with the first section, “All about issues.” If you just want a step-by-step setup of the development process, you can look at the “Quick Get Started For Developers” section.**
11+
**If you are a new contributor**, be sure to check this entire document, as well as the [AI Usage Policy](https://github.com/processing/p5.js/blob/main/AI_USAGE_POLICY.md). We recommend new contributors work on one topic at a time: this means asking for assignment on one issue at a time, or submitting one PR at a time. This helps reduce overlapping work, and it helps us be more efficient with reviews. Please be mindful that almost all reviews are done by volunteers.
12+
13+
Please note that consistently violating the contributor guidelines, the AI usage policy, and/or the code of conduct may result in temporary or permanent suspension of user accounts. We expect contributors to respond to feedback: even if you do not implement something someone asks, we expect you to reply to the comments.
1214

1315
# Table of Contents
1416

contributor_docs/p5.strands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ let c_0 = b_1 + a_0;
237237
return c_0;
238238
```
239239

240-
When we generate GLSL from the graph, we start from the variables we need to output, the return values of the function (e.g. `c_0` in the example above.) From there, we can track dependencies through the DAG (in this case, `b_1` and `a_1`). Each dependency has their own dependencies. We make sure we output the dependencies for a node before the node itself.
240+
When we generate GLSL from the graph, we start from the variables we need to output, the return values of the function (e.g. `c_0` in the example above.) From there, we can track dependencies through the DAG (in this case, `b_1` and `a_0`). Each dependency has their own dependencies. We make sure we output the dependencies for a node before the node itself.
241241

242242
```mermaid
243243
flowchart TB

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ class p5 {
126126
};
127127

128128
if (typeof window !== 'undefined') {
129-
window.addEventListener('focus', focusHandler);
130-
window.addEventListener('blur', blurHandler);
131-
p5.lifecycleHooks.remove.push(function () {
132-
window.removeEventListener('focus', focusHandler);
133-
window.removeEventListener('blur', blurHandler);
129+
window.addEventListener('focus', focusHandler, {
130+
signal: this._removeSignal
131+
});
132+
window.addEventListener('blur', blurHandler, {
133+
signal: this._removeSignal
134134
});
135135

136136
// Initialization complete, start runtime

src/core/p5.Renderer3D.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,8 +2343,8 @@ function renderer3D(p5, fn) {
23432343
* @beta
23442344
* @webgpu
23452345
* @webgpuOnly
2346-
* @param {Number|Array|Float32Array|Object[]} dataOrCount Either a number specifying the count of floats,
2347-
* an array/Float32Array of floats, or an array of objects describing struct elements.
2346+
* @param {Number|Array|Float32Array|Uint32Array|Int32Array|Object[]} dataOrCount Either a number specifying the count of elements,
2347+
* an array/TypedArray of values, or an array of objects describing struct elements.
23482348
* @returns {p5.StorageBuffer} A storage buffer.
23492349
*/
23502350
fn.createStorage = function (dataOrCount) {

src/webgl/loading.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,21 @@ async function loadMaterialTextures(materials, modelPath, instance) {
190190
// as the aggregate; each part gets its own localised verts with faces re-indexed
191191
// against them, plus its material's state.
192192
function buildMaterialParts(model, faceMaterials, materials) {
193-
// only split when there are genuinely multiple materials. a single material
194-
// (or none) stays as the geometry's own part and renders as before. one group
195-
// per material, plus a null group for faces before any usemtl so none drop.
193+
// one group per material, plus a null group for faces before any usemtl so
194+
// none drop.
196195
const names = [...new Set(faceMaterials)];
196+
197+
// one material covering every face. the geometry is already its own part, so
198+
// hand it the state directly: splitting would duplicate every vertex to say
199+
// the same thing, and would stop parts[0] being the geometry itself. without
200+
// this a single material model never receives its maps at all.
201+
if (names.length === 1 && names[0] != null) {
202+
Object.assign(model.partState, mtlToPartState(materials[names[0]]));
203+
return;
204+
}
205+
206+
// nothing to split on: no materials, or one material alongside faces that
207+
// were declared before any usemtl and so have none.
197208
if (names.filter(name => name != null).length < 2) return;
198209

199210
const hasUvs = model.uvs.length > 0;

0 commit comments

Comments
 (0)