Ooops
January 27, 2021, 07:11:34 AM

Author Topic: testing OpenGL UV stuff...  (Read 5492 times)

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #15 on: January 18, 2018, 02:29:15 PM »
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...

Offline Rick Nasher

  • Hero Member
  • *****
  • Posts: 791
Re: testing OpenGL UV stuff...
« Reply #16 on: January 18, 2018, 03:58:42 PM »
It's looking quite interesting. How fast is this?
_______________________________________
 B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #17 on: January 19, 2018, 06:53:44 AM »
currently hyper stable at 60fps on MacOS and Windows

Offline col

  • Sr. Member
  • ****
  • Posts: 474
Re: testing OpenGL UV stuff...
« Reply #18 on: January 19, 2018, 08:11:19 AM »
Certainly looks good 8)
You're calculating on the cpu or the gpu?
To be is to be perceived.

https://github.com/davecamp

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #19 on: January 19, 2018, 08:51:27 AM »
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.

Offline col

  • Sr. Member
  • ****
  • Posts: 474
Re: testing OpenGL UV stuff...
« Reply #20 on: January 19, 2018, 09:43:16 AM »
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.
To be is to be perceived.

https://github.com/davecamp

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #21 on: January 19, 2018, 12:17:15 PM »
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:

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #22 on: January 19, 2018, 03:30:41 PM »
Last post showing something "looking" very nice as dev is worked on and stuff gets activated and tested:

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #23 on: January 20, 2018, 11:59:33 AM »
first look with initial particle code - this is just adding the smoke that the lights will have...

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #24 on: January 20, 2018, 02:27:20 PM »
and a mouse-eye view with different coloured pure red and pure blue lights:

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #25 on: January 21, 2018, 12:07:00 PM »
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.


Offline Derron

  • Hero Member
  • *****
  • Posts: 3333
Re: testing OpenGL UV stuff...
« Reply #26 on: January 21, 2018, 12:29:49 PM »
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

Offline col

  • Sr. Member
  • ****
  • Posts: 474
Re: testing OpenGL UV stuff...
« Reply #27 on: January 21, 2018, 06:00:12 PM »
I think if you add in normal maps then it would look absolutely awesome with the lights flickering away there... instead of just awesome :)
To be is to be perceived.

https://github.com/davecamp

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2063
Re: testing OpenGL UV stuff...
« Reply #28 on: January 22, 2018, 06:32:45 AM »
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??

Offline Derron

  • Hero Member
  • *****
  • Posts: 3333
Re: testing OpenGL UV stuff...
« Reply #29 on: January 22, 2018, 07:20:48 AM »
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

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal