Microsoft Store에서 구매하세요
선적 서류 비치
불화
3D 엔진은 현재 개발 초기 단계에 있으며 아직 프로덕션용 게임 엔진에 필요한 필수 기능을 갖추고 있지 않습니다. 그러나 명확하고 미래 지향적인 개발 로드맵이 확립되었으며 완전히 동적인 전역 조명을 위한 가상화된 기하학 및 래디언스 캐스케이드와 같은 고급 시스템을 구현하기 위한 적극적인 작업이 진행되고 있습니다. 개발이 진행됨에 따라 Unity 워크플로와 원활하게 통합되는 C# 게임 엔진 구축을 목표로 내년부터 커뮤니티를 육성할 계획입니다. 귀하의 지원으로 우리는 최신 게임 개발 요구 사항을 충족하는 편집기를 갖춘 강력하고 사용자 친화적인 엔진을 만들 수 있습니다.
3D 엔진의 기능을 보여주는 3D 엔진 샘플 프로젝트입니다. Voxel Sandbox는 다음 기능을 구현합니다.
모든 구성 요소는 C#으로 작성되어 3D 엔진의 기능을 활용하여 모든 기능을 갖춘 애플리케이션을 구축하는 방법을 보여줍니다.
프로젝트에 통합하려면 NuGet 패키지 관리자를 통해 패키지를 설치하세요.
dotnet new console -n Project
cd Project
dotnet add package 3DEngine
dotnet add package Costura.Fody
./Project.csproj
< Project Sdk = " Microsoft.NET.Sdk " >
< PropertyGroup >
< OutputType >WinExe</ OutputType >
< TargetFramework >net8.0-windows10.0.22621.0</ TargetFramework >
< ImplicitUsings >enable</ ImplicitUsings >
< SatelliteResourceLanguages >en</ SatelliteResourceLanguages >
< PlatformTarget >x64</ PlatformTarget >
< PublishAot >true</ PublishAot >
</ PropertyGroup >
< ItemGroup >
< None Remove = " FodyWeavers.xml " />
</ ItemGroup >
< ItemGroup >
< PackageReference Include = " 3DEngine " Version = " 3.1.0 " />
< PackageReference Include = " Costura.Fody " Version = " 5.7.0 " >
< PrivateAssets >all</ PrivateAssets >
</ PackageReference >
</ ItemGroup >
< ItemGroup >
< Content Update = " $(NuGetPackageRoot) 3DEngine 3.1.0contentFilesanynet8.0-windows10.0.22621AssetsResources*** " >
< CopyToOutputDirectory >PreserveNewest</ CopyToOutputDirectory >
</ Content >
</ ItemGroup >
< ItemGroup >
< None Update = " AssetsGeneratorsFileNamesEnumGenerator.tt " >
< Generator >TextTemplatingFileGenerator</ Generator >
< LastGenOutput >FileNamesEnumGenerator.cs</ LastGenOutput >
</ None >
</ ItemGroup >
< ItemGroup >
< Service Include = " {508349b6-6b84-4df5-91f0-309beebad82d} " />
</ ItemGroup >
< ItemGroup >
< Compile Update = " AssetsGeneratorsFileNamesEnumGenerator.cs " >
< DesignTime >True</ DesignTime >
< AutoGen >True</ AutoGen >
< DependentUpon >FileNamesEnumGenerator.tt</ DependentUpon >
</ Compile >
</ ItemGroup >
</ Project >
Visual Studio의 Assets 폴더에 있는 파일에 대해 "PreserveNewest"가 설정되어 있는지 확인하세요. NuGet 패키지 3DEngine 3.1.0의 경로를 바꿉니다.
class Program
{
[ STAThread ]
private static void Main ( ) =>
new Engine . Program ( ) . Run (
config : Engine . Config . GetDefault (
windowCommand : Engine . WindowCommand . Show ,
presentInterval : Engine . PresentInterval . Immediate ,
multiSample : Engine . MultiSample . x4 ,
resolutionScale : 1 ,
title : "3D Engine" ,
width : 2560 , height : 1440 ,
renderGUI : true , defaultBoot : true ) ,
initialization : ( ) =>
Engine . Kernel . Instance . SystemManager . MainEntityManager . CreateEntity ( ) . AddComponent < GameManager > ( ) ,
frame : ( ) => { } ) ;
}
using System ;
using System . Collections ;
using System . Numerics ;
using Engine ;
using Engine . Buffer ;
using Engine . Components ;
using Engine . DataStructures ;
using Engine . ECS ;
using Engine . Editor ;
using Engine . Framework ;
using Engine . Graphics ;
using Engine . GUI ;
using Engine . Helper ;
using Engine . Runtime ;
using Engine . Utilities ;
public class Example : Component
{
[ ToolTip ( "This is a ToolTip" ) ]
[ Show ]
private string _visibleString = "This field is private" ;
[ Hide ]
public string HiddenString = "This field is public" ;
[ ShowOnly ]
public string ShowOnlyString = "This string is not editable" ;
public int Int ;
public float Float ;
public Vector2 Vector2 ;
public Vector3 Vector3 ;
public Vector4 Vector4 ;
[ Slider ( 1 , 100 ) ]
public float Slider ;
public bool Bool ;
[ If ( "Bool" , "True" ) ]
[ ShowOnly ]
public string IfField = "This field is only visible if the bool is true" ;
[ IfNot ( "Bool" , "True" ) ]
[ ShowOnly ]
public string IfNotField = "This field is only visible if the bool is not true" ;
[ Color ]
public Vector4 Color ;
public Entity ? _Entity ;
[ Space ]
[ Header ( "Header" ) ]
public event Action ? Event ;
// This is the base function of OnRegister.
public override void OnRegister ( ) =>
ScriptSystem . Register ( this ) ;
public override void OnAwake ( ) { }
public override void OnStart ( ) { }
public override void OnUpdate ( ) { }
public override void OnLateUpdate ( ) { }
public override void OnFixedUpdate ( ) { }
public override void OnRender ( ) { }
public override void OnGUI ( ) { }
public override void OnDestroy ( ) { }
}
Engine . Loader . ModelLoader . LoadFile ( Engine . ModelFiles . Model ) ;
Engine . Loader . ModelLoader . LoadFile ( Engine . Utilities . AssetPaths . MESHES + "Model.obj" ) ;
Engine . Loader . ImageLoader . LoadFile ( Engine . TextureFiles . TextureAtlas ) ;
Engine . Loader . ImageLoader . LoadFile ( Engine . Utilities . AssetPaths . TEXTURES + "Texture.png" ) ;
Engine . Kernel . Instance . Context . CreateShader ( Engine . Utilities . AssetPaths . SHADERS + "Shader" ) ;
Engine . Kernel . Instance . Context . CreateComputeShader ( Engine . Utilities . AssetPaths . COMPUTESHADERS + "ComputeShader" ) ;
Entity . AddComponent < Example > ( ) ;
Entity . Manager . CreateEntity ( name : "Controller" ) . AddComponent < PlayerController > ( ) . Initialize ( this ) ;
Entity . Manager . CreateEntity ( name : "Sky" ) . AddComponent < DefaultSky > ( ) . Initialize ( ) ;
var mesh = Entity . Manager . CreateEntity ( ) . AddComponent < Mesh > ( ) ;
mesh . SetMeshData ( ModelFiles . Model ) ;
mesh . SetMeshData ( Assets . Meshes [ "Model.obj" ] ) ;
mesh . SetMeshData ( vertices , indices , positions , new InputLayoutHelper ( ) . AddPosition3D ( ) . AddUV ( ) ) ;
mesh . SetRootSignature ( ) ;
mesh . SetRootSignature ( new RootSignatureHelper ( ) . AddConstantBufferView ( 2 ) . AddShaderResourceViewTable ( ) ) ;
mesh . SetMaterialTextures ( TextureFiles . Texture ) ;
mesh . SetMaterialTextures ( textureEntries : [ new ( "Texture.png" , 0 ) ] ) ;
mesh . SetMaterialPipeline ( ShaderFiles . Shader ) ;
mesh . SetMaterialPipeline ( "Shader" ) ;
Engine . Utilities . Output . Log ( Entity . Transform . Position ) ;
if ( Input . GetKey ( Key . Escape , InputState . Down ) )
{
PAUSED = ! PAUSED ;
if ( PAUSED )
Input . SetMouseLockState ( MouseLockState . Unlocked ) ;
else
Input . SetMouseLockState ( MouseLockState . LockedInvisible , 0.5 , 0.5 ) ;
}
if ( ! PAUSED )
Input . SetCursorIcon ( SystemCursor . IDC_CROSS ) ;
3D 엔진 저장소에는 다음이 포함됩니다.
편집기와 엔진 모두에 대해 3DEngine (패키지)을 MSIX 애플리케이션으로 빌드하거나 엔진을 이식 가능한 Win32 애플리케이션으로 빌드할 수 있습니다.
3D 엔진을 컴파일하려면 다음 구성 요소가 포함된 Visual Studio 2022가 있어야 합니다.