Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Is it possible to implement terrain implementation only using fragment shader

  1. #1
    Newbie Newbie
    Join Date
    Jul 2018
    Posts
    1

    Is it possible to implement terrain implementation only using fragment shader

    Hi,
    We are trying to create a terrain made of tiles using parallax maping based on hightmap.

    It it possible to implement terrain only using fragment shader? (Using some variety of parallax-making)

    Also we have a reference implementation for the terrain(Attached here). It would be great if anybody can infer what will be shader logic behind this (Is it only parallaxmaping or vertex shader also used here?)


    Thanks
    -Shakthi
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screen Shot 2018-07-24 at 17.27.12.jpg 
Views:	17 
Size:	12.5 KB 
ID:	2811  

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,887
    Quote Originally Posted by shakthijuego View Post
    It it possible to implement terrain only using fragment shader? (Using some variety of parallax-making)
    It's possible, but you'll probably need to use steep parallax mapping (ray-tracing) rather than a simple slope-based offset or a root-finding approach. The main question is whether it will be faster than using geometry. Steep parallax mapping can be slow if the ray skims the surface, as it may have to consider many samples to determine the initial intersection point.

    I have no idea what technique your sample image uses.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,887
    Quote Originally Posted by GClements View Post
    It's possible
    One caveat to this:

    it's likely to be a bit more complicated if the viewpoint can be below the top of the terrain. Most existing parallax mapping techniques assume that the viewpoint is "outside" the surface. If you don't have that guarantee, you'll need to take it into account when trying to adapt existing techniques.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •