Click to See Complete Forum and Search --> : pixel in line of sight


greenbean
February 22nd, 2008, 06:47 PM
I wasn't sure what to title this. From a top down isometric style view is it possible to determine if a pixel is in line of sight of a character occupying the center of the screen. If so is it possible to not render pixels (or render them black) that are not in this line of sight.

Alternatively, could there be a light at the players origin that anything the light does not reach would not be rendered. Still having other lighting affect the level but the areas the "line of sight" light does not touch would be black. Hope that makes some sense. Maybe I'll draw up a diagram of what I mean.

I'm just trying to come up with some ideas to solve this as I'm still relatively new to graphics programming. I'm sure it's possible but I'm having trouble implementing it. Hopefully there's a free game or graphics engine I can use. :)

STLDude
February 22nd, 2008, 07:37 PM
This is very large topic which really can not be explained simply on message boards, specially if you are just a beginner. Here (http://www.gamedev.net/reference/list.asp?categoryid=39) is good start. Also, check this (http://www.gamedev.net/) and this (http://www.devmaster.net/). Both sites have large amount of resources and message boards dedicated to developing games.

greenbean
February 22nd, 2008, 07:49 PM
Your response was quite broad as those links point to nothing very specific. Is there a specific area you think I should start? I need to know which topic to research.

Thanks.

STLDude
February 22nd, 2008, 08:08 PM
Hmm... you will need to do some leg work here. Both sites have large set of resources and it's up to you to dig into it. Use the Search button Luke.

greenbean
February 22nd, 2008, 08:48 PM
I have been searching. I'm not expecting a magic how-to answer but I did hope someone might post their thoughts on a possible starting point in solving this problem. Maybe even some topics to research.

If that is all you have to offer than I thank you and will continue to hope someone else will offer something. I hope that this will not end with a "use the search button" reply. It doesn't matter how vast the resources are if you don't know exactly what you are looking for.

Lindley
February 22nd, 2008, 08:57 PM
Some possible search terms include "Line of sight", "visibility graph", "3d visibility problem", etc.

Of course, the other option you have in this case is to define your own clipping planes as if you were rendering from the character's point of view. You'd have to use shaders to do that, I think, but I'm fairly sure it's possible.

Of course, that would still get you seeing "behind" things that the character couldn't see. This could be addressed by rendering the character's view to a texture, and then using the resulting pixels and depth values to do a render of that view in viewer space.

greenbean
February 22nd, 2008, 09:31 PM
Some possible search terms include "Line of sight", "visibility graph", "3d visibility problem", etc.

Of course, the other option you have in this case is to define your own clipping planes as if you were rendering from the character's point of view. You'd have to use shaders to do that, I think, but I'm fairly sure it's possible.

Of course, that would still get you seeing "behind" things that the character couldn't see. This could be addressed by rendering the character's view to a texture, and then using the resulting pixels and depth values to do a render of that view in viewer space.

Thanks Lindley. I will look into your suggestions.

Here's an old attempt I made with the source engine.
http://www.youtube.com/watch?v=8bkbdxQHmNc
It was quite hacky drawing black polygons over non visible areas. As you can see it was quite glitchy and required a lot of tracing so probably not the best implementation. But it does give an example of what I'm trying to accomplish.

STLDude
February 23rd, 2008, 01:24 AM
I'm very surprise that you think I did not provide you any help. You mentioned free 3d engine, my first link point you directly to large page with variety of free engines. My second link gave you very popular game development site, and there is this (http://www.gamedev.net/reference/) page which would take you days to just read through it and would cover any question you might have. It offers articles on AI, DirectX, OpenGL, Graphics and not the least Isometric and Tile-based Games section. Many of those articles where written by people within game industry and provide insights and techniques into game development.

greenbean, you have a wonderful day.

greenbean
February 23rd, 2008, 09:16 AM
I'm very surprise that you think I did not provide you any help. You mentioned free 3d engine, my first link point you directly to large page with variety of free engines. My second link gave you very popular game development site, and there is this (http://www.gamedev.net/reference/) page which would take you days to just read through it and would cover any question you might have. It offers articles on AI, DirectX, OpenGL, Graphics and not the least Isometric and Tile-based Games section. Many of those articles where written by people within game industry and provide insights and techniques into game development.

greenbean, you have a wonderful day.

No I did not mean to imply that you didn't provide any help. Just that it was quite broad and I didn't want other readers to write this thread off as done with a "use the search" answer. I have been researching this for some time with little success which is why I posted this question. I was not expecting someone else to do all the research. Just a nudge in the right direction is all as the number of topics to search through can be quite overwhelming.

Also note I plan to do this in 3d with an orthographic projection so I don't think the Isometric and Tile-based Games section will help me as I'm not making a tile based game. I will still look through the section just in case as it may provoke some ideas.

I hope there are no ill feelings as I do appreciate all the links you provide. It pushes me to continue my research.