Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge remote-tracking branch 'cocos-for-editor/v3.8.1' into develop #15703

Merged
merged 91 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
899a3a9
Fix animation clip frame event dispatching (#15534)
shrinktofit Jun 27, 2023
491c0cf
[AOT] fix type for AOT engine (#15526)
PPpro Jun 27, 2023
64ad3bd
Optimize light source luminous_flux and luminance UI step (#15555)
troublemaker52025 Jun 27, 2023
2485e4c
update the screen size of multiple LODs may result in an error (#15543)
nianba23 Jun 28, 2023
4c0f664
[AOT] add type for AOT engine (#15527)
PPpro Jun 28, 2023
c042d80
[ci skip][AUTO]: Automated code generating update: f10b26a5acfa5fbc30…
cocos-robot Jun 28, 2023
620f68e
revert partial useless code related wechat blackscreen repair (#15554)
mmyduckx Jun 28, 2023
5f71d04
Filp the y-axis value for stick (#15570)
PatriceJiang Jun 28, 2023
85acac8
fix: wrong asm.js mem url on minigame platforms (#15559)
PPpro Jun 29, 2023
2ea7043
fix unlink prefab bug in inspector (#15518)
arsen2010 Jun 29, 2023
66dca24
refine post process and add tips (#15566)
2youyou2 Jun 29, 2023
e709534
fix edit material cache editing data bug in inspector (#15550)
arsen2010 Jun 29, 2023
eaab2ca
optimize ui-prop group interface in inspector (#15542)
arsen2010 Jun 29, 2023
a0e3037
Add test utils: vec3, quat equality matcher and pseudo random generat…
shrinktofit Jun 29, 2023
35f6481
V3.8.0 pipeline api document (#15529)
star-e Jun 29, 2023
3b98550
fix dependency on camera component (#15577)
star-e Jun 29, 2023
b43f086
update migrated meta files (#15581)
AFeiYA Jun 29, 2023
b104d25
add tooltips for bloom hbao and lut (#15579)
jk20012001 Jun 29, 2023
8e5ea93
fix label limit canvas size bug (#15514)
LinYunMo Jun 29, 2023
6acdd0a
inspector interface: reserve tab style of group; support new section …
arsen2010 Jun 30, 2023
3347d1b
fix inspector document link address (#15521)
yufengctbu Jun 30, 2023
051368e
[fix] box2d shape aabb calculating bug (#15565)
lealzhan Jun 30, 2023
324e475
Update swig to cocos-v1.1.5 to resolve function name of glue code for…
dumganhar Jun 30, 2023
7be278d
Revert "[fix] refactor physics2d contact listener (#14026)" (#15564)
lealzhan Jun 30, 2023
a585edc
add help for post-process components (#15589)
jk20012001 Jun 30, 2023
a1fa17e
fix some bugs in spine webassembly (#15569)
zhakesi Jun 30, 2023
3921bd7
fix editbox scale bug when node rotate (#15591)
mmyduckx Jun 30, 2023
6d0c1d3
Fix spine replacement skin and animation bone rendering data not refr…
Canvasfull Jul 2, 2023
e653f6f
Update external-config.json (#15598)
SantyWang Jul 2, 2023
cf843a1
support taa mask (#15592)
2youyou2 Jul 3, 2023
ea695c2
Fix widget bug in the editor when scale is not 1 (#15545)
LinYunMo Jul 3, 2023
e468e99
Fix widget bug in the editor when scale is not 1 (#15602)
LinYunMo Jul 3, 2023
7ef995b
Merge branch 'v3.8.0' into v3.8.1-merge-v3.8.0
minggo Jul 3, 2023
bb6131a
Merge pull request #15603 from minggo/v3.8.1-merge-v3.8.0
minggo Jul 3, 2023
7f201a0
fix label Precision (#15594)
LinYunMo Jul 3, 2023
ba0d131
fix skin diffuse with forward lighting (#15605)
jk20012001 Jul 3, 2023
e035b23
Animation controller component help (#15609)
shrinktofit Jul 4, 2023
798e340
optimize shader code size for include (#15614)
jk20012001 Jul 5, 2023
da0374b
fix performance degradation when redefine the property of renderer's …
SantyWang Jul 5, 2023
85db1c3
alipay: the accessSync interface needs to check if it is successful. …
bofeng-song Jul 5, 2023
1d85b94
All games, mini-programs, and runtime platforms with onWindowResize n…
bofeng-song Jul 5, 2023
937f80a
fix shadow issue for camera use post process with custom pipeline (#1…
2youyou2 Jul 5, 2023
08d9a34
character controller api tweaks (#15621)
lealzhan Jul 5, 2023
b3eeaba
add constrain for wechat logo default ratio (#15627)
mmyduckx Jul 6, 2023
083e3b2
[fix] physx rigid body sleep issues (#15625)
lealzhan Jul 6, 2023
ff40e74
Tweak deserialization code (#15630)
shrinktofit Jul 6, 2023
649e81a
optimize: ensure wasm module ready before importing (#15631)
PPpro Jul 6, 2023
777c855
Fix the problem that the sound cannot be stopped after calling miniga…
bofeng-song Jul 6, 2023
a3ee06e
Optimize unit test; support overriding constants in per-test-suite (#…
shrinktofit Jul 6, 2023
3890600
fix crash on color grading with GLES (#15634)
xubing0906 Jul 6, 2023
9421ab1
fix csm instancedBuffer large primitives count for custom-pipeline (#…
troublemaker52025 Jul 6, 2023
acd8e96
fix spine cache mode bug when no animation (#15637)
LinYunMo Jul 6, 2023
7b5bec1
optimize the text when fbx do not exist lod (#15643)
nianba23 Jul 7, 2023
1f45c86
fix spine artifact in editor (#15640)
SantyWang Jul 7, 2023
73776a0
Update external to v3.8.0-14 (#15635)
dumganhar Jul 7, 2023
8d23520
add renderRoot2d help (#15644)
LinYunMo Jul 7, 2023
14c1237
fix leaf scattering code (#15645)
jk20012001 Jul 7, 2023
9169f73
fix shader compilation error (#15646)
jk20012001 Jul 7, 2023
308816f
fix native pipeline instancing implementation (#15647)
star-e Jul 7, 2023
79bec57
[AOT] fix: crash when setting uniform of particle system (#15639)
PPpro Jul 7, 2023
99faec0
remove TextDecoder (#15648)
star-e Jul 7, 2023
8ed2ed5
Spine v3.8.0 Fix missing interface bindings (#15618)
Canvasfull Jul 7, 2023
9aaee8c
Update external-config.json (#15649)
PatriceJiang Jul 7, 2023
cc35a61
fix: crash on OH 4.0 (#15656)
PPpro Jul 10, 2023
f608d98
Prevent jest from transforming physics external module (#15653)
shrinktofit Jul 10, 2023
aa9b452
fix spine animation does not render in cache mode when total time is …
Canvasfull Jul 10, 2023
fedcfd2
export getAttachments (#15661)
SantyWang Jul 10, 2023
4b6f482
fix CI vulkan-sdk CDN? issue, run vcpkg when choco fails (#15667)
PatriceJiang Jul 10, 2023
89cd677
fix spine STRING_STD2SP function Uncaught RuntimeError: memory acces…
Canvasfull Jul 10, 2023
399e8a1
Fix the enumeration order of event types in Wasm (native) and TypeScr…
Canvasfull Jul 10, 2023
47694d5
Animation: fix ExoticVectorLikeTrackValues field serialization (#15507)
shrinktofit Jul 10, 2023
dd55b22
fix wechat videoplayer pause&stop&play bug (#15668)
mmyduckx Jul 10, 2023
31b10ff
update external version (#15675)
SantyWang Jul 11, 2023
09f83b4
Optimization of user warnings when checking "Use Baked Animation. (#1…
knoxHuang Jul 11, 2023
e5d61cf
fix problem when skin changed and slot texture changed (#15677)
SantyWang Jul 11, 2023
ddc19f1
Remove useless code (#15670)
SantyWang Jul 11, 2023
9f03504
remove useless code (#15682)
SantyWang Jul 11, 2023
b318b39
Revert "remove useless code (#15682)" (#15683)
SantyWang Jul 11, 2023
3c963bb
optimize inspector interface when edit node (#15679)
arsen2010 Jul 12, 2023
57414e2
fix videoPlayer puase seekTo bug (#15678)
mmyduckx Jul 12, 2023
4b62d5d
[Remove] Remove the discard check of the managed resource (#15685)
GengineJS Jul 12, 2023
43b9fd4
PoseGraph: fix apply transform node (#15632)
shrinktofit Jul 12, 2023
50d9179
Optimize effect dependency and package size (#15650)
troublemaker52025 Jul 12, 2023
1aed1fe
fix effect.bin serialization (#15690)
star-e Jul 12, 2023
aa53a8b
fixed #15688: [JSB] Assertion was triggered if bind an inner class wh…
dumganhar Jul 12, 2023
802a1f0
Merge branch 'v3.8.0' into v3.8.1-merge-v3.8.0
minggo Jul 12, 2023
85198e3
Merge pull request #15692 from cocos/v3.8.1-merge-v3.8.0
minggo Jul 12, 2023
7465cf6
Fix LOD can not work normally while node's active changed dynamically…
bofeng-song Jul 13, 2023
b826a43
fix videoPlayer change Source related bug (#15695)
mmyduckx Jul 13, 2023
5d75efd
Merge remote-tracking branch 'cocos-for-editor/v3.8.1' into develop
knoxHuang Jul 13, 2023
7c51d78
update external-config checkout to develop-26
knoxHuang Jul 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/native-compile-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- 'templates/**'
- 'native/**'
- '.github/workflows/native-compile-platforms.yml'

# github.head_ref is only defined on pull_request events
concurrency:
Expand All @@ -25,8 +26,11 @@ jobs:
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- name: Install deps
run: |
choco install --forcex86 vulkan-sdk
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.2.189.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Compile win64
shell: bash
env:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/native-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
paths:
- 'native/**'
- '.github\workflows\native-simulator.yml'

# github.head_ref is only defined on pull_request events
concurrency:
Expand Down Expand Up @@ -32,9 +33,12 @@ jobs:
EXT_VERSION=`node ../.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external external

- name: install vulkan-sdk
run: |
choco install vulkan-sdk
- name: Install deps
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.2.189.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: gen simulator
run: |
gulp gen-simulator
Expand Down
19 changes: 19 additions & 0 deletions @types/pal/minigame.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ declare module 'pal/minigame' {

// file system
getFileSystemManager(): FileSystemManager;
loadSubpackage? (option: LoadSubpackageOption): LoadSubpackageTask;

// input
onTouchStart: IEventManager<TouchEvent>;
Expand Down Expand Up @@ -249,3 +250,21 @@ declare class InnerAudioContext {
seek(position:number): any;
stop(): any;
}

interface LoadSubpackageOption {
name: string;
fail?: (...args: unknown[]) => void;
success?: (...args: unknown[]) => void;
complete?: (...args: unknown[]) => void;
}
interface LoadSubpackageTask {
onProgressUpdate(
listener: LoadSubpackageTaskOnProgressUpdateCallback
): void;
}
type LoadSubpackageTaskOnProgressUpdateCallback = (result: LoadSubpackageTaskOnProgressUpdateListenerResult) => void;
interface LoadSubpackageTaskOnProgressUpdateListenerResult {
progress: number;
totalBytesExpectedToWrite: number;
totalBytesWritten: number;
}
7 changes: 7 additions & 0 deletions @types/pal/wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ declare module 'pal/wasm' {
* @param binaryUrl the url of wasm or js mem, this should be a url relative from build output chunk.
*/
export function fetchBuffer (binaryUrl: string): Promise<ArrayBuffer>;

/**
* Sometimes we need to put wasm modules in subpackage to reduce code size.
* In this case we need to ensure that the wasm modules is ready before we import them.
* Please remember to invoke this method before we import wasm modules.
*/
export function ensureWasmModuleReady (): Promise<void>;
}
28 changes: 15 additions & 13 deletions cc.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
"970b0598-bcb0-4714-91fb-2e81440dccd8",
"bcd64cc6-2dd9-43f6-abbe-66318d332032",
"d930590d-bb92-4cc8-8bd1-23cd027f9edf",
"a3cd009f-0ab0-420d-9278-b9fdab939bbc",
"5c601d96-e4c7-4698-991b-7ee674b11079",
"9361fd90-ba52-4f84-aa93-6e878fd576ca"
"a3cd009f-0ab0-420d-9278-b9fdab939bbc"
]
},
"gfx-webgl": {
Expand All @@ -25,17 +23,9 @@
"3d": {
"modules": ["3d"],
"dependentAssets": [
"1baf0fc9-befa-459c-8bdd-af1a450a0319",
"511d2633-09a7-4bdd-ac42-f778032124b3",
"5d45aa00-e064-4938-b314-4265f0c2258c",
"28d6d6b8-3f66-4a73-9795-17a0852ba2d4",
"ec8106fe-05bf-4e94-943c-e0d3b7bb5e45",
"620b6bf3-0369-4560-837f-2a2c00b73c26",
"2df0a40b-26c2-47ce-be0d-4d3cd4164737",
"39f74202-ead5-4a45-b966-273d526adbf1",
"8f6ac413-2f1e-4b88-b26f-54556b5dd510",
"45e7c0c8-2699-4912-b45f-d42bb8384189",
"84ac6f69-3086-455a-86a4-561da8ee710b"
"9361fd90-ba52-4f84-aa93-6e878fd576ca"
]
},
"animation": {
Expand Down Expand Up @@ -199,7 +189,13 @@
"cafd95c9-c558-46f9-9812-1224b65c09ee",
"28d6d6b8-3f66-4a73-9795-17a0852ba2d4",
"2df0a40b-26c2-47ce-be0d-4d3cd4164737",
"dace6a58-1705-48c7-a275-70afc9534e88"
"dace6a58-1705-48c7-a275-70afc9534e88",
"ec8106fe-05bf-4e94-943c-e0d3b7bb5e45",
"39f74202-ead5-4a45-b966-273d526adbf1",
"8f6ac413-2f1e-4b88-b26f-54556b5dd510",
"45e7c0c8-2699-4912-b45f-d42bb8384189",
"84ac6f69-3086-455a-86a4-561da8ee710b",
"5c601d96-e4c7-4698-991b-7ee674b11079"
]
},
"websocket": {
Expand Down Expand Up @@ -666,6 +662,12 @@
"type": "boolean",
"value": false,
"internal": true
},
"WASM_SUBPACKAGE": {
"comment": "An internal constant to indicate whether we use wasm assets as minigame subpackage.\nThis is useful when we need to reduce code size.",
"type": "boolean",
"value": false,
"internal": true
}
},

Expand Down
44 changes: 25 additions & 19 deletions cocos/2d/assembler/label/text-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
const MAX_SIZE = 2048;
const _BASELINE_OFFSET = getBaselineOffset();
const _invisibleAlpha = (1 / 255).toFixed(3);
const MAX_CALCULATION_NUM = 3;

export interface IRenderData {
x: number;
Expand Down Expand Up @@ -79,9 +80,26 @@
public processingString (isBmFont: boolean, style: TextStyle, layout: TextLayout,
outputLayoutData: TextOutputLayoutData, inputString: string, out?: string[]): void {
if (!isBmFont) {
let loopTime = 0;
this._fontScale = this._getStyleFontScale(style.fontSize, style.fontScale);
this._updatePaddingRect(style, outputLayoutData);
this._calculateLabelFont(style, layout, outputLayoutData, inputString);
// check & limit canvas size
while ((outputLayoutData.canvasSize.width > MAX_SIZE || outputLayoutData.canvasSize.height > MAX_SIZE)
&& (loopTime <= MAX_CALCULATION_NUM)) {
loopTime++;
if (loopTime > MAX_CALCULATION_NUM) {
this._fontScale = 1;
} else {
const maxValue = Math.max(outputLayoutData.canvasSize.width, outputLayoutData.canvasSize.height); // Current Canvas Size max dimension

Check warning on line 94 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 154. Maximum allowed is 150
const canvasScaleToMaxSizeRatio = MAX_SIZE / maxValue;
this._fontScale *= canvasScaleToMaxSizeRatio;
this._fontScale = Math.max(1, this._fontScale);
}

this._updatePaddingRect(style, outputLayoutData);
this._calculateLabelFont(style, layout, outputLayoutData, inputString);
}
} else {
if (!style.fntConfig) { // for char
this._fontScale = this._getStyleFontScale(style.originFontSize, style.fontScale);
Expand Down Expand Up @@ -167,8 +185,8 @@
}
canvasSizeY = (_splitStrings.length + BASELINE_RATIO)
* this._getLineHeight(layout.lineHeight, style.actualFontSize, style.fontSize);
const rawWidth = parseFloat(canvasSizeX.toFixed(2));
const rawHeight = parseFloat(canvasSizeY.toFixed(2));
const rawWidth = canvasSizeX;
const rawHeight = canvasSizeY;

outputLayoutData.canvasSize.width = rawWidth + outputLayoutData.canvasPadding.width * this._fontScale;
outputLayoutData.canvasSize.height = rawHeight + outputLayoutData.canvasPadding.height * this._fontScale;
Expand All @@ -179,22 +197,22 @@
case Overflow.SHRINK: {
this._calculateShrinkFont(paragraphedStrings, style, layout, outputLayoutData);
this._calculateWrapText(paragraphedStrings, style, layout, outputLayoutData);
outputLayoutData.canvasSize.width *= this._fontScale;
outputLayoutData.canvasSize.height *= this._fontScale;
outputLayoutData.canvasSize.width = outputLayoutData.nodeContentSize.width * this._fontScale;
outputLayoutData.canvasSize.height = outputLayoutData.nodeContentSize.height * this._fontScale;
break;
}
case Overflow.CLAMP: {
this._calculateWrapText(paragraphedStrings, style, layout, outputLayoutData);
outputLayoutData.canvasSize.width *= this._fontScale;
outputLayoutData.canvasSize.height *= this._fontScale;
outputLayoutData.canvasSize.width = outputLayoutData.nodeContentSize.width * this._fontScale;
outputLayoutData.canvasSize.height = outputLayoutData.nodeContentSize.height * this._fontScale;
break;
}
case Overflow.RESIZE_HEIGHT: {
this._calculateWrapText(paragraphedStrings, style, layout, outputLayoutData);
const rawHeight = (outputLayoutData.parsedString.length + BASELINE_RATIO)
* this._getLineHeight(layout.lineHeight, style.actualFontSize, style.fontSize);

outputLayoutData.canvasSize.width *= this._fontScale;
outputLayoutData.canvasSize.width = outputLayoutData.nodeContentSize.width * this._fontScale;
outputLayoutData.canvasSize.height = (rawHeight + outputLayoutData.canvasPadding.height * this._fontScale);
// set node height
outputLayoutData.nodeContentSize.height = (rawHeight + outputLayoutData.contentSizeExtend.height * this._fontScale) / this._fontScale;
Expand All @@ -204,18 +222,6 @@
// nop
}
}

// check & limit canvas size
if ((outputLayoutData.nodeContentSize.width < MAX_SIZE && outputLayoutData.nodeContentSize.height < MAX_SIZE)
&& (outputLayoutData.canvasSize.width > MAX_SIZE || outputLayoutData.canvasSize.height > MAX_SIZE)) {
const maxValue = Math.max(outputLayoutData.canvasSize.width, outputLayoutData.canvasSize.height);
let scale = MAX_SIZE / maxValue;
if (scale < 1) { scale = 1; }
this._fontScale = scale;

this._updatePaddingRect(style, outputLayoutData);
this._calculateLabelFont(style, layout, outputLayoutData, inputString); // only one time
}
}

// can cache
Expand Down Expand Up @@ -438,7 +444,7 @@
outputLayoutData.startPosition.set(labelX + outputLayoutData.canvasPadding.x, firstLinelabelY + outputLayoutData.canvasPadding.y);
}

private _updateTexture (style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData, outputRenderData: TextOutputRenderData): void {

Check warning on line 447 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 153. Maximum allowed is 150
if (!this._context || !this._canvas) {
return;
}
Expand Down Expand Up @@ -516,7 +522,7 @@
}
}

private _drawTextEffect (startPosition: Vec2, lineHeight: number, style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData): void {

Check warning on line 525 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 155. Maximum allowed is 150
if (!style.hasShadow && !style.isOutlined && !style.isUnderline) return;

const isMultiple = outputLayoutData.parsedString.length > 1 && style.hasShadow;
Expand Down Expand Up @@ -747,7 +753,7 @@
if (!letterDef) {
this._recordPlaceholderInfo(letterIndex, character);
log(`Can't find letter definition in texture atlas ${
style.fntConfig!.atlasName} for letter:${character}`);

Check warning on line 756 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Invalid type "any" of template literal expression
continue;
}

Expand Down Expand Up @@ -1034,7 +1040,7 @@
}
}

private _scaleFontSizeDown (style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData, inputString: string, fontSize: number): void {

Check warning on line 1043 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 156. Maximum allowed is 150
let shouldUpdateContent = true;
if (!fontSize) {
fontSize = 0.1;
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/framework/render-root-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

import { ccclass, disallowMultiple, executeInEditMode,
executionOrder, menu, requireComponent } from 'cc.decorator';
executionOrder, help, menu, requireComponent } from 'cc.decorator';
import { Component } from '../../scene-graph/component';
import { cclegacy } from '../../core';
import { UITransform } from './ui-transform';
Expand All @@ -33,6 +33,7 @@ import { UITransform } from './ui-transform';
* @zh 2D 对象数据收集的入口节点,所有的 2D渲染对象需在 RenderRoot 节点下才可以被渲染。
*/
@ccclass('cc.RenderRoot2D')
@help('i18n:cc.RenderRoot2D')
@executionOrder(100)
@menu('2D/RenderRoot2D')
@requireComponent(UITransform)
Expand Down
25 changes: 1 addition & 24 deletions cocos/2d/renderer/render-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class RenderData extends BaseRenderData {
this.syncRender2dBuffer();
}

get data ():IRenderData[] {
get data (): IRenderData[] {
return this._data;
}

Expand Down Expand Up @@ -304,10 +304,6 @@ export class RenderData extends BaseRenderData {
public hashDirty = true;

private _data: IRenderData[] = [];
private _pivotX = 0;
private _pivotY = 0;
private _width = 0;
private _height = 0;
private _frame: SpriteFrame | TextureBase | null = null;
protected _accessor: StaticVBAccessor = null!;
get accessor (): StaticVBAccessor { return this._accessor; }
Expand Down Expand Up @@ -495,26 +491,9 @@ export class RenderData extends BaseRenderData {
}
}

public updateSizeNPivot (width: number, height: number, pivotX: number, pivotY: number): void {
if (width !== this._width
|| height !== this._height
|| pivotX !== this._pivotX
|| pivotY !== this._pivotY) {
this._width = width;
this._height = height;
this._pivotX = pivotX;
this._pivotY = pivotY;
this.vertDirty = true;
}
}

public clear (): void {
this.resize(0, 0);
this._data.length = 0;
this._pivotX = 0;
this._pivotY = 0;
this._width = 0;
this._height = 0;
this.indices = null;
this.vertDirty = true;
this.material = null;
Expand Down Expand Up @@ -810,5 +789,3 @@ export class MeshRenderData extends BaseRenderData {
}
}
}

const _meshDataPool: RecyclePool<MeshRenderData> = new RecyclePool(() => new MeshRenderData(), 32);
8 changes: 4 additions & 4 deletions cocos/3d/framework/mesh-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class ModelBakeSettings extends EventTarget {
* @zh 模型是否是静态的并可以烘培光照贴图。
* 注意:模型顶点数据必须包含第二套 UV 属性来支持光照贴图烘焙。
*/
@group({ id: 'LightMap', name: 'LightMapSettings', displayOrder: 0 })
@group({ id: 'LightMap', name: 'LightMapSettings', displayOrder: 0, style: 'section' })
@editable
get bakeable (): boolean {
return this._bakeable;
Expand Down Expand Up @@ -210,7 +210,7 @@ class ModelBakeSettings extends EventTarget {
* @en Whether to use light probe which provides indirect light to dynamic objects.
* @zh 模型是否使用光照探针,光照探针为动态物体提供间接光。
*/
@group({ id: 'LightProbe', name: 'LightProbeSettings', displayOrder: 1 })
@group({ id: 'LightProbe', name: 'LightProbeSettings', displayOrder: 1, style: 'section' })
@editable
@type(CCBoolean)
get useLightProbe (): boolean {
Expand Down Expand Up @@ -241,7 +241,7 @@ class ModelBakeSettings extends EventTarget {
* @en Used to set whether to use the reflection probe or set probe's type.
* @zh 用于设置是否使用反射探针或者设置反射探针的类型。
*/
@group({ id: 'ReflectionProbe', name: 'ReflectionProbeSettings', displayOrder: 2 })
@group({ id: 'ReflectionProbe', name: 'ReflectionProbeSettings', displayOrder: 2, style: 'section' })
@type(Enum(ReflectionProbeType))
get reflectionProbe (): ReflectionProbeType {
return this._reflectionProbeType;
Expand Down Expand Up @@ -339,7 +339,7 @@ export class MeshRenderer extends ModelRenderer {
*/
@type(CCFloat)
@tooltip('i18n:model.shadow_bias')
@group({ id: 'DynamicShadow', name: 'DynamicShadowSettings', displayOrder: 2 })
@group({ id: 'DynamicShadow', name: 'DynamicShadowSettings', displayOrder: 2, style: 'section' })
@disallowAnimation
get shadowBias (): number {
return this._shadowBias;
Expand Down
7 changes: 3 additions & 4 deletions cocos/3d/lights/directional-light-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
import { Camera, PCFType, Shadows, ShadowType, CSMOptimizationMode, CSMLevel } from '../../render-scene/scene';
import { Root } from '../../root';
import { MeshRenderer } from '../framework/mesh-renderer';
import { director } from '../../game/director';
import { rangeMin } from '../../core/data/decorators';

const { ccclass, menu, executeInEditMode, property, serializable, formerlySerializedAs, tooltip, help, visible, type, editable, slide, range } = _decorator;
const { ccclass, menu, executeInEditMode, property, serializable, formerlySerializedAs, tooltip, help,
visible, type, editable, slide, range } = _decorator;

/**
* @en The directional light component, only one real time directional light is permitted in one scene, it act as the main light of the scene.
Expand Down Expand Up @@ -97,7 +96,7 @@
*/
@tooltip('i18n:lights.illuminance')
@editable
@rangeMin(0)
@range([0, Number.POSITIVE_INFINITY, 10])
@type(CCInteger)
get illuminance (): number {
const isHDR = (cclegacy.director.root as Root).pipeline.pipelineSceneData.isHDR;
Expand All @@ -111,10 +110,10 @@
const isHDR = (cclegacy.director.root as Root).pipeline.pipelineSceneData.isHDR;
if (isHDR) {
this._illuminanceHDR = val;
this._light && ((this._light as scene.DirectionalLight).illuminanceHDR = this._illuminanceHDR);

Check warning on line 113 in cocos/3d/lights/directional-light-component.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected an assignment or function call and instead saw an expression
} else {
this._illuminanceLDR = val;
this._light && ((this._light as scene.DirectionalLight).illuminanceLDR = this._illuminanceLDR);

Check warning on line 116 in cocos/3d/lights/directional-light-component.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected an assignment or function call and instead saw an expression
}
}

Expand Down Expand Up @@ -226,7 +225,7 @@
* @zh 实时阴影计算中潜在阴影产生的范围
*/
@tooltip('i18n:lights.shadowDistance')
@visible(function (this: DirectionalLight) {

Check warning on line 228 in cocos/3d/lights/directional-light-component.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
return (cclegacy.director.root as Root).pipeline.pipelineSceneData.shadows.enabled
&& (cclegacy.director.root as Root).pipeline.pipelineSceneData.shadows.type
=== ShadowType.ShadowMap && this._shadowFixedArea === false;
Expand Down Expand Up @@ -254,7 +253,7 @@
* @zh 实时阴影计算中剔除阴影的范围
*/
@tooltip('i18n:lights.shadowInvisibleOcclusionRange')
@visible(function (this: DirectionalLight) {

Check warning on line 256 in cocos/3d/lights/directional-light-component.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
return (cclegacy.director.root as Root).pipeline.pipelineSceneData.shadows.enabled
&& (cclegacy.director.root as Root).pipeline.pipelineSceneData.shadows.type
=== ShadowType.ShadowMap && this._shadowFixedArea === false
Expand Down Expand Up @@ -301,7 +300,7 @@
* @zh 开启或关闭 csm 模式
*/
@tooltip('i18n:lights.enableCSM')
@visible(function (this: DirectionalLight) {

Check warning on line 303 in cocos/3d/lights/directional-light-component.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
return (cclegacy.director.root as Root).pipeline.pipelineSceneData.shadows.enabled
&& (cclegacy.director.root as Root).pipeline.pipelineSceneData.shadows.type
=== ShadowType.ShadowMap && this._shadowFixedArea === false;
Expand Down
2 changes: 1 addition & 1 deletion cocos/3d/lights/light-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class Light extends Component {
* 光源色温。
*/
@slide
@range([1000, 15000, 1])
@range([1000, 15000, 100])
@tooltip('i18n:lights.color_temperature')
get colorTemperature (): number {
return this._colorTemperature;
Expand Down
Loading
Loading