|
7554 | 7554 | "3", |
7555 | 7555 | "" |
7556 | 7556 | ] |
| 7557 | + }, |
| 7558 | + { |
| 7559 | + "type": { |
| 7560 | + "value": "Light3D::SetLightShadowCountMax" |
| 7561 | + }, |
| 7562 | + "parameters": [ |
| 7563 | + "", |
| 7564 | + "=", |
| 7565 | + "1", |
| 7566 | + "" |
| 7567 | + ] |
7557 | 7568 | } |
7558 | 7569 | ] |
7559 | 7570 | } |
|
42509 | 42520 | " value: 20", |
42510 | 42521 | "};", |
42511 | 42522 | "", |
| 42523 | + "const editorLightShadowCountMax = {", |
| 42524 | + " value: 1", |
| 42525 | + "};", |
| 42526 | + "", |
| 42527 | + "const lightShadowCountMax = {", |
| 42528 | + " value: 4", |
| 42529 | + "};", |
| 42530 | + "", |
42512 | 42531 | "/**", |
42513 | 42532 | " * Get the platforms manager of an instance container.", |
42514 | 42533 | " * @param {gdjs.RuntimeScene & {__lightManager: LightManager}} runtimeScene", |
|
42517 | 42536 | " if (!runtimeScene.__lightManager) {", |
42518 | 42537 | " // Create the shared manager if necessary.", |
42519 | 42538 | " runtimeScene.__lightManager = isInGameEdition ?", |
42520 | | - " new LightManager(editorLightCountMax, 1) :", |
42521 | | - " new LightManager(lightCountMax, 4);", |
| 42539 | + " new LightManager(editorLightCountMax, editorLightShadowCountMax) :", |
| 42540 | + " new LightManager(lightCountMax, lightShadowCountMax);", |
42522 | 42541 | " }", |
42523 | 42542 | " return runtimeScene.__lightManager;", |
42524 | 42543 | "}", |
|
42605 | 42624 | "", |
42606 | 42625 | " /**", |
42607 | 42626 | " * @param maxCount {{value: number}}", |
42608 | | - " * @param shadowCount {number}", |
| 42627 | + " * @param shadowCount {{value: number}}", |
42609 | 42628 | " */", |
42610 | 42629 | " constructor(maxCount, shadowCount) {", |
42611 | 42630 | " this.visibleObjects = new CappedLightList(", |
|
42614 | 42633 | " (object) => { object.__light3D.visible = false; }", |
42615 | 42634 | " );", |
42616 | 42635 | " this.shadowObjects = new CappedLightList(", |
42617 | | - " { value: shadowCount },", |
| 42636 | + " shadowCount,", |
42618 | 42637 | " (object) => { object.__light3D.castShadow = true; },", |
42619 | 42638 | " (object) => { object.__light3D.castShadow = false; }", |
42620 | 42639 | " );", |
|
42643 | 42662 | "gdjs.__light3DExtension = {", |
42644 | 42663 | " Light3DRenderer,", |
42645 | 42664 | " lightCountMax,", |
| 42665 | + " lightShadowCountMax,", |
42646 | 42666 | "}" |
42647 | 42667 | ], |
42648 | 42668 | "parameterObjects": "", |
|
42729 | 42749 | ], |
42730 | 42750 | "parameters": [], |
42731 | 42751 | "objectGroups": [] |
| 42752 | + }, |
| 42753 | + { |
| 42754 | + "description": "the maximum number of nearest lights displayed with shadow simultaneously.", |
| 42755 | + "fullName": "Max lights with shadow count", |
| 42756 | + "functionType": "ExpressionAndCondition", |
| 42757 | + "name": "LightShadowCountMax", |
| 42758 | + "sentence": "max lights with shadow count", |
| 42759 | + "events": [ |
| 42760 | + { |
| 42761 | + "type": "BuiltinCommonInstructions::Standard", |
| 42762 | + "conditions": [], |
| 42763 | + "actions": [ |
| 42764 | + { |
| 42765 | + "type": { |
| 42766 | + "value": "Light3D::DefineHelperClasses" |
| 42767 | + }, |
| 42768 | + "parameters": [ |
| 42769 | + "", |
| 42770 | + "" |
| 42771 | + ] |
| 42772 | + } |
| 42773 | + ] |
| 42774 | + }, |
| 42775 | + { |
| 42776 | + "type": "BuiltinCommonInstructions::JsCode", |
| 42777 | + "inlineCode": [ |
| 42778 | + "", |
| 42779 | + "eventsFunctionContext.returnValue = gdjs.__light3DExtension.lightShadowCountMax.value;" |
| 42780 | + ], |
| 42781 | + "parameterObjects": "", |
| 42782 | + "useStrict": true, |
| 42783 | + "eventsSheetExpanded": false |
| 42784 | + } |
| 42785 | + ], |
| 42786 | + "expressionType": { |
| 42787 | + "type": "expression" |
| 42788 | + }, |
| 42789 | + "parameters": [], |
| 42790 | + "objectGroups": [] |
| 42791 | + }, |
| 42792 | + { |
| 42793 | + "fullName": "", |
| 42794 | + "functionType": "ActionWithOperator", |
| 42795 | + "getterName": "LightShadowCountMax", |
| 42796 | + "name": "SetLightShadowCountMax", |
| 42797 | + "sentence": "", |
| 42798 | + "events": [ |
| 42799 | + { |
| 42800 | + "type": "BuiltinCommonInstructions::Standard", |
| 42801 | + "conditions": [], |
| 42802 | + "actions": [ |
| 42803 | + { |
| 42804 | + "type": { |
| 42805 | + "value": "Light3D::DefineHelperClasses" |
| 42806 | + }, |
| 42807 | + "parameters": [ |
| 42808 | + "", |
| 42809 | + "" |
| 42810 | + ] |
| 42811 | + } |
| 42812 | + ] |
| 42813 | + }, |
| 42814 | + { |
| 42815 | + "type": "BuiltinCommonInstructions::JsCode", |
| 42816 | + "inlineCode": [ |
| 42817 | + "", |
| 42818 | + "const value = eventsFunctionContext.getArgument(\"Value\");", |
| 42819 | + "", |
| 42820 | + "gdjs.__light3DExtension.lightShadowCountMax.value = value;" |
| 42821 | + ], |
| 42822 | + "parameterObjects": "", |
| 42823 | + "useStrict": true, |
| 42824 | + "eventsSheetExpanded": false |
| 42825 | + } |
| 42826 | + ], |
| 42827 | + "parameters": [], |
| 42828 | + "objectGroups": [] |
42732 | 42829 | } |
42733 | 42830 | ], |
42734 | 42831 | "eventsFunctionsFolderStructure": { |
|
42748 | 42845 | }, |
42749 | 42846 | { |
42750 | 42847 | "functionName": "SetLightCountMax" |
| 42848 | + }, |
| 42849 | + { |
| 42850 | + "functionName": "LightShadowCountMax" |
| 42851 | + }, |
| 42852 | + { |
| 42853 | + "functionName": "SetLightShadowCountMax" |
42751 | 42854 | } |
42752 | 42855 | ] |
42753 | 42856 | }, |
|
0 commit comments