Merge branch 'stabilization/2106' into mbalfour/gitflow_210622
# Conflicts: # Code/Framework/AzQtComponents/AzQtComponents/Components/Style.cpp # Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.h # Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cppmonroegm-disable-blank-issue-2
commit
df648db62e
@ -1,34 +0,0 @@
|
||||
CryEngine tips of the day
|
||||
|
||||
You can toggle snap to grid by pressing G.
|
||||
Ctrl+Shift+Clicking somewhere with an object selected quickly moves the object to that position when in move mode.
|
||||
Pressing M will open the material editor.
|
||||
Show and Hide helpers is bound to Shift + Space by default.
|
||||
Enable AI/Physics is bound to Ctrl + P by default.
|
||||
You can save a viewport location by pressing Ctrl + F1 through f12 and go to that position using Shift + F1 through F12.
|
||||
You can link objects together by using the link command on the top menu of the editor.
|
||||
Pressing 1 through 5 on the keyboard will cycle through brush operations such as move or scale.
|
||||
You can simply bind keyboard shortcuts to editor functions by going to Tools --> Customize Keyboard.
|
||||
Pressing H will hide the selected objects, Ctrl-H will unhide all hidden objects.
|
||||
Pressing F will freeze the selected objects, Ctrl-F will unfreeze all frozen objects.
|
||||
Pressing F3 will toggle wireframe view.
|
||||
Camera/terrain collision can be toggled using Q.
|
||||
You can restart the Editor by pressing the restart button on your PC.
|
||||
Pressing Ctrl-C with an object selected will clone that object.
|
||||
Toggle the console by pressing the tilde (~) key.
|
||||
You can dock windows by dragging them onto the blue helpers that appear when you grab a window by the titlebar.
|
||||
You can select materials by clicking on the dropper icon in the material editor and then clicking on the material you wish to select.
|
||||
You can right click on the previewer in the material editor and change the model to different shapes and background colors.
|
||||
Materials can be saved in the local level folder for re-distribution.
|
||||
Always keep your level free of errors and immidiately fix errors reported by the error report screen when you load your level.
|
||||
You must always export to engine before you can run it in pure game mode. (File --> Export to engine)
|
||||
You must re-triangulate AI before playing your level in game mode. (AI --> Generate all navigation)
|
||||
You must always re-generate surface textures after you finish painting the terrain. (File --> Regenerate surface textures)
|
||||
Press Ctrl-G or F12 to go into the Game mode, ESC to return to Editing mode.
|
||||
Quickly rebuild a level (without regenerating the ground texture) by pressing Ctrl-E.
|
||||
Hold down the third mouse button and drag to move the camera up and down.
|
||||
Missing objects are represented by a bright yellow sphere.
|
||||
Hold Alt + Middle Mouse button to rotate around an object.
|
||||
Select multiple objects by holding Ctrl.
|
||||
You can place multiple instances of vegetation by holding Shift and clicking on the terrain.
|
||||
A number of useful commands can be found in Tools --> User commands. This can also be dragged and docked to the main window.
|
||||
@ -0,0 +1,87 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
import pytest
|
||||
import logging
|
||||
from AWS.common.aws_utils import AwsUtils
|
||||
from AWS.Windows.cdk.cdk_utils import Cdk
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def aws_utils(
|
||||
request: pytest.fixture,
|
||||
assume_role_arn: str,
|
||||
session_name: str,
|
||||
region_name: str):
|
||||
"""
|
||||
Fixture for AWS util functions
|
||||
:param request: _pytest.fixtures.SubRequest class that handles getting
|
||||
a pytest fixture from a pytest function/fixture.
|
||||
:param assume_role_arn: Role used to fetch temporary aws credentials, configure service clients with obtained credentials.
|
||||
:param session_name: Session name to set.
|
||||
:param region_name: AWS account region to set for session.
|
||||
:return AWSUtils class object.
|
||||
"""
|
||||
|
||||
aws_utils_obj = AwsUtils(assume_role_arn, session_name, region_name)
|
||||
|
||||
def teardown():
|
||||
aws_utils_obj.destroy()
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return aws_utils_obj
|
||||
|
||||
# Set global pytest variable for cdk to avoid recreating instance
|
||||
pytest.cdk_obj = None
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def cdk(
|
||||
request: pytest.fixture,
|
||||
project: str,
|
||||
feature_name: str,
|
||||
workspace: pytest.fixture,
|
||||
aws_utils: pytest.fixture,
|
||||
bootstrap_required: bool = True,
|
||||
destroy_stacks_on_teardown: bool = True) -> Cdk:
|
||||
"""
|
||||
Fixture for setting up a Cdk
|
||||
:param request: _pytest.fixtures.SubRequest class that handles getting
|
||||
a pytest fixture from a pytest function/fixture.
|
||||
:param project: Project name used for cdk project name env variable.
|
||||
:param feature_name: Feature gem name to expect cdk folder in.
|
||||
:param workspace: ly_test_tools workspace fixture.
|
||||
:param aws_utils: aws_utils fixture.
|
||||
:param bootstrap_required: Whether the bootstrap stack needs to be created to
|
||||
provision resources the AWS CDK needs to perform the deployment.
|
||||
:param destroy_stacks_on_teardown: option to control calling destroy ot the end of test.
|
||||
:return Cdk class object.
|
||||
"""
|
||||
|
||||
cdk_path = f'{workspace.paths.engine_root()}/Gems/{feature_name}/cdk'
|
||||
logger.info(f'CDK Path {cdk_path}')
|
||||
|
||||
if pytest.cdk_obj is None:
|
||||
pytest.cdk_obj = Cdk()
|
||||
|
||||
pytest.cdk_obj.setup(cdk_path, project, aws_utils.assume_account_id(), workspace, aws_utils.assume_session(),
|
||||
bootstrap_required)
|
||||
def teardown():
|
||||
if destroy_stacks_on_teardown:
|
||||
pytest.cdk_obj.destroy()
|
||||
# Enable after https://github.com/aws/aws-cdk/issues/986 is fixed.
|
||||
# Until then clean the bootstrap bucket manually.
|
||||
# cdk_obj.remove_bootstrap_stack()
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return pytest.cdk_obj
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f0f4d4e0155feaa76c80a14128000a0fd9570ab76e79f4847eaef9006324a4d2
|
||||
size 9084
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
<Environment />
|
||||
@ -0,0 +1 @@
|
||||
<TimeOfDay Time="12"/>
|
||||
@ -0,0 +1,6 @@
|
||||
<download name="ClientAuth" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="ED0" md5="dbf5115226e4b0ea38ebdc3967ba3aa9"/>
|
||||
</files>
|
||||
</download>
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:da041115014f11696d5878d5c21247c17b8d694fa9674e30692259261a7223a2
|
||||
size 3792
|
||||
@ -0,0 +1,12 @@
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:43b1a23b62fe2ffa05545ac99524f40b6fff49d6e35925b9d6138c00d8082e86
|
||||
size 9073
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
<download name="ClientAuthPasswordSignIn" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="DDF" md5="ebe91ae5f1ea1ec735b6650b14f3f95b"/>
|
||||
</files>
|
||||
</download>
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a58292341785cb260dc0ccf346259e35e2817ee48fc401a21ab528f6afb97b52
|
||||
size 3551
|
||||
@ -0,0 +1,12 @@
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3d5121b26608b02747e245071ccff29ac57358cb6349ec9495a7a003ac12467
|
||||
size 8942
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
<download name="ClientAuthPasswordSignUp" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="DDA" md5="aa6df891d505d6d9175beee4b55626db"/>
|
||||
</files>
|
||||
</download>
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:605391d415b828b100bada11d108099520c0b6a020f17588887b610475805d90
|
||||
size 3546
|
||||
@ -0,0 +1,12 @@
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:023992998ab5a1d64b38dacd1d5e1a9dc930ff704289c0656ed6eaba6951d660
|
||||
size 9066
|
||||
@ -0,0 +1,79 @@
|
||||
----------------------------------------------------------------------------------------------------
|
||||
--
|
||||
-- All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
-- its licensors.
|
||||
--
|
||||
-- For complete copyright and license terms please see the LICENSE at the root of this
|
||||
-- distribution (the "License"). All use of this software is governed by the License,
|
||||
-- or, if provided, by the license below or the license accompanying this file. Do not
|
||||
-- remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
--
|
||||
--
|
||||
----------------------------------------------------------------------------------------------------
|
||||
local metrics = {
|
||||
}
|
||||
|
||||
function metrics:OnActivate()
|
||||
self.tickTime = 0
|
||||
self.numSubmittedMetricsEvents = 0
|
||||
|
||||
self.tickBusHandler = TickBus.Connect(self,self.entityId)
|
||||
self.metricsNotificationHandler = AWSMetricsNotificationBus.Connect(self, self.entityId)
|
||||
|
||||
LyShineLua.ShowMouseCursor(true)
|
||||
end
|
||||
|
||||
function metrics:OnSendMetricsSuccess(requestId)
|
||||
Debug.Log("Metrics is sent successfully.")
|
||||
end
|
||||
|
||||
function metrics:OnSendMetricsFailure(requestId, errorMessage)
|
||||
Debug.Log("Failed to send metrics.")
|
||||
end
|
||||
|
||||
function metrics:OnDeactivate()
|
||||
AWSMetricsRequestBus.Broadcast.FlushMetrics()
|
||||
Debug.Log("Stop generating new test events and flushed the buffered metrics.")
|
||||
|
||||
self.tickBusHandler:Disconnect()
|
||||
self.metricsNotificationHandler:Disconnect()
|
||||
end
|
||||
|
||||
function metrics:OnTick(deltaTime, timePoint)
|
||||
self.tickTime = self.tickTime + deltaTime
|
||||
|
||||
if self.tickTime > 2.0 then
|
||||
defaultAttribute = AWSMetrics_MetricsAttribute()
|
||||
defaultAttribute:SetName("event_name")
|
||||
defaultAttribute:SetStrValue("login")
|
||||
|
||||
customAttribute = AWSMetrics_MetricsAttribute()
|
||||
customAttribute:SetName("custom_attribute")
|
||||
customAttribute:SetStrValue("value")
|
||||
|
||||
attributeList = AWSMetrics_AttributesSubmissionList()
|
||||
attributeList.attributes:push_back(defaultAttribute)
|
||||
attributeList.attributes:push_back(customAttribute)
|
||||
|
||||
|
||||
if self.numSubmittedMetricsEvents % 2 == 0 then
|
||||
if AWSMetricsRequestBus.Broadcast.SubmitMetrics(attributeList.attributes, 0, "lua", false) then
|
||||
Debug.Log("Submitted metrics without buffer.")
|
||||
else
|
||||
Debug.Log("Failed to Submit metrics without buffer.")
|
||||
end
|
||||
else
|
||||
if AWSMetricsRequestBus.Broadcast.SubmitMetrics(attributeList.attributes, 0, "lua", true) then
|
||||
Debug.Log("Submitted metrics with buffer.")
|
||||
else
|
||||
Debug.Log("Failed to Submit metrics with buffer.")
|
||||
end
|
||||
end
|
||||
|
||||
self.numSubmittedMetricsEvents = self.numSubmittedMetricsEvents + 1
|
||||
self.tickTime = 0
|
||||
end
|
||||
end
|
||||
|
||||
return metrics
|
||||
@ -0,0 +1,6 @@
|
||||
<download name="Metrics" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="E09" md5="f16fff2970a4037af5909b269ceece4b"/>
|
||||
</files>
|
||||
</download>
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e7c0c07b13bb64db344b94d5712e1e802e607a9dee506768b34481f4a76d8505
|
||||
size 3593
|
||||
@ -0,0 +1,12 @@
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Helpers Icon</title>
|
||||
<defs>
|
||||
<circle id="path-1" cx="8" cy="8" r="8"></circle>
|
||||
<path d="M8.59736328,10.1821289 L8.59736328,9.79394531 C8.59736328,9.07617188 8.86835937,8.71728516 9.84248047,8.15332031 C10.8751953,7.54541016 11.4098633,6.77636719 11.4098633,5.67041016 C11.4098633,4.00048828 10.0255859,2.8359375 7.93085937,2.8359375 C5.68232422,2.8359375 4.40791016,4.09570312 4.37128906,5.89746094 L6.35615234,5.89746094 C6.40009766,5.06982422 6.95673828,4.53515625 7.79902344,4.53515625 C8.63398437,4.53515625 9.190625,5.04052734 9.190625,5.73632812 C9.190625,6.43212891 8.90498047,6.79101562 7.96015625,7.35498047 C6.94941406,7.94824219 6.54658203,8.60742188 6.64179687,9.75732422 L6.65644531,10.1821289 L8.59736328,10.1821289 Z M7.70380859,13.7124023 C8.52412109,13.7124023 9.02949219,13.2436523 9.02949219,12.4892578 C9.02949219,11.7275391 8.52412109,11.2587891 7.70380859,11.2587891 C6.88349609,11.2587891 6.37080078,11.7275391 6.37080078,12.4892578 C6.37080078,13.2436523 6.88349609,13.7124023 7.70380859,13.7124023 Z" id="path-3"></path>
|
||||
</defs>
|
||||
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="2nd-ToolBar-v2-(Perspective)-3" transform="translate(-1161.000000, -7.000000)">
|
||||
<g id="2nd-ToolBar-buttons-on-right" transform="translate(1076.000000, 5.000000)">
|
||||
<g id="Helpers-Icon" transform="translate(85.000000, 2.000000)">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<use id="Oval" fill="#FFFFFF" xlink:href="#path-1"></use>
|
||||
<g id="?" fill-rule="nonzero" mask="url(#mask-2)">
|
||||
<use fill="#909090" xlink:href="#path-3"></use>
|
||||
<use fill="#3F3F3F" xlink:href="#path-3"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Buttons / Dropdown button with Icon / no arrow</title>
|
||||
<g id="Buttons-/-Dropdown-button-with-Icon-/-no-arrow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Icons-/-System-/-Menu" fill="#FFFFFF">
|
||||
<rect id="Rectangle-11" x="1.33333333" y="2.66666667" width="13.3333333" height="1.33333333"></rect>
|
||||
<rect id="Rectangle-11" x="1.33333333" y="7.33333333" width="13.3333333" height="1.33333333"></rect>
|
||||
<rect id="Rectangle-11" x="1.33333333" y="12" width="13.3333333" height="1.33333333"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 786 B |
@ -1,460 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "ImageHDR.h"
|
||||
|
||||
// Editor
|
||||
#include "Util/Image.h"
|
||||
|
||||
// We need globals because of the callbacks (they don't allow us to pass state)
|
||||
static CryMutex globalFileMutex;
|
||||
static size_t globalFileBufferOffset = 0;
|
||||
static size_t globalFileBufferSize = 0;
|
||||
|
||||
static char* fgets(char* _Buf, [[maybe_unused]] int _MaxCount, CCryFile* _File)
|
||||
{
|
||||
while (globalFileBufferOffset < globalFileBufferSize)
|
||||
{
|
||||
char chr;
|
||||
|
||||
_File->ReadRaw(&chr, 1);
|
||||
globalFileBufferOffset++;
|
||||
|
||||
*_Buf++ = chr;
|
||||
if (chr == '\n')
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*_Buf = '\0';
|
||||
return _Buf;
|
||||
}
|
||||
|
||||
static size_t fread(void* _DstBuf, size_t _ElementSize, size_t _Count, CCryFile* _File)
|
||||
{
|
||||
size_t cpy = min(_ElementSize * _Count, globalFileBufferSize - globalFileBufferOffset);
|
||||
|
||||
_File->ReadRaw(_DstBuf, cpy);
|
||||
globalFileBufferOffset += cpy;
|
||||
|
||||
return cpy;
|
||||
}
|
||||
|
||||
/* THIS CODE CARRIES NO GUARANTEE OF USABILITY OR FITNESS FOR ANY PURPOSE.
|
||||
* WHILE THE AUTHORS HAVE TRIED TO ENSURE THE PROGRAM WORKS CORRECTLY,
|
||||
* IT IS STRICTLY USE AT YOUR OWN RISK. */
|
||||
|
||||
/* utility for reading and writing Ward's rgbe image format.
|
||||
See rgbe.txt file for more details.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int valid; /* indicate which fields are valid */
|
||||
char programtype[16]; /* listed at beginning of file to identify it
|
||||
* after "#?". defaults to "RGBE" */
|
||||
float gamma; /* image has already been gamma corrected with
|
||||
* given gamma. defaults to 1.0 (no correction) */
|
||||
float exposure; /* a value of 1.0 in an image corresponds to
|
||||
* <exposure> watts/steradian/m^2.
|
||||
* defaults to 1.0 */
|
||||
char instructions[512];
|
||||
} rgbe_header_info;
|
||||
|
||||
/* flags indicating which fields in an rgbe_header_info are valid */
|
||||
#define RGBE_VALID_PROGRAMTYPE 0x01
|
||||
#define RGBE_VALID_GAMMA 0x02
|
||||
#define RGBE_VALID_EXPOSURE 0x04
|
||||
#define RGBE_VALID_INSTRUCTIONS 0x08
|
||||
|
||||
/* return codes for rgbe routines */
|
||||
#define RGBE_RETURN_SUCCESS 0
|
||||
#define RGBE_RETURN_FAILURE -1
|
||||
|
||||
/* read or write headers */
|
||||
/* you may set rgbe_header_info to null if you want to */
|
||||
int RGBE_ReadHeader(CCryFile* fp, uint32* width, uint32* height, rgbe_header_info* info);
|
||||
|
||||
/* read or write pixels */
|
||||
/* can read or write pixels in chunks of any size including single pixels*/
|
||||
int RGBE_ReadPixels(CCryFile* fp, float* data, int numpixels);
|
||||
|
||||
/* read or write run length encoded files */
|
||||
/* must be called to read or write whole scanlines */
|
||||
int RGBE_ReadPixels_RLE(CCryFile* fp, float* data, uint32 scanline_width,
|
||||
uint32 num_scanlines);
|
||||
|
||||
/* THIS CODE CARRIES NO GUARANTEE OF USABILITY OR FITNESS FOR ANY PURPOSE.
|
||||
* WHILE THE AUTHORS HAVE TRIED TO ENSURE THE PROGRAM WORKS CORRECTLY,
|
||||
* IT IS STRICTLY USE AT YOUR OWN RISK. */
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/* This file contains code to read and write four byte rgbe file format
|
||||
developed by Greg Ward. It handles the conversions between rgbe and
|
||||
pixels consisting of floats. The data is assumed to be an array of floats.
|
||||
By default there are three floats per pixel in the order red, green, blue.
|
||||
(RGBE_DATA_??? values control this.) Only the mimimal header reading and
|
||||
writing is implemented. Each routine does error checking and will return
|
||||
a status value as defined below. This code is intended as a skeleton so
|
||||
feel free to modify it to suit your needs.
|
||||
|
||||
(Place notice here if you modified the code.)
|
||||
posted to http://www.graphics.cornell.edu/~bjw/
|
||||
written by Bruce Walter (bjw@graphics.cornell.edu) 5/26/95
|
||||
based on code written by Greg Ward
|
||||
*/
|
||||
|
||||
#ifndef INLINE
|
||||
#ifdef _CPLUSPLUS
|
||||
/* define if your compiler understands inline commands */
|
||||
#define INLINE inline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* offsets to red, green, and blue components in a data (float) pixel */
|
||||
#define RGBE_DATA_RED 0
|
||||
#define RGBE_DATA_GREEN 1
|
||||
#define RGBE_DATA_BLUE 2
|
||||
#define RGBE_DATA_ALPHA 3
|
||||
/* number of floats per pixel */
|
||||
#define RGBE_DATA_SIZE 4
|
||||
|
||||
enum rgbe_error_codes
|
||||
{
|
||||
rgbe_read_error,
|
||||
rgbe_write_error,
|
||||
rgbe_format_error,
|
||||
rgbe_memory_error,
|
||||
};
|
||||
|
||||
/* default error routine. change this to change error handling */
|
||||
static int rgbe_error(int rgbe_error_code, const char* msg)
|
||||
{
|
||||
switch (rgbe_error_code)
|
||||
{
|
||||
case rgbe_read_error:
|
||||
CLogFile::FormatLine("RGBE read error");
|
||||
break;
|
||||
case rgbe_write_error:
|
||||
CLogFile::FormatLine("RGBE write error");
|
||||
break;
|
||||
case rgbe_format_error:
|
||||
CLogFile::FormatLine("RGBE bad file format: %s\n", msg);
|
||||
break;
|
||||
default:
|
||||
case rgbe_memory_error:
|
||||
CLogFile::FormatLine("RGBE error: %s\n", msg);
|
||||
}
|
||||
return RGBE_RETURN_FAILURE;
|
||||
}
|
||||
|
||||
/* standard conversion from rgbe to float pixels */
|
||||
/* note: Ward uses ldexp(col+0.5,exp-(128+8)). However we wanted pixels */
|
||||
/* in the range [0,1] to map back into the range [0,1]. */
|
||||
static INLINE void
|
||||
rgbe2type(char* red, char* green, char* blue, unsigned char rgbe[4])
|
||||
{
|
||||
float f;
|
||||
|
||||
if (rgbe[3]) /*nonzero pixel*/
|
||||
{
|
||||
f = ldexp(1.0f, rgbe[3] - (int)(128 + 8)) * 255.0f;
|
||||
*red = (unsigned char) max(0.0f, min(rgbe[0] * f, 255.0f));
|
||||
*green = (unsigned char) max(0.0f, min(rgbe[1] * f, 255.0f));
|
||||
*blue = (unsigned char) max(0.0f, min(rgbe[2] * f, 255.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
*red = *green = *blue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* minimal header reading. modify if you want to parse more information */
|
||||
int RGBE_ReadHeader(CCryFile* fp, uint32* width, uint32* height, rgbe_header_info* info)
|
||||
{
|
||||
char buf[512];
|
||||
int found_format;
|
||||
float tempf;
|
||||
int i;
|
||||
|
||||
found_format = 0;
|
||||
if (info)
|
||||
{
|
||||
info->valid = 0;
|
||||
info->programtype[0] = 0;
|
||||
info->gamma = info->exposure = 1.0;
|
||||
}
|
||||
if (fgets(buf, sizeof(buf) / sizeof(buf[0]), fp) == NULL)
|
||||
{
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
if ((buf[0] != '#') || (buf[1] != '?'))
|
||||
{
|
||||
/* if you want to require the magic token then uncomment the next line */
|
||||
/*return rgbe_error(rgbe_format_error,"bad initial token"); */
|
||||
}
|
||||
else if (info)
|
||||
{
|
||||
info->valid |= RGBE_VALID_PROGRAMTYPE;
|
||||
for (i = 0; i < sizeof(info->programtype) - 1; i++)
|
||||
{
|
||||
if ((buf[i + 2] == 0) || isspace(buf[i + 2]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
info->programtype[i] = buf[i + 2];
|
||||
}
|
||||
info->programtype[i] = 0;
|
||||
if (fgets(buf, sizeof(buf) / sizeof(buf[0]), fp) == 0)
|
||||
{
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
}
|
||||
for (;; )
|
||||
{
|
||||
if ((buf[0] == 0) || (buf[0] == '\n'))
|
||||
{
|
||||
return rgbe_error(rgbe_format_error, "no FORMAT specifier found");
|
||||
}
|
||||
else if (strcmp(buf, "FORMAT=32-bit_rle_rgbe\n") == 0)
|
||||
{
|
||||
break; /* format found so break out of loop */
|
||||
}
|
||||
else if (info && (azsscanf(buf, "GAMMA=%g", &tempf) == 1))
|
||||
{
|
||||
info->gamma = tempf;
|
||||
info->valid |= RGBE_VALID_GAMMA;
|
||||
}
|
||||
else if (info && (azsscanf(buf, "EXPOSURE=%g", &tempf) == 1))
|
||||
{
|
||||
info->exposure = tempf;
|
||||
info->valid |= RGBE_VALID_EXPOSURE;
|
||||
}
|
||||
else if (info && (!strncmp(buf, "INSTRUCTIONS=", 13)))
|
||||
{
|
||||
info->valid |= RGBE_VALID_INSTRUCTIONS;
|
||||
for (i = 0; i < sizeof(info->instructions) - 1; i++)
|
||||
{
|
||||
if ((buf[i + 13] == 0) || isspace(buf[i + 13]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
info->instructions[i] = buf[i + 13];
|
||||
}
|
||||
}
|
||||
if (fgets(buf, sizeof(buf) / sizeof(buf[0]), fp) == 0)
|
||||
{
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
}
|
||||
if (fgets(buf, sizeof(buf) / sizeof(buf[0]), fp) == 0)
|
||||
{
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
if (strcmp(buf, "\n") != 0)
|
||||
{
|
||||
return rgbe_error(rgbe_format_error,
|
||||
"missing blank line after FORMAT specifier");
|
||||
}
|
||||
if (fgets(buf, sizeof(buf) / sizeof(buf[0]), fp) == 0)
|
||||
{
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
if (azsscanf(buf, "-Y %d +X %d", height, width) < 2)
|
||||
{
|
||||
return rgbe_error(rgbe_format_error, "missing image size specifier");
|
||||
}
|
||||
return RGBE_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
/* simple read routine. will not correctly handle run length encoding */
|
||||
int RGBE_ReadPixels(CCryFile* fp, char* data, int numpixels)
|
||||
{
|
||||
unsigned char rgbe[4];
|
||||
|
||||
while (numpixels-- > 0)
|
||||
{
|
||||
if (fread(rgbe, sizeof(rgbe), 1, fp) < 1)
|
||||
{
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
rgbe2type(&data[RGBE_DATA_RED], &data[RGBE_DATA_GREEN],
|
||||
&data[RGBE_DATA_BLUE], rgbe);
|
||||
data[RGBE_DATA_ALPHA] = 0.0f;
|
||||
data += RGBE_DATA_SIZE;
|
||||
}
|
||||
return RGBE_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
int RGBE_ReadPixels_RLE(CCryFile* fp, char* data, uint32 scanline_width,
|
||||
uint32 num_scanlines)
|
||||
{
|
||||
unsigned char rgbe[4], * scanline_buffer, * ptr, * ptr_end;
|
||||
int i, count;
|
||||
unsigned char buf[2];
|
||||
|
||||
if ((scanline_width < 8) || (scanline_width > 0x7fff))
|
||||
{
|
||||
/* run length encoding is not allowed so read flat*/
|
||||
return RGBE_ReadPixels(fp, data, scanline_width * num_scanlines);
|
||||
}
|
||||
scanline_buffer = NULL;
|
||||
/* read in each successive scanline */
|
||||
while (num_scanlines > 0)
|
||||
{
|
||||
if (fread(rgbe, sizeof(rgbe), 1, fp) < 1)
|
||||
{
|
||||
free(scanline_buffer);
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
if ((rgbe[0] != 2) || (rgbe[1] != 2) || (rgbe[2] & 0x80))
|
||||
{
|
||||
/* this file is not run length encoded */
|
||||
rgbe2type(&data[0], &data[1], &data[2], rgbe);
|
||||
data += RGBE_DATA_SIZE;
|
||||
free(scanline_buffer);
|
||||
return RGBE_ReadPixels(fp, data, scanline_width * num_scanlines - 1);
|
||||
}
|
||||
if ((((int)rgbe[2]) << 8 | rgbe[3]) != scanline_width)
|
||||
{
|
||||
free(scanline_buffer);
|
||||
return rgbe_error(rgbe_format_error, "wrong scanline width");
|
||||
}
|
||||
if (scanline_buffer == NULL)
|
||||
{
|
||||
scanline_buffer = (unsigned char*)
|
||||
malloc(sizeof(unsigned char) * 4 * scanline_width);
|
||||
}
|
||||
if (scanline_buffer == NULL)
|
||||
{
|
||||
return rgbe_error(rgbe_memory_error, "unable to allocate buffer space");
|
||||
}
|
||||
|
||||
ptr = &scanline_buffer[0];
|
||||
/* read each of the four channels for the scanline into the buffer */
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
ptr_end = &scanline_buffer[(i + 1) * scanline_width];
|
||||
while (ptr < ptr_end)
|
||||
{
|
||||
if (fread(buf, sizeof(buf[0]) * 2, 1, fp) < 1)
|
||||
{
|
||||
free(scanline_buffer);
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
if (buf[0] > 128)
|
||||
{
|
||||
/* a run of the same value */
|
||||
count = buf[0] - 128;
|
||||
if ((count == 0) || (count > ptr_end - ptr))
|
||||
{
|
||||
free(scanline_buffer);
|
||||
return rgbe_error(rgbe_format_error, "bad scanline data");
|
||||
}
|
||||
while (count-- > 0)
|
||||
{
|
||||
*ptr++ = buf[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* a non-run */
|
||||
count = buf[0];
|
||||
if ((count == 0) || (count > ptr_end - ptr))
|
||||
{
|
||||
free(scanline_buffer);
|
||||
return rgbe_error(rgbe_format_error, "bad scanline data");
|
||||
}
|
||||
*ptr++ = buf[1];
|
||||
if (--count > 0)
|
||||
{
|
||||
if (fread(ptr, sizeof(*ptr) * count, 1, fp) < 1)
|
||||
{
|
||||
free(scanline_buffer);
|
||||
return rgbe_error(rgbe_read_error, NULL);
|
||||
}
|
||||
ptr += count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* now convert data from buffer into floats */
|
||||
for (i = 0; i < scanline_width; i++)
|
||||
{
|
||||
rgbe[0] = scanline_buffer[i];
|
||||
rgbe[1] = scanline_buffer[i + scanline_width];
|
||||
rgbe[2] = scanline_buffer[i + 2 * scanline_width];
|
||||
rgbe[3] = scanline_buffer[i + 3 * scanline_width];
|
||||
rgbe2type(&data[RGBE_DATA_RED], &data[RGBE_DATA_GREEN],
|
||||
&data[RGBE_DATA_BLUE], rgbe);
|
||||
data[RGBE_DATA_ALPHA] = 0.0f;
|
||||
data += RGBE_DATA_SIZE;
|
||||
}
|
||||
num_scanlines--;
|
||||
}
|
||||
free(scanline_buffer);
|
||||
return RGBE_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool CImageHDR::Load(const QString& fileName, CImageEx& outImage)
|
||||
{
|
||||
CCryFile file;
|
||||
if (!file.Open(fileName.toUtf8().data(), "rb"))
|
||||
{
|
||||
CLogFile::FormatLine("File not found %s", fileName.toUtf8().data());
|
||||
return false;
|
||||
}
|
||||
|
||||
// We use some global variables in callbacks, so we must
|
||||
// prevent multithread access to the data
|
||||
CryAutoLock<CryMutex> tifAutoLock(globalFileMutex);
|
||||
|
||||
globalFileBufferSize = file.GetLength();
|
||||
globalFileBufferOffset = 0;
|
||||
|
||||
bool bRet = false;
|
||||
uint32 dwWidth, dwHeight;
|
||||
rgbe_header_info info;
|
||||
|
||||
if (RGBE_RETURN_SUCCESS == RGBE_ReadHeader(&file, &dwWidth, &dwHeight, &info))
|
||||
{
|
||||
if (outImage.Allocate(dwWidth, dwHeight))
|
||||
{
|
||||
char* pDst = (char*)outImage.GetData();
|
||||
|
||||
if (RGBE_RETURN_SUCCESS == RGBE_ReadPixels_RLE(&file, (char*)pDst, dwWidth, dwHeight))
|
||||
{
|
||||
bRet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bRet)
|
||||
{
|
||||
outImage.Detach();
|
||||
}
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
class CImageEx;
|
||||
|
||||
class CImageHDR
|
||||
{
|
||||
public:
|
||||
bool Load(const QString& fileName, CImageEx& outImage);
|
||||
};
|
||||
@ -0,0 +1,13 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@ -0,0 +1,13 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@ -0,0 +1,22 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../../AWSCoreEditorSystemComponentTest.cpp
|
||||
../../Attribution/AWSCoreAttributionManagerTest.cpp
|
||||
../../Attribution/AWSCoreAttributionMetricTest.cpp
|
||||
../../Attribution/AWSCoreAttributionSystemComponentTest.cpp
|
||||
../../Attribution/AWSAttributionServiceApiTest.cpp
|
||||
../../UI/AWSCoreEditorMenuTest.cpp
|
||||
../../UI/AWSCoreEditorUIFixture.h
|
||||
../../UI/AWSCoreResourceMappingToolActionTest.cpp
|
||||
../../AWSCoreEditorManagerTest.cpp
|
||||
)
|
||||
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/ComponentBus.h>
|
||||
#include <AzCore/Math/Color.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Render
|
||||
{
|
||||
// EBus to get and set fog settings rendered with the sky
|
||||
class SkyBoxFogRequests
|
||||
: public ComponentBus
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(AZ::Render::SkyBoxFogRequests, "{4D477566-54B1-49EC-B8FE-4264EA228482}");
|
||||
|
||||
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
|
||||
virtual ~SkyBoxFogRequests() {}
|
||||
|
||||
virtual void SetEnabled(bool enable) = 0;
|
||||
virtual bool IsEnabled() const = 0;
|
||||
virtual void SetColor(const AZ::Color& color) = 0;
|
||||
virtual const AZ::Color& GetColor() const = 0;
|
||||
// Set and Get the height upwards from the horizon
|
||||
virtual void SetTopHeight(float topHeight) = 0;
|
||||
virtual float GetTopHeight() const = 0;
|
||||
// Set and Get the height downwards from the horizon
|
||||
virtual void SetBottomHeight(float bottomHeight) = 0;
|
||||
virtual float GetBottomHeight() const = 0;
|
||||
};
|
||||
|
||||
typedef AZ::EBus<SkyBoxFogRequests> SkyBoxFogRequestBus;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <SkyBox/SkyBoxFogSettings.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <Atom/Feature/SkyBox/SkyBoxFogBus.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Render
|
||||
{
|
||||
void SkyBoxFogSettings::Reflect(ReflectContext* context)
|
||||
{
|
||||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<SkyBoxFogSettings>()
|
||||
->Version(1)
|
||||
->Field("Enable", &SkyBoxFogSettings::m_enable)
|
||||
->Field("Color", &SkyBoxFogSettings::m_color)
|
||||
->Field("TopHeight", &SkyBoxFogSettings::m_topHeight)
|
||||
->Field("BottomHeight", &SkyBoxFogSettings::m_bottomHeight)
|
||||
;
|
||||
|
||||
if (auto editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<SkyBoxFogSettings>("SkyBoxFogSettings", "")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &SkyBoxFogSettings::m_enable, "Enable Fog", "Toggle fog on or off")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &SkyBoxFogSettings::m_color, "Fog Color", "Color of the fog")
|
||||
->Attribute(AZ::Edit::Attributes::ReadOnly, &SkyBoxFogSettings::IsFogDisabled)
|
||||
->DataElement(AZ::Edit::UIHandlers::Slider, &SkyBoxFogSettings::m_topHeight, "Fog Top Height", "Height of the fog upwards from the horizon")
|
||||
->Attribute(AZ::Edit::Attributes::ReadOnly, &SkyBoxFogSettings::IsFogDisabled)
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 0.5)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.01)
|
||||
->DataElement(AZ::Edit::UIHandlers::Slider, &SkyBoxFogSettings::m_bottomHeight, "Fog Bottom Height", "Height of the fog downwards from the horizon")
|
||||
->Attribute(AZ::Edit::Attributes::ReadOnly, &SkyBoxFogSettings::IsFogDisabled)
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 0.3)
|
||||
->Attribute(AZ::Edit::Attributes::Step, 0.01)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<SkyBoxFogRequestBus>("SkyBoxFogRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "render")
|
||||
->Attribute(AZ::Script::Attributes::Module, "render")
|
||||
->Event("SetEnabled", &SkyBoxFogRequestBus::Events::SetEnabled)
|
||||
->Event("IsEnabled", &SkyBoxFogRequestBus::Events::IsEnabled)
|
||||
->Event("SetColor", &SkyBoxFogRequestBus::Events::SetColor)
|
||||
->Event("GetColor", &SkyBoxFogRequestBus::Events::GetColor)
|
||||
->Event("SetTopHeight", &SkyBoxFogRequestBus::Events::SetTopHeight)
|
||||
->Event("GetTopHeight", &SkyBoxFogRequestBus::Events::GetTopHeight)
|
||||
->Event("SetBottomHeight", &SkyBoxFogRequestBus::Events::SetBottomHeight)
|
||||
->Event("GetBottomHeight", &SkyBoxFogRequestBus::Events::GetBottomHeight)
|
||||
->VirtualProperty("Enable", "IsEnabled", "SetEnabled")
|
||||
->VirtualProperty("Color", "GetColor", "SetColor")
|
||||
->VirtualProperty("TopHeight", "GetTopHeight", "SetTopHeight")
|
||||
->VirtualProperty("BottomHeight", "GetTopHeight", "SetBottomHeight")
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
bool SkyBoxFogSettings::IsFogDisabled() const
|
||||
{
|
||||
return !m_enable;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Math/Color.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Render
|
||||
{
|
||||
struct SkyBoxFogSettings final
|
||||
{
|
||||
AZ_RTTI(AZ::Render::SkyBoxFogSettings, "{DB13027C-BA92-4E46-B428-BB77C2A80C51}");
|
||||
|
||||
static void Reflect(ReflectContext* context);
|
||||
|
||||
SkyBoxFogSettings() = default;
|
||||
|
||||
bool IsFogDisabled() const;
|
||||
|
||||
AZ::Color m_color = AZ::Color::CreateOne();
|
||||
bool m_enable = false;
|
||||
float m_topHeight = 0.01;
|
||||
float m_bottomHeight = 0.0;
|
||||
};
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue