| 1 |
{ -*- buffer-read-only: t -*- |
| 2 |
|
| 3 |
Copyright 2015-2024 Michalis Kamburelis. |
| 4 |
|
| 5 |
This file is part of "Castle Game Engine". |
| 6 |
|
| 7 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 8 |
included in this distribution, for details about the copyright. |
| 9 |
|
| 10 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
---------------------------------------------------------------------------- |
| 15 |
} |
| 16 |
|
| 17 |
{ Automatically generated node properties. |
| 18 |
|
| 19 |
Do not edit this file manually! |
| 20 |
To add new properties: |
| 21 |
- add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ , |
| 22 |
- and regenerate include files by running x3d-nodes-to-pascal } |
| 23 |
|
| 24 |
{$ifdef read_interface} |
| 25 |
|
| 26 |
strict private |
| 27 |
function GetUniformMissing: TUniformMissing; |
| 28 |
procedure SetUniformMissing(const Value: TUniformMissing); |
| 29 |
public |
| 30 |
{ Create node fields and events. } |
| 31 |
procedure CreateNode; override; |
| 32 |
class function ClassX3DType: String; override; |
| 33 |
|
| 34 |
strict private FFdParts: TMFNode; |
| 35 |
{ Internal wrapper for property @code(Parts). This wrapper API may change, we advise to access simpler @code(Parts) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 36 |
public property FdParts: TMFNode read FFdParts; |
| 37 |
{ } |
| 38 |
procedure SetParts(const Value: array of TShaderPartNode); |
| 39 |
|
| 40 |
strict private FFdUniformMissing: TSFStringEnum; |
| 41 |
{ Internal wrapper for property @code(UniformMissing). This wrapper API may change, we advise to access simpler @code(UniformMissing) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 42 |
public property FdUniformMissing: TSFStringEnum read FFdUniformMissing; |
| 43 |
{ Should we report a missing uniform value. Setting this to umWarning (default) is useful to spot simple mistakes in naming uniforms. On the other hand, OpenGL aggressively removes unused uniforms from code, and it may cause spurious messages that some uniform is missing -- even though the shader is correct, is just doesn't use some uniform value e.g. because no lights are present on the current scene. } |
| 44 |
property UniformMissing: TUniformMissing read GetUniformMissing write SetUniformMissing; |
| 45 |
|
| 46 |
{$endif read_interface} |
| 47 |
|
| 48 |
{$ifdef read_implementation} |
| 49 |
|
| 50 |
{ TComposedShaderNode ----------------------------------------------- } |
| 51 |
|
| 52 |
procedure TComposedShaderNode.SetParts(const Value: array of TShaderPartNode); |
| 53 |
var |
| 54 |
L: Integer; |
| 55 |
A: array of TX3DNode; |
| 56 |
begin |
| 57 |
L := High(Value) + 1; |
| 58 |
SetLength(A, L); |
| 59 |
if L > 0 then |
| 60 |
Move(Value[0], A[0], L * SizeOf(TShaderPartNode)); |
| 61 |
FdParts.Send(A); |
| 62 |
end; |
| 63 |
|
| 64 |
function TComposedShaderNode.GetUniformMissing: TUniformMissing; |
| 65 |
begin |
| 66 |
Result := TUniformMissing(FdUniformMissing.EnumValue); |
| 67 |
end; |
| 68 |
|
| 69 |
procedure TComposedShaderNode.SetUniformMissing(const Value: TUniformMissing); |
| 70 |
begin |
| 71 |
FdUniformMissing.SendEnumValue(Ord(Value)); |
| 72 |
end; |
| 73 |
|
| 74 |
class function TComposedShaderNode.ClassX3DType: String; |
| 75 |
begin |
| 76 |
Result := 'ComposedShader'; |
| 77 |
end; |
| 78 |
|
| 79 |
procedure TComposedShaderNode.CreateNode; |
| 80 |
begin |
| 81 |
inherited; |
| 82 |
|
| 83 |
FFdParts := TMFNode.Create(Self, True, 'parts', [TShaderPartNode]); |
| 84 |
FdParts.ChangeAlways := chEverything; |
| 85 |
AddField(FFdParts); |
| 86 |
|
| 87 |
FFdUniformMissing := TSFStringEnum.Create(Self, False, 'uniformMissing', @UniformMissingNames, Ord(High(UniformMissingNames)) + 1, Ord(umWarning)); |
| 88 |
FdUniformMissing.ChangeAlways := chEverything; |
| 89 |
AddField(FFdUniformMissing); |
| 90 |
end; |
| 91 |
|
| 92 |
{$endif read_implementation} |