fixed readme

This commit is contained in:
h4570
2022-08-24 22:52:50 +02:00
parent ac335baa75
commit 293113c4d0
9 changed files with 167 additions and 213 deletions
+167 -1
View File
@@ -1 +1,167 @@
# Work in progress
[![Contributors][contributors-shield]][contributors-url]
[![MIT License][license-shield]][license-url]
[![Discord](https://img.shields.io/badge/discord-Tyra-brightgreen?logo=discord)](https://discord.gg/NhhTmg3Gm5)
[![Discord](https://img.shields.io/badge/discord-PS2--Scene-brightgreen?logo=discord)](https://discord.gg/7dCr6ThSN5)
<br />
<p align="center">
<a href="https://github.com/h4570/tyra">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/github-splash.png" alt="Logo" width="100%" height="auto">
</a>
<h3 align="center">Tyra - 2.0</h3>
<p align="center">
Open source game engine for PlayStation 2™
<br />
<a href="https://youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH"><strong>YouTube tutorials »</strong></a>
&nbsp;
<br />
<br />
<a href="https://github.com/h4570/tyra/issues">Report Bug</a>
·
<a href="https://github.com/h4570/tyra/issues">Request Feature</a>
</p>
</p>
[![Stargazers repo roster for h4570/tyra](https://reporoster.com/stars/h4570/tyra)](https://github.com/h4570/tyra/stargazers)
## Table of Contents
* [About the project](#about-the-project)
* [Description](#description)
* [Tutorials](#tutorials)
* [Features](#features)
* [Branches](#branches)
* [Contributing](#contributing)
* [License](#license)
* [Built With](#built-with)
* [Acronyms](#acronyms)
* [Thanks](#thanks)
<br />
## About the Project
<p align="center">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/tyra_code.gif" alt="Sample code" width="500" height="auto">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/showcase.gif " alt="Sample game" width="500" height="auto">
</p>
---
### Description
Tyra is a project that allows you to easily create games for the PlayStation 2 console.
When I tried to make a game for PS2 a few years ago, I realized how many things had to be done to tame this exotic console architecture.
Decision was simple - I need to create an engine which will handle 3D file loading, 2D/3D rendering, animation, audio, handling between PS2 CPUs, synchronization and it should be simple as possible - so people with no experience can create a simple game in a few hours.
**And that's what Tyra is all about.**
### Tutorials
* Setup environment - [Text tutorial](https://github.com/h4570/tyra/tree/master/docs/install) or [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH)
* Cook game assets - [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH)
* Create game from template - [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH)
---
* 01 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/01-hello), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - Hello world
* 02 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/02-sprite), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - 2D rendering
* 03 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/03-minecraft), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - 3D minecraft blocks
* 04 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/04-de_dust2), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - `de_dust2.obj` rendering
* 05 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/05-animation), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - 3D animation
* 06 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/06-audio), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - Background music and sound effects
* 07 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/07-lighting), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - Static lightmap and dynamic directional lights
* 08 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/08-skybox-debug), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - Skybox and debug rendering
* 09 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/09-manual-mode), [Video (soon)](https://www.youtube.com/playlist?list=PLdQVLBcXRRWvtMi-OqccDWLTEFEisD5RH) - Manual rendering (a'la OpenGL)
---
### Features
* Docker image with Tyra, all tools and `PS2DEV` C++20 compiler
* 3D rendering via `VU1` coprocessor:
* Static rendering
* Morph animation rendering
* Super optimized, custom minecraft block renderer
* Debug rendering (lines, boxes, bboxes)
* Manual rendering (a'la `OpenGL`)
* 2D rendering
* Frustum culling:
* Simple - culling whole mesh
* Precise - culling only visible parts of mesh
* Clipping:
* Standard "fake", but fast PS2 clipping done in `VU1`
* Software triangle done in `EE Core`
* Optimized math functions via `VU0` coprocessor
* Background music and sound effects support
* Pad support
* `.wav` Audio file support
* `.obj` 3D file support
* `.md2` 3D file support
* `.png` Texture file support
### Branches
* `master` - stable releases - tested on PS2 & PCSX2.
* `develop` - daily builds.
See the [open issues](https://github.com/h4570/tyra/issues) for a list of proposed features (and known issues).
<br />
## Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/amazing-feature`)
3. Commit your Changes (`git commit -m 'Add some amazing-feature'`)
4. Push to the Branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
<br />
## License
Distributed under the Apache License 2.0 License. See `LICENSE` for more information.
<br />
## Built With
* [PS2DEV](https://github.com/ps2dev/ps2dev)
* [VCLPP](https://github.com/glampert/vclpp)
* Sony VCL
<br />
## Acronyms
* EE (Emotion Engine) - whole set of processors and subsystems that make up the PlayStation 2
* EE Core - main PS2 CPU (c++ done here)
* GS (Graphic synthesizer) - configurable rasterizer and texture mapper. Has only 2MB~ memory for textures, but for the opposite have very high transfer rate, so you can switch textures in the blink
* VU0 - programmable (ASM) vector processor that is accessed by inline assembly code injected into C program.
* VU1 - programmable (ASM) vector processor, which is similar to vertex shader. Accessed via DMA.
* IOP - I/O processor which enables access to peripheral devices, such the game controller
<br />
## Credits
Without these guys, Tyra would not happen:
* Dr Henry Fortuna - for code sources, PS2 academy tutorials
* Rick Gaiser, fjtrujy - for maintaining PS2DEV
* Wellington Carvalho - for testing, contributing to Tyra and sharing cool ideas!
* Lukasz D.K. - for huge archive of PS2 stuff
* Guilherme Lampert - for code sources
* Jesper Svennevid, Daniel Collin - for openvcl's code samples
* Whole PS2DEV team
* Manieq - for nice splash screens!
* And so many other guys. Thanks!
Project Link: [https://github.com/h4570/tyra](https://github.com/h4570/tyra)
Sandro Sobczyński - sandro.sobczynski@gmail.com
[![LinkedIn][linkedin-shield]](https://linkedin.com/in/sandro-sobczyński-28820b15a)
<br />
<a href="https://github.com/h4570/tyra">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/github-splash2.png" alt="Logo" width="100%" height="auto">
</a>
[contributors-shield]: https://img.shields.io/github/contributors/h4570/tyra.svg?style=flat-square
[contributors-url]: https://github.com/h4570/tyra/graphs/contributors
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[license-shield]: https://img.shields.io/github/license/h4570/tyra.svg?style=flat-square
[license-url]: https://github.com/h4570/tyra/blob/master/LICENSE
-24
View File
@@ -1,24 +0,0 @@
TARGET := tutorial_02.elf
ENGINEDIR := ../../engine
#The Directories, Source, Includes, Objects, Binary and Resources
SRCDIR := src
INCDIR := inc
BUILDDIR := obj
TARGETDIR := bin
RESDIR := res
SRCEXT := cpp
VSMEXT := vsm
VCLEXT := vcl
VCLPPEXT := vclpp
DEPEXT := d
OBJEXT := o
#Flags, Libraries and Includes
CFLAGS :=
LIB :=
LIBDIRS :=
INC := -I$(INCDIR)
INCDEP := -I$(INCDIR)
include ../Makefile.tutorials-base
-4
View File
@@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-34
View File
@@ -1,34 +0,0 @@
/*
# _____ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licensed under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tyra>
namespace Tyra {
class Tutorial02 : public Game {
public:
Tutorial02(Engine* engine);
~Tutorial02();
void init();
void loop();
private:
void loadTexture();
void loadSprite();
Engine* engine;
Sprite sprite;
};
} // namespace Tyra
-4
View File
@@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-4
View File
@@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-4
View File
@@ -1,4 +0,0 @@
$ConfigFile = Join-Path $PSScriptRoot '../../windows-pcsx2.ps1'
. $ConfigFile
RunPCSX2
-26
View File
@@ -1,26 +0,0 @@
/*
# _____ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licensed under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#include "engine.hpp"
#include "tutorial_02.hpp"
/**
* In this tutorial we will learn how to:
* - Load png file and create texture from it
* - Create sprite class
* - Clear screen and render sprite
*/
int main() {
Tyra::Engine engine;
Tyra::Tutorial02 game(&engine);
engine.run(&game);
return 0;
}
-112
View File
@@ -1,112 +0,0 @@
/*
# _____ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licensed under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#include <tyra>
#include "tutorial_02.hpp"
namespace Tyra {
Tutorial02::Tutorial02(Engine* t_engine) : engine(t_engine) {}
Tutorial02::~Tutorial02() {
engine->renderer.getTextureRepository().freeBySprite(sprite);
}
void Tutorial02::init() {
engine->renderer.setClearScreenColor(Color(32.0F, 32.0F, 32.0F));
/** Sprite contains rectangle information. */
loadSprite();
/** Texture contains png image. */
loadTexture();
}
void Tutorial02::loop() {
auto& renderer = engine->renderer;
/** Begin frame will clear our screen. */
renderer.beginFrame();
/** Render sprite. */
renderer.renderer2D.render(sprite);
/** End frame will perform vsync. */
renderer.endFrame();
}
void Tutorial02::loadSprite() {
const auto& screenSettings = engine->renderer.core.getSettings();
sprite.mode = SpriteMode::MODE_STRETCH;
/** Let's scale it down */
sprite.size = Vec2(256.0F, 128.0F);
/** Set it in screen center */
sprite.position =
Vec2(screenSettings.getWidth() / 2.0F - sprite.size.x / 2.0F,
screenSettings.getHeight() / 2.0F - sprite.size.y / 2.0F);
TYRA_LOG("Sprite created!");
}
void Tutorial02::loadTexture() {
/**
* Renderer has high layer functions,
* which allows to render:
* - Sprite (2D)
* - Mesh (3D)
*
* It uses ONLY low layer functions which are in renderer.core
*/
auto& renderer = engine->renderer;
/**
* TextureRepository is a repository of textures.
* It is a singleton class, with all game textures.
* We are linking these textures with sprite's (2D) and mesh (3D) materials.
*/
auto& textureRepository = renderer.getTextureRepository();
/**
* Texture is stored in "res" directory.
* Content of "res" directory is automatically copied into
* "bin" directory, which contains our final game.
*
* File utils automatically add's device prefix to the path,
* based on current working directory.
*
* In PS2 world:
* - USB has a "mass:" prefix
* - Our PC in PS2Link has a "host:" prefix
* - Our PC in PCSX2 has a "host:" prefix
*/
auto filepath = FileUtils::fromCwd("tyra.png");
/**
* Tyra supports following PNG formats:
* 32bpp (RGBA)
* 24bpp (RGB)
* 8bpp, palletized (RGBA)
* 4bpp, palletized (RGBA)
*
* 8bpp and 4bpp are the fastest.
* All of these formats can be easily exported via GIMP.
*/
auto* texture = textureRepository.add(filepath);
/** Let's assign this texture to sprite. */
texture->addLink(sprite.id);
TYRA_LOG("Texture loaded!");
}
} // namespace Tyra