testing OpenGL UV stuff...

Started by iWasAdam, January 16, 2018, 10:46:35

Previous topic - Next topic

iWasAdam

Here's a better example with 2 lights in front of the archway, plus 2 blockers forming the base of the arch


The archway and base plate are not textured in any way. and there is NO actual lights being used in the 3d scene itself.
I've draw in where the lights are so you get a feel for them...

Rick Nasher

It's looking quite interesting. How fast is this?
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

iWasAdam

currently hyper stable at 60fps on MacOS and Windows

col

Certainly looks good 8)
You're calculating on the cpu or the gpu?
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

iWasAdam

the lighting is calculated on the CPU:
It currently uses a 64x64 grid of cells.
Light is added as rgb floats (0..255) to the required cells. But higher values can be used for bigger spread.
Blockers are added to any cells.
The light spread is then calculated
The calculations are done again to give a smoother look and make sure the light is creeping/fading around blocked corners etc.

The cells are transferred to an image and then out to the shaders where the light is added to the 3d objects.
The light grid is then decayed (not cleared) for the next set of light calculations. I decay it to prevent any hiccups and also it simulates that a light has persistence when switched off. it doesn't instantly go dark.

col

Thanks for the detailed explanation! Sounds like a viable system. From what I've seen you doing you seem to have a respectable grasp on shaders - have you thought of doing the math on the gpu? or it doesn't need it?

Your screenshots remind me of a couple of classics such Knight Lore and Head Over Heels, but with a visual style similar to Crash Bandicoot.
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

iWasAdam

It's been a log-term project to get the elements right. I thought I had the opengl right before but it all collapsed around me.

This is the latest version which has very good performance and I am slowly bringing the shaders back online.
Here's the latest tweak with the base textures added:


This new version has a much better fidelity that the old version:

iWasAdam

Last post showing something "looking" very nice as dev is worked on and stuff gets activated and tested:

iWasAdam

first look with initial particle code - this is just adding the smoke that the lights will have...

iWasAdam

and a mouse-eye view with different coloured pure red and pure blue lights:

iWasAdam

#25
Here's the final result:


and animated:


each light includes the following:
3 particle systems
- 1 for the flame
- 1 for rising smoke
- 1 for rising lit smotes (those little tiny glowing bits)

6 separate large particles for the additional smoke effect
1 separate large particle for the lens flare

All of these have random rotations, size, motion applied during their birth.


Derron

You need some thing like "coals" or "liquids" acting as the source of the fire. Do not forget a slight random rotation on the z-axis - so the "direction" of the fire (aka the textures displaying a prerotated flame) changes from time to time.

Texture scale of the items is differing too much (crisp door and torch texture vs pixelated texture on the floor). Floor tiles use different texture scale.

Lighting looks good/cool.


bye
Ron

col

I think if you add in normal maps then it would look absolutely awesome with the lights flickering away there... instead of just awesome :)
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."

iWasAdam

Agreed, texturing should be the same though-out ;)

Col, there is one slight problem with normal maps - they depend on light sources. Currently there is NO light - yep, I know, it does my head in as well - hehehe

But there is are no lights being used in the 3d. in essence you are looking at non lit 3d. The lighting that you see, is completely separate from the 3d.

I have got my thinking cap on to see what I can come up with though. what visual effect were you longing to see??

Derron

am not sure whether you still asked col for the desired effect - so excuse if I reply now.

If your torch gets some black liquid filled in (petroleum or so) then make sure it covers the bottom area of the flames - or better: make the flames texture more "flat" at the bottom (means it freshly "emerges from the liquid").


@ normal map
Do you want to calculate it too - so similar to the blockers affecting the light.

bye
Ron