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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lolz123

Pages: 1 ... 11 12 [13] 14 15 ... 18
181
SFML projects / SFML Light System - Let There Be Light
« on: January 24, 2012, 09:32:07 pm »
I wasn't planning on it, but I certainly can! I will let you know when it is finished.

182
Graphics / Destruction of the OpenGL context
« on: January 21, 2012, 06:27:45 pm »
Alright, thanks.

183
Graphics / Destruction of the OpenGL context
« on: January 21, 2012, 05:45:48 pm »
Is there no way around this? Can't the texture destructor just check if the context still exists and not delete the texture manually if there is none? As far as I know, OpenGL deletes textures by itself when the associated context is destroyed, but I may be wrong.

184
Graphics / Destruction of the OpenGL context
« on: January 21, 2012, 05:28:45 pm »
Yes, it is a singleton class.

185
Graphics / Destruction of the OpenGL context
« on: January 21, 2012, 03:53:42 pm »
No

186
Graphics / Destruction of the OpenGL context
« on: January 21, 2012, 03:37:58 pm »
Unfortunately, I do not know how to reproduce this error with minimal code, since if it is indeed the destruction order, it will occur randomly. Here is my call stack when the application closes, maybe it helps:

Code: [Select]
> sfml-window-d-2.dll!sf::priv::WglContext::~WglContext()  Line 110 + 0xf bytes C++
  sfml-window-d-2.dll!sf::priv::WglContext::`scalar deleting destructor'()  + 0x16 bytes C++
  sfml-window-d-2.dll!sf::priv::GlContext::GlobalCleanup()  Line 128 + 0x29 bytes C++
  sfml-window-d-2.dll!sf::GlResource::~GlResource()  Line 79 C++
  sfml-graphics-d-2.dll!sf::Texture::~Texture()  Line 104 + 0xf bytes C++
  sfml-graphics-d-2.dll!sf::RenderTexture::~RenderTexture()  Line 48 + 0x12 bytes C++
  GF_Multiplayer_Client.exe!LightSystem::~LightSystem()  Line 96 + 0x91 bytes C++
  GF_Multiplayer_Client.exe!`dynamic atexit destructor for 'lSystem''()  + 0x28 bytes C++
  msvcr100d.dll!doexit(int code=0, int quick=0, int retcaller=0)  Line 567 C
  msvcr100d.dll!exit(int code=0)  Line 393 + 0xd bytes C
  GF_Multiplayer_Client.exe!__tmainCRTStartup()  Line 568 C
  GF_Multiplayer_Client.exe!mainCRTStartup()  Line 371 C


I tried various versions of SFML 2, but I get this error with all of them.

187
Graphics / Destruction of the OpenGL context
« on: January 21, 2012, 04:22:08 am »
Hello,

I have been plagued for a while by some destruction order issues.
When the program closes, it gives me a memory access violation and points me to line 110 in WglContex.cpp. I assume that the OpenGL context is destroying before sf::Texture and sf::RenderTextures are destroyed, but they are still making calls to the context to delete the textures.  The only solution I have had so far is allocating textures on the heap and explicitly deleting them. Is there a way around this?

188
SFML projects / SFML Light System - Let There Be Light
« on: January 07, 2012, 01:38:57 am »
I just made sure to save all of the OpenGL states whenever I did something with the render texture.

189
SFML projects / SFML Light System - Let There Be Light
« on: January 02, 2012, 12:06:06 am »
I uploaded a new version, in which I made the system far more modular. You should be able to slap it on to any existing SFML application without changing much. It also now allows you to set a flag to determine whether or not it will render shadows that are intersecting hulls. It defaults to not drawing them.

If any of you would like some documentation, let me know.

190
SFML projects / SFML Light System - Let There Be Light
« on: January 01, 2012, 07:40:57 pm »
@ Anata: That isn't really a bug, it just doesn't render properly when a light is intersecting a hull. The lights are not points here, or else they would not cast a soft shadow. They have a radius, and when the light circle intersects a hull, the algorithm cannot find the right rays anymore, since the penumbra rays will intersect the hull shape. I now have an algorithm that detects if a light is intersecting a shape, and doesn't draw it when this happens, since it is hard to keep lights out of walls in some games (especially when they are attached to the player). It is ever so slightly slower now though :). I will let you know when the new version is complete.

191
SFML projects / SFML Light System - Let There Be Light
« on: January 01, 2012, 05:32:20 pm »
I uploaded a new version. Does this one work for you guys?

192
SFML projects / SFML Light System - Let There Be Light
« on: January 01, 2012, 03:22:38 pm »
That happens when the light overlaps the hull. Don't forget, the lights are not points, but circles. I can make it detect this case and then simply not draw if you like.

193
SFML projects / SFML Light System - Let There Be Light
« on: January 01, 2012, 02:42:37 pm »
Thanks for the tips! The code is pretty messy, since when I was writing it, I was just struggling to get something to work at all. The quad tree has pretty clean code IMO, but the light rendering certainly doesn't. I think it is time that I clean it up some more. It depends too much on my base windowing code, I will try to make it more modular. I like my own vector functions however :). I could make a bunch of functions that do things like dot and cross products on them, but they cannot be members then, so I wouldn't get intellisense in VS2010 and it would involve more typing. And I am very lazy. I never use any functions requiring SFML vectors anyways. Also, this allows my to use my quad tree in non-sfml projects.

The color classes work differently from the SFML ones. The SFML ones use integers, mine use floats, which I find easier to work with in many cases.

I think I know what causes the strange rendering. I can replicate it on my machine by not saving the OpenGL states right before drawing to a render texture. I do not understand why this is necessary though. Saving states is slow anyways, so I am trying to find a way around this. I will let you know when I have fixed it (or at least have a new version to test).

194
SFML projects / SFML Light System - Let There Be Light
« on: December 31, 2011, 04:00:07 pm »
Unfortunately, I am not very familiar with g++, so here is the limited help I can offer:
C++0x is required, but you seem to be missing a bunch of things in the older version of C++ too, such as auto_ptr. You also are not getting the math libaries (specifically the sqrt function), try including them the way you normally do in g++, and try switching sqrt to sqrtf. g++ seems to complain about the friend keyword a lot, which is strange. Try prefixing all the names of the classes following a friend declaration with "class". Also, your STL containers are complaining about the way I am accessing elements from the iterators, but this shouldn't be different between VS2010 and g++. Perhaps it is some compiler setting.

195
SFML projects / SFML Light System - Let There Be Light
« on: December 31, 2011, 04:17:53 am »
Let There Be Light is a 2D dynamic soft shadows system that uses SFML.

Here are some features:
- Physically accurate soft shadows
- Quad tree scene graph
- Light texture caching
- Emissive lights
- Light beams
- Directional lights
- Adjustable light color, attenuation, spread, source size, cone angle, bloom, and cone edge softness
- Ambient light setting
- Extendable light shape rendering
- Light bloom rendering

Feel free to use this system in a game. Please put me in the credits somewhere :).

Download (includes demo): https://sourceforge.net/projects/letthebelight/

The light system in action in the game "Gore Factor":


Pages: 1 ... 11 12 [13] 14 15 ... 18
anything