Skip to content

Commit

Permalink
Docs: Updated architecture and plugin manuals, fixing various Doxygen…
Browse files Browse the repository at this point in the history
… warnings
  • Loading branch information
BearishSun committed Apr 10, 2018
1 parent e8d9e4c commit d6359b0
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 97 deletions.
Binary file modified Documentation/Manuals/Images/ArchitectureSimple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Documentation/Manuals/User/bsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BSL syntax {#bsl}
===============
[TOC]

All shaders in Banshee are written in BSL (Banshee Shading Language). The core of the language is based on HLSL (High Level Shading Language), with various extensions to make development easier. In this manual we will not cover HLSL syntax, nor talk about shaders in general, and will instead focus on the functionality specific to BSL. If you are not familiar with the concept of a shader, or HLSL syntax, it is suggested you learn about them before continuing.
All shaders in bs::f are written in BSL (bs::f Shading Language). The core of the language is based on HLSL (High Level Shading Language), with various extensions to make development easier. In this manual we will not cover HLSL syntax, nor talk about shaders in general, and will instead focus on the functionality specific to BSL. If you are not familiar with the concept of a shader, or HLSL syntax, it is suggested you learn about them before continuing.

# Basics

Expand Down Expand Up @@ -297,7 +297,7 @@ Often you will want to define mixins in separate files. BSL files are normally s
In order to include other files in BSL, use the \#include command. The paths are relative to the working folder, or if you are working in Banshee 3D editor, the paths are relative to your project folder. You can use the special variables $ENGINE$ and $EDITOR$ to access paths to the builtin engine and editor shaders.

~~~~~~~~~~~~~~
// Include the code for accessing Banshee's GBuffer
// Include the code for accessing the GBuffer
#include "$ENGINE$/GBufferInput.bslinc"
shader MyShader
Expand Down
83 changes: 29 additions & 54 deletions Documentation/Manuals/architecture.md

Large diffs are not rendered by default.

55 changes: 22 additions & 33 deletions Documentation/Manuals/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ bs::f supports plugins for the following systems:
- Importers - Importers that handle conversion of some third party resource format into an engine-ready format.
- Physics - Runs the physics simulation.
- Renderer - Determines how is the scene displayed (lighting, shadows, post-processing, etc.).
- Rendering API - Wrappers for render APIs like DirectX, OpenGL or Vulkan.
- Rendering backend - Wrappers for render APIs like DirectX, OpenGL or Vulkan.

You can choose which plugins are loaded on **Application** start-up, by filling out the @ref bs::START_UP_DESC "START_UP_DESC" structure.

~~~~~~~~~~~~~{.cpp}
START_UP_DESC startUpDesc;
// Required plugins
startUpDesc.renderAPI = "BansheeD3D11RenderAPI";
startUpDesc.renderer = "RenderBeast";
startUpDesc.audio = "BansheeOpenAudio";
startUpDesc.physics = "BansheePhysX";
startUpDesc.input = "BansheeOISInput";
startUpDesc.renderAPI = "bsfD3D11RenderAPI";
startUpDesc.renderer = "bsfRenderBeast";
startUpDesc.audio = "bsfOpenAudio";
startUpDesc.physics = "bsfPhysX";
startUpDesc.input = "bsfOISInput";
// List of importer plugins we plan on using for importing various resources
startUpDesc.importers.push_back("BansheeFreeImgImporter"); // For importing textures
startUpDesc.importers.push_back("BansheeFBXImporter"); // For importing meshes
startUpDesc.importers.push_back("BansheeFontImporter"); // For importing fonts
startUpDesc.importers.push_back("BansheeSL"); // For importing shaders
startUpDesc.importers.push_back("bsfFreeImgImporter"); // For importing textures
startUpDesc.importers.push_back("bsfFBXImporter"); // For importing meshes
startUpDesc.importers.push_back("bsfFontImporter"); // For importing fonts
startUpDesc.importers.push_back("bsfSL"); // For importing shaders
// ... also set up primary window in startUpDesc ...
Expand All @@ -39,46 +39,35 @@ Application::startUp(startUpDesc);
In this manual we'll focus on general functionality common to all plugins, while we'll talk about how to implement plugins for specific systems in later manuals.

# Generating a CMake project {#plugins_a}
Plugins are always created as their own projects/libraries. Banshee uses the CMake build system for managing its projects. Therefore the first step you need to take is to create your own CMake project. This involves creating a new folder in the /Source directory (e.g. Source/MyPlugin), with a CMakeLists.txt file inside it. CMakeLists.txt will contain references to needed header & source files, as well as dependencies to any other libraries.
Plugins are always created as their own projects/libraries. bs::f uses the CMake build system for managing its projects. Therefore the first step you need to take is to create your own CMake project. This involves creating a new folder in the /Source/Plugins directory (e.g. Source/Plugins/MyPlugin), with a CMakeLists.txt file inside it. CMakeLists.txt will contain references to needed header & source files, as well as dependencies to any other libraries.

An example CMakeLists.txt might look like so:
~~~~~~~~~~~~~
# --Source files--
# Source files
set(SOURCE_FILES
"Include/MyHeader.h"
"Source/MyPlugin.cpp"
)
# --Include directories--
# This plugin depends on BansheeUtility, BansheeCore and BansheeEngine libraries, as well as a third party library named someThirdPartyLib, so we reference the folders where their header files are located. Paths are relative to the plugin folder.
set(INCLUDE_DIRS
"Include"
"../BansheeUtility/Include"
"../BansheeCore/Include"
"../BansheeEngine/Include"
"../../Dependencies/someThirdPartyLib/include")
include_directories(${INCLUDE_DIRS})
# --Target--
# Registers our plugin a specific name (MyPlugin) and with the relevant source files
# Target
## Registers our plugin a specific name (MyPlugin) and with the relevant source files
add_library(MyPlugin SHARED ${SOURCE_FILES})
# --Libraries--
# Registers dependencies on any other libraries
## Register dependency on an external library: someThirdPartyLib
add_library_per_config(MyPlugin someThirdPartyLib Release/someThirdPartyLib Debug/someThirdPartyLib)
# Include directories
## Including just the current folder
target_include_directories(MyPlugin PRIVATE "./")
## Register dependencies on Banshee libraries
target_link_libraries(MyPlugin PUBLIC BansheeUtility BansheeCore BansheeEngine)
# Libraries
## Link with bsf
target_link_libraries(MyPlugin PUBLIC bsf)
~~~~~~~~~~~~~

Note that we won't go into details about CMake syntax, it's complex and there are many other guides already written on it.

After creating your project's CMake file, you need to register it with the main CMakeLists.txt present in the /Source directory. Simply append the following line:
~~~~~~~~~~~~~
# Provided your plugin is located in Source/MyPlugin folder
add_subdirectory(MyPlugin)
# Provided your plugin is located in Source/Plugins/MyPlugin folder
add_subdirectory(Plugins/MyPlugin)
~~~~~~~~~~~~~

# Plugin interface {#customPlugins_b}
Expand Down
4 changes: 2 additions & 2 deletions Source/Foundation/bsfCore/Managers/BsGpuProgramManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace bs
class BS_CORE_EXPORT GpuProgramFactory
{
public:
GpuProgramFactory() {}
virtual ~GpuProgramFactory() { }
GpuProgramFactory() = default;
virtual ~GpuProgramFactory() = default;

/** @copydoc GpuProgram::create */
virtual SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace bs
virtual SPtr<GpuBuffer> createGpuBufferInternal(const GPU_BUFFER_DESC& desc,
GpuDeviceFlags deviceMask = GDF_DEFAULT) = 0;

/** @copydoc createVertexDeclaration(const List<VertexElement>&, GpuDeviceFlags) */
/** @copydoc createVertexDeclaration(const Vector<VertexElement>&, GpuDeviceFlags) */
virtual SPtr<VertexDeclaration> createVertexDeclarationInternal(const Vector<VertexElement>& elements,
GpuDeviceFlags deviceMask = GDF_DEFAULT);

Expand Down
2 changes: 1 addition & 1 deletion Source/Foundation/bsfCore/RenderAPI/BsGpuProgram.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace bs
SPtr<GpuProgramBytecode> getBytecode() const { return mBytecode; }

/**
* @copydoc bs::GpuProgram::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags)
* @copydoc bs::GpuProgram::create(const GPU_PROGRAM_DESC&)
* @param[in] deviceMask Mask that determines on which GPU devices should the object be created on.
*/
static SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT);
Expand Down
2 changes: 1 addition & 1 deletion Source/Foundation/bsfCore/Renderer/BsRenderable.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace bs
TRenderable();
virtual ~TRenderable();

/** @copydoc SceneActor::setTransform */
/** @copydoc bs::SceneActor::setTransform */
void setTransform(const Transform& transform) override;

/**
Expand Down
1 change: 0 additions & 1 deletion Source/Foundation/bsfEngine/Resources/BsBuiltinResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace bs
Custom,
/** Physically based shader used for opaque 3D geometry. */
Standard,

/** Physically based shader used for transparent 3D geometry. */
Transparent
};
Expand Down
2 changes: 1 addition & 1 deletion Source/Plugins/bsfGLRenderAPI/GLSL/BsGLSLProgramFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace bs { namespace ct
/** @copydoc GpuProgramFactory::create(GpuProgramType, GpuDeviceFlags) */
SPtr<GpuProgram> create(GpuProgramType type, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;

/** @copydoc GpuProgramFactory::compile(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
/** @copydoc GpuProgramFactory::compileBytecode(const GPU_PROGRAM_DESC&) */
SPtr<GpuProgramBytecode> compileBytecode(const GPU_PROGRAM_DESC& desc) override;
protected:
static const String LANGUAGE_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace bs { namespace ct
/** @copydoc GpuProgramFactory::create(GpuProgramType, GpuDeviceFlags) */
SPtr<GpuProgram> create(GpuProgramType type, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;

/** @copydoc GpuProgramFactory::compile(const GPU_PROGRAM_DESC&) */
/** @copydoc GpuProgramFactory::compileBytecode(const GPU_PROGRAM_DESC&) */
SPtr<GpuProgramBytecode> compileBytecode(const GPU_PROGRAM_DESC& desc) override;
protected:
static const String LANGUAGE_NAME;
Expand Down

0 comments on commit d6359b0

Please sign in to comment.