Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GLLight2D  (Read 23310 times)

0 Members and 1 Guest are viewing this topic.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Re: GLLight2D
« Reply #15 on: June 26, 2013, 09:37:59 pm »
Here's a screenshot of what I get: http://snag.gy/gWRGg.jpg

After the first wglSwapBuffers I have 1 texture and 3 buffer textures. That's ok, although the third buffer texture is 0 width x 1 height. Is that correct?

The texture bound to the FBO is still black.  :'(

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: GLLight2D
« Reply #16 on: June 26, 2013, 09:43:27 pm »
The third one shouldn't be empty. I think that one is the material buffer, and no material probably results in black! I will look into it now.
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: GLLight2D
« Reply #17 on: June 26, 2013, 10:01:08 pm »
Hmm, that's not the problem. It actually says it is 0x1 for me too, but when I change the material, the render reflects those changes, so gDEBugger is not correct.

Try validating the shader by changing

bool TracerScene::Create(const std::string &shaderName)
{
        return m_traceShader.CreateAsset(shaderName);
}
 

To

bool TracerScene::Create(const std::string &shaderName)
{
        if(!m_traceShader.CreateAsset(shaderName))
                return false;

        return Shader::Validate(m_traceShader.GetProgID());
}
 
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Re: GLLight2D
« Reply #18 on: June 26, 2013, 10:09:05 pm »
Changed the code and nothing new happens. The shader loads fine, although, I checked the compiler log using gDEBugger:

Quote
0(4) : warning C7532: global type samplerBuffer requires "#version 140" or later
0(4) : warning C0000: ... or #extension GL_EXT_gpu_shader4 : enable
0(95) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(96) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(97) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(98) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(116) : warning C7551: OpenGL first class arrays require #version 120
0(116) : warning C7553: OpenGL array assignments require #version 120
0(124) : warning C7551: OpenGL first class arrays require #version 120
0(124) : warning C7553: OpenGL array assignments require #version 120
0(125) : warning C7551: OpenGL first class arrays require #version 120
0(125) : warning C7553: OpenGL array assignments require #version 120
0(126) : warning C7551: OpenGL first class arrays require #version 120
0(126) : warning C7553: OpenGL array assignments require #version 120
0(127) : warning C7551: OpenGL first class arrays require #version 120
0(127) : warning C7553: OpenGL array assignments require #version 120
0(174) : warning C7531: global function texelFetchBuffer requires "#extension GL_EXT_gpu_shader4 : enable" before use
0(423) : warning C7011: implicit cast from "int" to "float"
0(423) : warning C7011: implicit cast from "int" to "float"
0(457) : warning C7011: implicit cast from "int" to "float"
0(457) : warning C7011: implicit cast from "int" to "float"
0(465) : warning C7011: implicit cast from "int" to "float"
0(465) : warning C7011: implicit cast from "int" to "float"
0(465) : warning C7011: implicit cast from "int" to "float"
0(116) : warning C7553: OpenGL array assignments require #version 120
0(124) : warning C7553: OpenGL array assignments require #version 120
0(125) : warning C7553: OpenGL array assignments require #version 120
0(126) : warning C7553: OpenGL array assignments require #version 120
0(127) : warning C7553: OpenGL array assignments require #version 120

Maybe is that. I'm going to try to fix those warnings.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Re: GLLight2D
« Reply #19 on: June 26, 2013, 10:14:57 pm »
I've fixed those warnings and nothing has changed. Here is the fragment shader code: https://gist.github.com/Skyrpex/7933a44438c50fc7049d
« Last Edit: June 26, 2013, 10:38:17 pm by panithadrum »

Daffern

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: GLLight2D
« Reply #20 on: July 06, 2013, 07:06:29 pm »
Thank you so much for this! Me and a friend are making a game and it would be awesome if we could use this for lightening  :)

Edit:

I (Think i) have correctly opened the project and linked it, but when its starts, the console thingy opens up and i get an error box saying:

---------------------------
The Game.exe - Application Error
---------------------------
The application was unable to start correctly (0xc000007b). Click OK to close the application.
---------------------------
OK   
---------------------------

Any clue why this happens?
« Last Edit: July 06, 2013, 10:46:40 pm by Daffern »

ThreeDumps

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: GLLight2D
« Reply #21 on: September 11, 2013, 09:57:41 pm »
Well, I've install that lib and it's work but... Is there any documentation for this lib?

Rendering scene take some time (it's not immediate, take 1-2 seconds to get perfect) that is difference from the last project of this author. It's option to set that scene render immediate? Or this lib have other classes with that functionality? 

@Daffern,
Have same errors but I added all *.dll from sfml and glew32.dll and it's run nice.
« Last Edit: September 11, 2013, 10:07:03 pm by akwes »

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: GLLight2D
« Reply #22 on: September 13, 2013, 03:46:52 am »
Unfortunately there is no documentation... yet.

GLLight2D can be run in real-time on more powerful machines, but depending on your target platforms, you can pre-generate a light map (texture with all lighting rendered to it) on level load using it instead. GLLight2D operates entirely differently from LTBL, it is a path tracer, which has the benefit of giving you full global illumination, but is much more processing intensive. So, it is a looks vs. performance trade-off. If you want speed, go with LTBL, if you want global illumination, go with GLLight2D. I personally think GLLight2D is much cooler :)
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Estivo

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
Re: GLLight2D
« Reply #23 on: September 13, 2013, 07:41:20 am »
I'm using LTBL and I like it. I have to do some modification and it looks very good. Original had shity blend modes. Now I have real darkness and good looking light.

emplace

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: GLLight2D
« Reply #24 on: November 15, 2013, 04:06:18 pm »
Great work !

Daffern

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: GLLight2D
« Reply #25 on: November 17, 2013, 12:36:37 am »
I have a problem using LTBL with long hulls. The light sometimes goes through the hull, especially if the hull is long in one direction compared to the other direction. Do you (lolz123) or anyone else know why this happen or how i can fix it?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Re: GLLight2D
« Reply #26 on: November 17, 2013, 12:58:01 pm »
I have a problem using LTBL with long hulls.
Why don't you post on the LTBL thread instead of here?
Also a detailed description would be required to help further.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Daffern

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: GLLight2D
« Reply #27 on: November 18, 2013, 10:29:58 pm »
I did post it there (http://en.sfml-dev.org/forums/index.php?topic=6635.255 at the bottom), but it seemed no one else had the same problem and since i saw lolz123 here i wanted to ask if he knew what the problem was.
« Last Edit: November 18, 2013, 10:52:08 pm by Daffern »

 

anything