Where Code Meets Creative Content

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Where Code Meets Creative Content

Post by Vectrotek »

Coding, Shaders, Game Logic and Creative content.
Also, File Formats, 3D App to Irrlicht Matters, Texturing and Game Logic etc.
It's a topic that could be elaborated on broadly.
"Aspiring Digital Escapism"
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Get the project..
Image
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Image
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Image
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

This project uses either GLSL or HLSL to render two types of objects, Skinned Objects and Non Skinned Objects..

The skinned objects are rendered with an improved version of the tangents based shader from previous posts.
A few bugs were killed and shader code tries to follow better coding practice (especially on the HLSL side).
Eight images are available for both GLSL and HLSL but only Four or Five is used leaving you with the rest to play with..
While not the main subject in this project the shader for skinned objects are included but not discussed in detail..
You'll probably know whats going on there if you have the last project I posted..
One COMPLETELY NEW thing here is “Light Falloff” which might amuse you..
(GLSL only, but you can easily port it to the HLSL Prototype. I don't have any time right now)
I'll say this.. The next one will include it and also mix Normal maps etc as opposed to this only mixing Diffuse Images..
(water reflection is a priority)

The non-skinned object in this project features a NEW kind of shader that (for this example) does not deal with lighting and
normal mapping etc but mainly with "Image Mixing" or "Splatting". (quite extendable with the other available images channels)..
This shader, one could say "specializes" in "geographic and natural" simulative 3D geometry like Mountains, Rocks, and Vegetation..
It features a New "detailing" function that attempts to minimize or alleviate the patterns that become apparent with even
well designed "Seamless Tile-able" teture images.
It simply creates a copy of the Original Diffuse (or normal etc) Maps with UVs scaled on the fly before "blending"
it with the original image in a way that helps avoid the appearance of visible patterns to emulate a more natural effect.

The 3D data file for these kinds of objects are “*.irrmesh” , here we don't use the scene i.e. “*.irr”
ASCII Based IrrMesh files take a while to load (Fat problem)..
(if anyone knows more about the “Binary Based” IrrMesh files please let me know)
(this is really something that should be developed)

You'll notice that we have TWO Shader callbacks to handle the two different “Shader Families”..

Don't bother looking at the code before you can at least produce a working "*.exe" from the VC 7.1 Project..
You'll get more out of it when you try changing and recompiling and repeating until you have a good idea of what does what..

Not yet implemented, "Render Target Based Water Reflection" is in the works..(there are some cool examples on the forums)
(next on my list)
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Here is the project..
Slightly smaller..
http://s000.tinyupload.com/?file_id=713 ... 7948424888
Enjoy!
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Here is an interesting bit on Blitz Basic's "*.b3d"
http://irrlicht.sourceforge.net/forum/v ... 0&start=15
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

So you want to recompile your Irrlicht Engine, but you don't want to have to
download the VERY LARGE Direct X SDK June 2010..
Get this..
It is only the HEADERS and LIBS you need in your IDE to recompile a custom version of the Irrlicht 3D Engine..
ONLY 2.49 Megs!
http://s000.tinyupload.com/?file_id=852 ... 9159436532
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Where Code Meets Creative Content

Post by chronologicaldot »

Thanks for sharing this!
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Image
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Inspired from the latest DOOM this project uses a DLL resulting from an
Engine Recompile where the only change made was in the "irrCompileConfig.h" file.
It uses GLSL or HLSL shaders.
The DLL is included in the Release Folder along with the Executable.

The Texture Files are in Posterised PNG format to make them as small
as possible.
Posterising Normal Maps is never a good idea but I did, at a level of 24.

If you want the High Quality Images let me know.

The "Level" is in "*.irrmesh" format (from Blender via Tubras).
Irrlicht somehow had the foresight allowing you to have more
than 4 texture layers in your IRRMESH materials.
(even if you have to hand-code them or re-code the Blender Python Script)

The Specular effect was amplified to show the SOLSIRS working.
The shaders are Experimental and are NOT written to be fast.
(for that there is GPU Assembly) They are easily optimiseable.
Try overriding Shader (level object) output to see the actual raw SOLSIRS..
Much of the code is familiar if you downloaded any other projects of mine.
An attempt was made to copy the UV's of a second otherwise Identical Object,
into a given object as extra light map UV's but it is still in the works.


CONTROLS:
"ESC" : Exit
"WASD" or "ARROWS": Camera Movement

"T" : Toggle Character Animation Sequence
"P" : Pause Animation
"O" : Hasten Animation (Sequence Specific)
"I" : Slow Down Animation (Sequence Specific)
"U" : Reverse Animation

"K" : Toggle Camera Light
"L" : Toggle Light A

See code for others.

"Pure Boere Kuber Skakeerders. Is dit nou bakgat of wat!"
Last edited by Vectrotek on Wed Jun 22, 2016 11:08 am, edited 1 time in total.
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Get the whole project and executable here:
http://s000.tinyupload.com/?file_id=048 ... 1418814870
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Image
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

Controls:

Key: Action:

G Toggle Music On or Off.. (to hear water above and below noise)
0 Toggle Post Processing Mode (On by default)

1 Shift Pass# 1 Post Processing Effect Up.
2 Shift Pass# 2 PP Effect Up.
3 Shift Pass# 3 PP Fx Up.
4 Shift Pass# 4 PP Up.
5 Shift Pass# 4 PP Up.
6 Shift Pass# 4 PP Up.
7 Shift Pass# 4 PP Up.
8 Shift Pass# 4 PP Up.
Shift & 1 Reset PostProcessing for Pass 1 to "Bypass" (does nothing).
Shift & 2 Reset PostProcessing for Pass 2 to "Bypass" (does nothing).
Shift & 3 Reset PostProcessing for Pass 3 to "Bypass" (does nothing).
Shift & 4 Reset PostProcessing for Pass 4 to "Bypass" (does nothing).
Shift & 5 Reset PostProcessing for Pass 5 to "Bypass" (does nothing).
Shift & 6 Reset PostProcessing for Pass 6 to "Bypass" (does nothing).
Shift & 7 Reset PostProcessing for Pass 7 to "Bypass" (does nothing).
Shift & 8 Reset PostProcessing for Pass 8 to "Bypass" (does nothing).
9 Reset ALL Passes PP to "Bypass".
W,A,S,D Camera Movement..
Arrows Camera Movement..
T Randomize FIRST Four Passes Effects.
Y Randomize LAST Four Passes Effects.



NOTE: THESE ARE THE SETTINGS YOU PLAY WITH TO GET THE RIGHT EFFECT.
TIP: WHEN IN GREY SCALE PP MODE THE WATER SHOULD NEVER BE LIGHTER THAN THE REST (use as a test)..
ALSO AS OPACITY DECREASES COLOUR APPEARS BRIGHTER SO DARKEN COLOUR WITH INCREASE OPACITY.
ALWAYS CHECK IN GREYSCALE MODE FOR LIGHTNESS.

These are the MAIN WATER RENDERER CONTROLS ..
Takes getting to know, but this is how different waters are simulated..
E Increase "Water Murk"
R Decrease "Water Murk"
Shift & E Decrease Water Colour Scale.
Shift & R Increase Water Colour Scale.
F Increase Liquid Opacity.
C Decrease Liquid Opacity.
M Randomize Water Colour.


U Speed Up Cloud Movement
H Slow Down Cloud Movement
I Scale Cload Layer A Smaller. (make appear further)
J Scale Cload Layer A Larger. (make appear closer)
O Scale Cload Layer B Smaller. (make appear further)
K Scale Cload Layer B Larger. (make appear closer)
P Scale Cload Layer B Smaller. (make appear further)
L Scale Cload Layer B Larger. (make appear closer)

V Toggle Debug Text Display.
B Toggle Water Renderer Debug Images Display.

Put on your earphones..
Vectrotek
Competition winner
Posts: 1087
Joined: Sat May 02, 2015 5:05 pm

Re: Where Code Meets Creative Content

Post by Vectrotek »

O.K.

First, If you see what looks like your code in here, then it probably is.
So, to all those guys who shared their code (of whom there are too many to thank individually)..
Thanks a big pile! (specially to Cute Alien, Elvman, Devsh and tbw)..

It started off as an experiment in Deferred Rendering but then quickly evolved
into a Water Renderer.
I then added Three Layers of Animated Clouds and Lensflares from a Synthetic Sun.

I added a few Screen Quad Post Processing Passes (eight of em) for Both GL's GLSL and DX's HLSL. (they both work)
(most notably NVIDIA's FXAA T.L. for BOTH GLSL & HLSL)

One night I paged through some old stuff and found a little layer I wrote
for the "Audiere" Sound System to make using it a bit easier. (there was an undocumented issue somewhere)
I pasted it in to see how it would work and.. Now we've got sound! Cool!
(for compiling I had included the "*.lib" and header for your IDE, but get the whole thing yourself)
The sound system plays "Wave Samples" like water splashes in Ogg Vorbis Format
and plays "Sequenced" Track Music like "*.it", "*.mod", "s3m" and the rest.
I think it worked quite well! Audierre is very powerfull and often overlooked.
Clever controlling of the "Pan" (balance) versus Sound Source Position could even give
you "3D Directional Sound". (definitely something I'm looking into later)
I also tried changeing the "mood" between above water and below water using different music
trigerred by a single frame flag in "Enter Water" or "Exit Water" state..
The noise of the water above differs from the water flow below..

The Water renderer which is actualy what this is all about does some unique things.
For depth, plane calculations were dropped in favour of fragment distance from the ZERO Point
on the Y axis.. Planes are cool but for this world where water is at X Y Z Zero with Nornal at Y: 1,
distance on Y will do.
This distance is split into RGB for different parts which act on different attributes of the water
like Normal Damping, Colour Intensity and Murk.
Opacity is lerped into the render near the end of the Water Shader.
Opacity is a new thing that could be explained as the difference between blue spirits
and matte blue paint. They are both the same colour but have different ways in which light is
allowed to pass through.
Water is a really complex thing and comes in many different colours, opacities and murkyness.
An example would be a pool into which chlorine was thrown. First the green water looks
"milky blue green" then slowly turns clear low saturation blue.
The water in a river, just after rain is a Matte Brown colour but still reflects under fresnel rules.

Play around with the settings using the relevant keyboard controlls and you'll soon see that you
can emulate almost any kind of liquid.

I implemented "Global Alert Pointers", something that would allow the water renderer to share it's
"states" with the rest of the world so that objects that touch the water would have
their shaders be aware of the state in which the water renderer is in at the moment of rendering
these world objects.
Darkening via gradient of surfaces that are underwater is an example.

Now, the project is ongoing and obviously will be improved but I don't have time right now
and I'm still a bit of an Irrlicht noob.
It might look big and ugly, but it is reasonably modular for you to try your own Things on.
Smart Shaders havent been incorporated into the PP system yet, but you can see it working on the
two static objects. PP Shaders still acts independently.
The start of this conversion process was left in the code so continuing shouldn't be too hard..
This is no quick lesson like you'd find in the examples package, so if you like it hold on to it
and look at it when you've got time. ("Tiny Upload" holds material for 90 days before deleting it)

Smart shaders simply lets you "add" shaders and their feed variables sothat the Callback automatically
knows what variables to send. It also avoids D3D bombarding your console with warnings when you
send a variable that is not in your shader code. (glsl doesn't have this issue)

The main reason I posted this is sothat so people can let me know if there are
any serious problems in the coding.
Id really appreciate critique, so let me have it..
Feel free to use any of the code in your own stuff!

Software used: Irrlicht, Blender, ModPlugTracker, Audacity, Cool Edit, Coolspeech, ZBrush (wavenormals) and Photoshop..

At some point I had to stop beautifying the code, sorry..
Put on your earphones..

Here is the full project: http://s000.tinyupload.com/?file_id=053 ... 2700644252
Post Reply