the olightsources and the shading/lighting in my v

Community Forums/Showcase/the olightsources and the shading/lighting in my v

RemiD(Posted 2016) [#1]
the olightsources and the shading/lighting in my video game :

Hello, :)

As mentioned before, there will be several olightsources in my video game :

things which emitt light :


different fires which emitt light :

animated gif of the different fires (6.1mo) :
rd-stuff.fr/olightsources-with-fire-(vparticles)-500x312-10fps.gif
(these fires are made with particles but it is a little slow for the symbol emitting fire effect so i may use a mesh made of flat parts (like 2 3drectangles, double sided, in a cross shape) + an animated texture)

And my last shading/lighting formula (with subdivided surfaces each 0.5unit and vertices colors) :


I think that these looks nice enough, i will probably keep it as they are and continue.
I may try to implement global illumination later...

That's all for now...


AdamStrange(Posted 2016) [#2]
maybe not use black for the shadow side, but a darker version of the base color? or darker version of the actual color?


RemiD(Posted 2016) [#3]
@AdamStrange>>Yes i have already tried that in the past, this looks better indeed, especially considering that there will only be one olight per room. I will.


RustyKristi(Posted 2016) [#4]
Looks great RemiD


RemiD(Posted 2016) [#5]
(the mushroom stem parts are not welded because i don't want to waste time with this for the moment...)


RemiD(Posted 2016) [#6]
@AdamStrange>>I am curious, since you have some experience with shaders, which approach would you use to emitt some kind of fireeffect/lighteffect from some texels ? (To produce an effect similar to the symbol emitting fire.)


AdamStrange(Posted 2016) [#7]
mmmmm, good question.

I had mixed results with shaders. not the code or the concepts, but the matrix transforms and lighting with world vs local coordinates.

Admittedly it was all my code, so (i suppose) my fault. But I was sending (each frame) all the data for each object and not using vertex buffers.

I was also using the original openGL matrix transforms and not brewing my own, which is how you are really supposed to do it nowadays.

- This points out that I was using outdated techniques for the rendering pipeline.


So you really need a render pipeline that you are completely in control of. E.G:
- send a vertex and face buffer to the the gpu with one command.
- send your output matrix and any object matrix to the gpu.
- use vertex shaders to do the actual transforms (using your matrices)
- You can then either do vertex lighting, or just pass it onto the fragment shader and do it there. The fragment shader will allow you to do lots more stuff

I know this isn't a simple answer - but 3d is never simple i'm afraid. I can let you look into my (nasty) 3d code if you want, but you might nor want to as it uses outdated methods ?


RemiD(Posted 2016) [#8]
No i don't want to invest time learning to program shaders for the moment, i was just curious of modern methods to produce a similar result than old methods...
(to be honest, i haven't understood much in your previous post :P)

See :
->particle emitted from the texel 3dposition, moving in the direction of the triangle normal (+a one frame texture) :

(in my example, only 20% of texels emitt a particle each frame, and the fps is locked at max 30fps)

->a mesh made of parts, each part made of 4 rectangles in a cross shape positionned at the texel 3dposition, oriented in the direction of the triangle normal (+ a several frames texture) :


and of course, the "quality" of the texture and the blendmode will impact the result a lot.


Matty(Posted 2016) [#9]
Looks nice.
Thought id add my two cents re shaders.

I used to think they were complex....until i tried them. Theyre very easy really. Imagine having two steps. A vertex step and a pixel step. In the vertex step (vertex shader) you handle some transformations of the individual vertex and pass through positions of lights and camera etc.
In the pixel shader you calculate the color of each pixel using values passed through from the vertex shader which are partially transformed for you at that point (interpolated across a triangle). Lighting is really quite easy (not shadows) as the main lighting model used (lambert or phong) is just a handful of vector operations on the intensity of a pixel color.

Shaders are really quite elegant and fun to program. You have complete control over how a pixel is colored.


RemiD(Posted 2016) [#10]
@Matty>>So how would you produce an effect similar to texels emitting a fire effect like in my example ? Would it be easier/faster to use a shader or are the old methods still used ?


Matty(Posted 2016) [#11]
Not sure. Sorry. I know the basics of shaders but would have to look something like that up.


Rick Nasher(Posted 2016) [#12]
Nice one. I'll have to keep this technique in mind.


RemiD(Posted 2016) [#13]
For those interested about that, the second method mentioned in post#8 is very fast to update and to render, but it is uglier compared to the first method (which takes lot of time to update and to render with many particles)

same symbol,

first method :
rd-stuff.fr/firesymbol-with-many-particles-and-one-texture-500w312h-10fps.gif
second method :
rd-stuff.fr/firesymbol-with-one-mesh-made-of-rectangle-faces-and-one-several-frames-texture-500w312h-10fps.gif

However by using different flame animations and one different colors for each flame (i mean the same color but different shades of this color), it may look nice, i will have to do some tests...


RustyKristi(Posted 2016) [#14]
Looks nice RemiD! Is there a demo with source? ;-)


RemiD(Posted 2016) [#15]
Second method is ugly for the moment, but i have several ideas to make it nicer (and it is fast to update and to render !)

No code for the moment since it is wip. Maybe later, depending on my mood ;)


RustyKristi(Posted 2016) [#16]
ok no problem, thanks. keep it up!


Xilvan(Posted 2016) [#17]
Hi,

This librairy simply
looks fantastic!

Congratulation RemiD!

Friendly,


RemiD(Posted 2016) [#18]
@Xilvan>>this is not a library, just effects that i use in one of my game.

Glad that you like it. :) (even if i don't like the theme or gameplay of your candy games, i like some of the effects that you have added, so congrats for that!)