All Projects → profan → XenkoByteSized

profan / XenkoByteSized

Licence: MIT license
Some Xenko usage samples for Xenko 3.1.0.1 beta

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to XenkoByteSized

hana-ml-samples
This project provides code examples for SAP HANA Predictive and Machine Learning scenarios and is educational content. It covers simple Predictive Analysis Library SQL examples as well as complete SAP HANA design-time “ML scenario”-application content or HANA-ML Python Notebook examples.
Stars: ✭ 67 (+252.63%)
Mutual labels:  sample-code
ui5-service-worker-sample
ui5-service-worker-sample demonstrates how the Service Worker API, available in modern web browsers, could be used in a UI5 app to realize different caching strategies.
Stars: ✭ 16 (-15.79%)
Mutual labels:  sample-code
getting-started-with-serverless
Follow along with blog posts, code samples, and practical exercises to learn how to build serverless applications from your local Integrated development environment (IDE).
Stars: ✭ 46 (+142.11%)
Mutual labels:  sample-code
cecilifier
A tool aiming to make it a little bit easier to learn Mono.Cecil
Stars: ✭ 39 (+105.26%)
Mutual labels:  sample-code
fiori-elements-feature-showcase
Sample application that demonstrates and documents a broad variety of features of SAP Fiori elements for OData V4. Developers can play around with the new features and learn how to implement them.
Stars: ✭ 76 (+300%)
Mutual labels:  sample-code
raspberryTools
Some useful tools for Raspberry Pi
Stars: ✭ 24 (+26.32%)
Mutual labels:  sample-code
node-resthooksdemo
A simple node.js RESTHooks demo built upon the Sails Web Framework
Stars: ✭ 68 (+257.89%)
Mutual labels:  sample-code
abap-odata-smoke-test
This ABAP Report performs simple smoke tests for activated ODATA services, providing basic automated testing for your ODATA endpoints.
Stars: ✭ 13 (-31.58%)
Mutual labels:  sample-code
netbackup-api-code-samples
Contains code samples that demonstrate the use of NetBackup REST API
Stars: ✭ 41 (+115.79%)
Mutual labels:  sample-code
teched2021-developer-keynote
SAP TechEd 2021 Developer Keynote: Improving Developers' Lives.
Stars: ✭ 23 (+21.05%)
Mutual labels:  sample-code
Profane
Scripting language for derps
Stars: ✭ 18 (-5.26%)
Mutual labels:  sample-code
cloud-cap-risk-management
The SAP Risk Management example applications show how to deploy a CAP (SAP Cloud Application Programming model) application to Cloud Foundry and Kyma.
Stars: ✭ 36 (+89.47%)
Mutual labels:  sample-code
hcp-portal-service-samples
Code samples of site and page templates, applications, widgets, shell plugins and more, intended to be used as references for development of custom content for SAP HANA Cloud Platform portal service sites.
Stars: ✭ 29 (+52.63%)
Mutual labels:  sample-code
pdftron-android-samples
PDFTron Android Samples
Stars: ✭ 30 (+57.89%)
Mutual labels:  sample-code
cloud-abap-rap
This repository contains several examples how to develop with the ABAP RESTful Application Programming Model (RAP) in SAP BTP, ABAP environment.
Stars: ✭ 98 (+415.79%)
Mutual labels:  sample-code
SampleFoodBlog
🔥 Android blog application, built with Firebase
Stars: ✭ 23 (+21.05%)
Mutual labels:  sample-code
Card-Tray-Demo
A clone of Apple's Wallet app
Stars: ✭ 40 (+110.53%)
Mutual labels:  sample-code
cap-sflight
Using SAP Cloud Application Programming Model and SAP Fiori elements to build a simple travel management app, both with Node.js and Java.
Stars: ✭ 65 (+242.11%)
Mutual labels:  sample-code
cloud-platform-iot-starterkit
This repository provides information and code for working with SAP Cloud Platform Internet of Things. It enables users to get an end-to-end IoT solution with either real hardware or simulators up and running fast and start their own extensions and usage based on this.
Stars: ✭ 276 (+1352.63%)
Mutual labels:  sample-code
StrideToolkit
Stride Toolkit is a .NET Standard library for use with the Stride Game Engine.
Stars: ✭ 24 (+26.32%)
Mutual labels:  xenko

XenkoByteSized

Intended as a sort of dumping ground for various small samples of using Xenko to do various things, like procedurally generate meshes.

Project is currently on Xenko 3.1.0.1-beta02-0752.

XenkoByteSized.ProceduralMesh.TetrahedronMesh

A simple example of creating a mesh procedurally by supplying vertices, also calculates normals automatically. Can be observed in the scene that loads when you open the project aside from the source itself.

Uses only a vertex buffer to be as simple as possible.

tetrahedra

XenkoByteSized.ProceduralMesh.Cubemesh

Another example of creating a mesh procedurally, in this case with with an index buffer and instead for a cube (as it makes sense finally to use an index buffer here)

24 vertices, 36 indices.

cube

XenkoByteSized.ProceduralMesh.SubdividedPlaneMesh

A somewhat less simple example of expanding upon the above, generates a subdivided plane with a configurable width, height and number of subdivisions in each quadrant.

Uses a HeightfieldColliderShape for collision, somewhat absurdly calculates this from the mesh data rather than deriving the mesh data from the heightmap data, but alas.. It works well enough here.

Still does not use any index buffer, probably should.

Has some basic operations possible like:

  • Raising/Lowering terrain (Left/Middle Mouse)
  • Smoothing terrain (Shift + Left Mouse)
  • Leveling terrain (Ctrl + Left Mouse)
  • Dropping orbs on the terrain (Spacebar)

(scrollwheel to change marker radius for terrain)

Can also be observed in the same scene

terrain

XenkoByteSized.SplitScreen

A fixed size splitscreen example, with the view being split up in left and right and rendered by different cameras.

This one is slightly harder to simply link to some code to illustrate, you'll want to explore the following to see whats going on:

  • Scenes/SplitScreenScene
  • Scenes/SplitScreen/SplitScreenCompositor
  • Scenes/SplitScreen/LeftTexture
  • Scenes/SplitScreen/RightTexture

The scene itself: splitscreen

A relevant piece of the compositor setup, where the default CameraRenderer at the root has been replaced by a SceneRenderCollection, as can be seen in this page on the Xenko Docs about render targets.

compositor

Misc Considerations

Of the most important bits to consider here are:

  • The main renderer renders only the sprites for each of the render textures, (Group 31 in our case), while the render targets render everything except Group 31 (can be observed by looking at the RenderMask in the GraphicsCompositor for each renderer).
  • I created a special script which just takes the center offset at which to place the render texture on screen, a reference to the render texture, the render group it should be in (to not be rendered by the split screen cameras) and creates the sprite for it.
  • I made sure the main camera goes through a forward renderer without postfx (so render left and apply postfx, render right and apply postfx, then the main path composits but does not apply postfx).

XenkoByteSized.TriggerScene - DoorScript

A small two room scene that uses a trigger volume to show/hide a door and enable/disable its collider so the player can pass through. Also comes with a PlayerController set up with a simple capsule collider so you can walk around in the small scene.

The scene itself is composed entirely out of primitives.

(might revisit this to make the door not just pop out of existence)

trigger scene

XenkoByteSized.VehicleScene - VehicleScript

A small scene using rigid bodies together with constraints to create a small vehicle composed of a solid block and 4 cylinders connected to the block with a Generic6DofConstraint for each cylinder, each constraint limited in rotation such that each cylinder only rotates like you might expect a wheel attached to an axle act.

So we get a vehicle that can roll on these cylinders!

To understand this sample I recommend experimenting with it, changing the type of constraint and adjusting limits etc.

(will probably revisit this to let the front wheels turn)

vehicle scene

XenkoByteSized.ProceduralMesh.CombinedMeshes - Shader: MultiMeshShader

So this is a sample of using streamout/transform feedback [1] [2] to render a lot of geometry at once.

To be precise, in our case it's 4096 cubes.

How does it work? In a few steps.

  1. With a small custom render pipeline and our shader we render without a pixel/fragment shader with DrawIndexedInstanced in order to do our "instancing", which in fact only outputs our transformed geometry to another buffer (our stream out buffer: streamOutBufferBinding) n number of times, where n is how many separate instances we want to render.
  2. We take the ModelComponent + Mesh that we have Xenko-side and set its MeshDraw's vertex buffer to be our newly created streamout buffer (which we also flagged as a vertexbuffer). At this point we're in business!

In our example we haven't given any thought to multiple materials, or materials at all for that matter, but for each involved entity there is a unique transform that is applied, and now also a unique colour thanks to tebjan as you can see in the shader.

Note that this probably only works on DX11 (maybe DX12) box scene

Misc

The sample also switches out the graphics compositor to the one associated with the scene being switched to currently, currently only relevant for the SplitScreen sample.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].