Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Water Reflections + Different Planes


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
17 replies to this topic

#1 riuthamus   Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 18 January 2013 - 09:29 PM

Normally, you would have 1 plane and reflect from there. How do you do this when you have 15 different planes? With a block based world we could have reflections coming from all over the place depending on where a player placed the water



Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 9044

Like
1Likes
Like

Posted 19 January 2013 - 02:33 PM

You mean 15 different planes of water? Or something else like reflective blocks, etc...?


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#3 riuthamus   Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 19 January 2013 - 03:36 PM

think levels. Maybe the water is flowing down, how would one reflect the part that is flowing down? We already have 1 reflective surface based off of a very large plane. What if the water moves or moves to another plane... how to reflect from there? Telanor should be up in about an hour, when he gets up i will have him post here and give some more information.



#4 Telanor   Members   -  Reputation: 1346

Like
1Likes
Like

Posted 19 January 2013 - 04:44 PM

It's not so much flowing water we're trying to deal with but rather lots of flat pools of water on different planes. How do you get proper reflections for all of them without having to render the scene for each pool individually?

#5 kalle_h   Members   -  Reputation: 1471

Like
1Likes
Like

Posted 19 January 2013 - 06:00 PM

It's not so much flowing water we're trying to deal with but rather lots of flat pools of water on different planes. How do you get proper reflections for all of them without having to render the scene for each pool individually?

You could try using screenspace local reflections. To hide ugly artifacts with screenspace technique limitations create one cubemap that contain close enough result for reflections. Blend between local reflection and cubemap when reflection vector start to point towards camera. This method will give you reflections everywhere so you need to use roughness, specular color or someting else to dampen spots where you don't want mirror like reflections.

#6 Telanor   Members   -  Reputation: 1346

Like
0Likes
Like

Posted 19 January 2013 - 06:26 PM

Aren't screen space reflections only suited to smaller indoor areas? And how would you use a single cubemap work for all the different reflections?

#7 kalle_h   Members   -  Reputation: 1471

Like
1Likes
Like

Posted 20 January 2013 - 10:08 AM

Aren't screen space reflections only suited to smaller indoor areas? And how would you use a single cubemap work for all the different reflections?
Cubemap would be used only if screenspace does not contain valid data. Sky box would be good candidate for it.
It does no matter much if the area is indoor or outdoor because everything is gathered from screenspace so relative distances does not matter.

There is quite good picture comparion showing the effect in outdoor scene http://blogs.amd.com/play/2012/06/06/fast-and-beautiful-the-directx®-tech-of-nexuiz/

Edited by kalle_h, 21 January 2013 - 03:55 AM.


#8 riuthamus   Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 20 January 2013 - 09:00 PM

Eh, that link seems dead...



#9 Telanor   Members   -  Reputation: 1346

Like
0Likes
Like

Posted 20 January 2013 - 09:06 PM

Skybox for what...? We use a dynamic sky and using a static skybox for the reflections wouldn't match the world it's reflecting. The screenshots in that link showing screen space reflections don't really make much sense. There are literally no reflections in the image they're showing, instead it seems to show the difference between two different lighting setups...

#10 kalle_h   Members   -  Reputation: 1471

Like
1Likes
Like

Posted 21 January 2013 - 04:04 AM

Skybox for what...? We use a dynamic sky and using a static skybox for the reflections wouldn't match the world it's reflecting. The screenshots in that link showing screen space reflections don't really make much sense. There are literally no reflections in the image they're showing, instead it seems to show the difference between two different lighting setups...
You always could render dynamic cubemap from location of player and use that as fallback solution if screenspace does not have data for reflections.
There is another screenshot http://img23.imageshack.us/img23/935/screenshot0000gx.jpg

#11 riuthamus   Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 21 January 2013 - 05:23 AM

<blockquote class="ipsBlockquote" data-author="Telanor" data-cid="5023744"><p>Skybox for what...? We use a dynamic sky and using a static skybox for the reflections wouldn't match the world it's reflecting. The screenshots in that link showing screen space reflections don't really make much sense. There are literally no reflections in the image they're showing, instead it seems to show the difference between two different lighting setups...</p></blockquote><br />You always could render dynamic cubemap from location of player and use that as fallback solution if screenspace does not have data for reflections.<br />There is another screenshot http://img23.imageshack.us/img23/935/screenshot0000gx.jpg<br />

 

eh.. what? formatting on that is off so i have no clue what you are trying to say. Sorry man, i appreciate you trying to help us btw.



#12 kalle_h   Members   -  Reputation: 1471

Like
1Likes
Like

Posted 21 January 2013 - 02:46 PM



Skybox for what...? We use a dynamic sky and using a static skybox for the reflections wouldn't match the world it's reflecting. The screenshots in that link showing screen space reflections don't really make much sense. There are literally no reflections in the image they're showing, instead it seems to show the difference between two different lighting setups...

You always could render dynamic cubemap from location of player and use that as fallback solution if screenspace does not have data for reflections.
There is another screenshot http://img23.imageshack.us/img23/935/screenshot0000gx.jpg
 
 


eh.. what? formatting on that is off so i have no clue what you are trying to say. Sorry man, i appreciate you trying to help us btw.
 
 


Sorry about that formatting it must be forum software bug, noticed that couple times now. Finally found good picture with outdoor screenspace reflections. https://twitter.com/iquilezles/status/291255436420718593/photo/1/large

#13 riuthamus   Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 21 January 2013 - 02:48 PM

oh that looks amazing... so what are you suggestion, to use screenspace instead of cube?



#14 kalle_h   Members   -  Reputation: 1471

Like
1Likes
Like

Posted 21 January 2013 - 04:13 PM

oh that looks amazing... so what are you suggestion, to use screenspace instead of cube?
Cubemap is only fallback when reflection ray point outside of screenspace. So at edges of screen you start smoothly blend towards cubemap reflection instead. Same should be also done when reflection ray start point towards camera. Another option would just fade reflections off at edge cases but that would make these areas too dark.
Think technique as image based lightning that dynamically replace cubemap samples with better data if avaible.

#15 Telanor   Members   -  Reputation: 1346

Like
0Likes
Like

Posted 28 January 2013 - 07:24 PM

I can't seem to find any documentation on how screen space reflection is even done. Are there any tutorials anywhere?

#16 Hodgman   Moderators   -  Reputation: 30884

Like
1Likes
Like

Posted 29 January 2013 - 03:38 AM

oh that looks amazing...

Inigo Quilez is an amazing graphics tinkerer, he built that landscape in a weekend, and that water in an hour... That's an order of magnitude more productive than most of us could hope to be at these tasks wink.png

I can't seem to find any documentation on how screen space reflection is even done. Are there any tutorials anywhere?

I'm not aware of any tutorials, but the principle is the same as parallax mapping techniques (parallax occlusion mapping, quadtree displacement mapping, etc), except that --
* with parallax mapping, you start with a ray that is outside of the "volume". Assuming your texture repeats, the ray will eventually intersect with the volume somewhere.
* with screen-space reflections, your starting ray is already inside the "volume", maybe heading in or maybe heading out. You need to deal with the cases where the ray leaves the volume.
-- in either case, you step along that ray through the volume until you find a collision.

The naive implementation is just to truncate the ray to two dimensions and step one pixel at a time. To speed this up, you can approximate by stepping 'n' pixels at a time.
Fancier parallax techniques (POM, QDM, etc) are basically ways to implement this basic idea more efficiently/accurately.

Edited by Hodgman, 29 January 2013 - 03:44 AM.


#17 kalle_h   Members   -  Reputation: 1471

Like
2Likes
Like

Posted 29 January 2013 - 03:44 AM

I can't seem to find any documentation on how screen space reflection is even done. Are there any tutorials anywhere?

HLSL implementation.
http://www.gamedev.net/blog/1323/entry-2254101-real-time-local-reflections/


OpenGl implementation with some bloggin covering the progress
http://ianlilleycis565.blogspot.fi/

#18 riuthamus   Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 29 January 2013 - 09:03 AM

Inigo Quilez is an amazing graphics tinkerer, he built that landscape in a weekend, and that water in an hour... That's an order of magnitude more productive than most of us could hope to be at these tasks wink.png

 

Hm...perhaps we can all obtain it some day. rolleyes.gif






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS