Lazarus

Programming => Graphics and Multimedia => Games => Topic started by: lainz on February 25, 2018, 09:51:56 pm

Title: Castle Game Engine demo WIP
Post by: lainz on February 25, 2018, 09:51:56 pm
This starts from here:
http://forum.lazarus.freepascal.org/index.php/topic,40180.msg277717.html#msg277717

We're making a demo for Castle Game Engine, trying to show the power of the 3D engine.

Files
https://github.com/lazarusccr/cge_demo/releases
Title: Re: Castle Game Engine demo WIP
Post by: lainz on February 25, 2018, 11:33:57 pm
Hi, this is a new version of the room made with Blender, hopefully it looks almost the same or better in Castle Game Engine.

https://github.com/lazarusccr/cge_demo/releases/download/1.0/CastleDemo_3D_v2.7z

It requires Blender 2.79.

Title: Re: Castle Game Engine demo WIP
Post by: Paul_ on February 25, 2018, 11:41:02 pm
It's Castle vs Blender game engine? Blender is no racer :)
Title: Re: Castle Game Engine demo WIP
Post by: lainz on February 25, 2018, 11:44:18 pm
It's Castle vs Blender game engine? Blender is no racer :)

No. We're using blender to make the scene. Then Eugene Loza is creating the program to view the scene with Castle Game Engine.

Edit: attached how it looks in Unity-
Title: Re: Castle Game Engine demo WIP
Post by: taazz on February 26, 2018, 04:15:01 am
unity looks better not to many shines but it would be better if we could have the same view angle on both.
Title: Re: Castle Game Engine demo WIP
Post by: Eugene Loza on February 26, 2018, 06:29:29 am
Then Eugene Loza is creating the program to view the scene with Castle Game Engine.
It's mostly not about creating the program (it's really simple - just Scene.Load and setting a few parameters), but about specifying/faking the correct parameters for blender x3d exporter which is unfortunately very buggy (e.g. it doesn't have "on=true" for lights, also it doesn't handle multitextures, etc.) :)
Title: Re: Castle Game Engine demo WIP
Post by: lainz on February 26, 2018, 05:06:03 pm
unity looks better not to many shines but it would be better if we could have the same view angle on both.

I will try.

Maybe is somewhat different because I used postprocessing filters (https://assetstore.unity.com/packages/essentials/post-processing-stack-83912).

Also the materials that are just plain colors are rendered different.

And the lights for some reason are not imported, so I've added the lights by hand on Unity scene.

Then Eugene Loza is creating the program to view the scene with Castle Game Engine.
It's mostly not about creating the program (it's really simple - just Scene.Load and setting a few parameters), but about specifying/faking the correct parameters for blender x3d exporter which is unfortunately very buggy (e.g. it doesn't have "on=true" for lights, also it doesn't handle multitextures, etc.) :)

Well, Unity does not import the lights also, and normal maps, I must add them by hand.. Maybe the same buggy exporter from blender to FBX.
Title: Re: Castle Game Engine demo WIP
Post by: RAW on February 26, 2018, 05:32:57 pm
The wall in UNITY doesn't look good to me at all !!!  :)

It looks much more distorted than the blender wall...maybe that depends on the viewpoint...
Maybe it's normal in 3D games... the last time I played some 3D type of game is some time ago...  :)
Title: Re: Castle Game Engine demo WIP
Post by: lainz on February 26, 2018, 06:34:29 pm
Hi again, this is the executable for Windows so you can test how it looks on Unity from any angle:
https://github.com/lazarusccr/cge_demo/releases/download/1.0/Demo_Unity_ReleaseWindows.7z

I'm waiting Eugene Loza demo on Castle Game Engine.

The goal I think is that on Castle Game Engine looks the same or better than in Unity.

If someone needs the Unity project just ask.

I updated the room.blend also, because some normals was pointing to the wrong side, and the plant was not 'baked' into a regular object, it was still a particle system.
https://github.com/lazarusccr/cge_demo/releases/download/1.0/room.blend

(Notice that the .blend does not have textures, you must download first this https://github.com/lazarusccr/cge_demo/releases/download/1.0/CastleDemo_3D_v2.7z and replace the blend file.)
Title: Re: Castle Game Engine demo WIP
Post by: Paul_ on February 26, 2018, 11:35:11 pm
I'm curious about the result :)

By the way Unity is still behind Cryengine (strong in exteriors/nature) and Unreal Engine in lighting methods and renderer.
Unity 3D games often looks like that 3d objects are made from paper, this scene isn't bad.
Title: Re: Castle Game Engine demo WIP
Post by: lainz on February 27, 2018, 12:30:01 am
I'm curious about the result :)

By the way Unity is still behind Cryengine (strong in exteriors/nature) and Unreal Engine in lighting methods and renderer.
Unity 3D games often looks like that 3d objects are made from paper, this scene isn't bad.

I doubt is a problem of Unity, but the problem of the designers. I'm not the greatest designer and I don't have a lot of practice doing this 3D things. My scene is very simple.
https://www.youtube.com/watch?v=UfPPEqmxrYI
https://www.youtube.com/watch?v=MX1qRM-lTEU
Title: Re: Castle Game Engine demo WIP
Post by: lainz on February 27, 2018, 08:09:02 pm
I think this is how it should look on Castle Game Engine
https://www.artstation.com/artwork/PWe4n (Blender Cycles)

Maybe not today, but some day  :)

Video (Unity):
https://youtu.be/csvNMzq8H5M
Title: Re: Castle Game Engine demo WIP
Post by: Paul_ on February 27, 2018, 08:16:13 pm
Maybe with raytracing :)
Title: Re: Castle Game Engine demo WIP
Post by: kagamma on April 18, 2018, 03:39:38 pm
A bit late to the party, but since I am also interested in this subject I tried to do it myself and here's the result:
https://i.imgur.com/2SuAo6H.png
https://i.imgur.com/UXuXCqf.png

Some notes:
- The image was taken using view3dscene, which uses castle game engine as renderer.
- The room was exported using castle game engine's X3D exporter, with bump mapping disabled (I got a lot of errors if I enable it together with shadow mapping).
- Castle game engine doesn't support shadow casting from point light source so I changed all light sources in the room to spotlight.
- I removed 6 light sources so only 3 left (this is just my laziness, I didn't want to edit all of it using view3dscene).
- The lights were edited using view3dscene, but I couldn't save the scene (it saved but I got a lot of errors when I tried to load it). So the scene file attached here is the one without any major light modifications .
- Castle game engine doesn't support .tiff file format so in order to load the scene those .tiff files need to be converted to png.

Another one with only 1 light source + no shadow, but with bump mapping enabled :P:
https://i.imgur.com/hMUt3oG.png
Title: Re: Castle Game Engine demo WIP
Post by: lainz on April 18, 2018, 06:43:50 pm
Nice, thankyou!
Title: Re: Castle Game Engine demo WIP
Post by: kagamma on April 18, 2018, 08:04:41 pm
Nice, thankyou!
Thanks!
I played around with view3dscene's predefined post-processing shaders and here's another result:
https://i.imgur.com/UXuXCqf.png

Still only 3 spotlights in the room.
Title: Re: Castle Game Engine demo WIP
Post by: Handoko on April 18, 2018, 08:18:09 pm
Maybe I'm wrong, but I wonder why no one mentioned about using lightmap. It is very useful to create realistic lighting for static objects especially rooms. The most benefit things of using lightmap are, you can have soft shadow and ambient occlusion effect.

Rendering soft shadow is very slow, but without soft shadow it will looks very 3D-generated. And the calculation of ambient occlusion effect is extremely slow. So lightmap is used to solve the problems. It is generated by using a 3D renderer software and the pre-rendered lightmap is used in the game.

Any 3D game engine that can use lightmap usually will be able to give you nice looking graphics result. Of course it depends on the artist's skill.

More info:
https://en.wikipedia.org/wiki/Pre-rendering
https://en.wikipedia.org/wiki/Lightmap
https://en.wikipedia.org/wiki/Ambient_occlusion

Below is the comparison of Lainz's original image with the result of manually-added ambient occlusion effect.

I do a lot of image retouching for computer generated images. One of the thing I always pay attention is the ambient occlusion effect. In the images below, without AO the furnitures and vase seem to float in the air. Note: If you can't notice the differences, you can try to save them at your local disk and run them as slideshow.
Title: Re: Castle Game Engine demo WIP
Post by: kagamma on April 18, 2018, 08:39:37 pm
^ because it will destroy the main purpose of the demo - to see if castle game engine is capable of creating real-time graphics that's comparable to AAA game engines out there :P
Title: Re: Castle Game Engine demo WIP
Post by: lainz on April 18, 2018, 08:57:27 pm
I know what ambient occlusion is, just I forget to add it with a setting that blender already have.

In the video, using Unity, it has ambient occlusion in realtime.

And yes, in Unity you can bake lights also, and get a realistic environment.. but I've not played too much with that.

But, I think I did not forget to add it here https://www.artstation.com/artwork/PWe4n

Is not as noticeable as in the edited image / realtime vide, because it's made with Cycles, and adding fake AO is not quite right. But the lights are not realistic, that was not the goal also..
Title: Re: Castle Game Engine demo WIP
Post by: Handoko on May 31, 2018, 06:27:00 am
Although the image you generated is not very realistic, but I like it. The low-key lighting, the strong contrast, noticeable soft shadow, narrow depth of focus and the vignetting effect. You just need to put some blood splatters, it looks good for survival horror games.
Title: Re: Castle Game Engine demo WIP
Post by: lainz on August 11, 2018, 01:26:50 am
I will try to mix Castle Game Engine and BGRABitmap (or if not possible, try to port some BGRABitmap code to CGE) to produce an Android application, let's see what happens.
TinyPortal © 2005-2018