Code Monkey home page Code Monkey logo

realistic-atmosphere-godot-and-ue4's Introduction

Realistic-Atmosphere-Godot-and-UE4

A realistic atmosphere material for both the Godot game engine and Unreal Engine 4

The Unreal version is succeeded by This guide I'll still try and answer issues here, but if you want a more up to date version, then follow the guide.

For Godot, it should be possible to simply copy-paste most of the function from shadertoy into the shader, and adding any missing parameters.

planet_1 planet_3 (more in the images folder)

Showcase videos for godot and ue4

There's also a shadertoy version. The repo for that is here. Guide for converting shadertoy shaders to unreal is here

This resporitory provides code for adding realistic admospheres to godot and unreal engine 4. The size, color and intensity can all be tuned.

For unreal engine 4, a project including all needed assets is given (for version 4.22.3), as well as a plugin, by @gbeniola For godot, a standalone shader file is given, as well as a demo project

usage

The UE4 and Godot versions are used a bit differently, so I've created a seperate guide for them, both of which are here: Godot and UE4

The shadertoy verion of this atmosphere can be found here, also by me.

The code is based on the implementation by scratchapixel, with a few modifications to make it work from space, and to make it look nicer

license

The assets are shared under the MIT license, more detail in the LICENSE file.

If you use this in a game or other software, I'm fine with being credited with "Atmosphere by Dimas Leenman, Shared under the MIT license" somewhere in the credits.

realistic-atmosphere-godot-and-ue4's People

Contributors

dimev avatar jomiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realistic-atmosphere-godot-and-ue4's Issues

Known issues: very big atmosphere. [FIX]

The docs make reference to an issue in Godot with large meshes where the centre of the bounding box isn't rendered. This limit on draw distance is implemented by Godot because, without it, there would be floating point rounding errors close up.

A solution is to manually override the draw distance with:

render_mode skip_vertex_transform;

and within the vertex shader set the z axis max draw equal to the max w distance minus some small amount:

	VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
	NORMAL = (MODELVIEW_MATRIX * vec4(NORMAL, 0.0)).xyz;

	POSITION = (PROJECTION_MATRIX * vec4(VERTEX, 1.0));
	POSITION.z = POSITION.w * 0.999999;

Credit to Bastian Olij.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.