Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (2 posts)

Writing a pixel shader that changes the resolution

Last post 4/13/2017 3:45 PM by The ZMan. 1 replies.
  • 4/3/2017 1:36 PM

    Writing a pixel shader that changes the resolution

    Hi everyone,
    In order to theoretically test the performance of a demo I am working on, I need to render an image with varying resolution(pixel density).
    The idea is to enter a certain value to be used as a radius(from the center of the screen) so that the image will have a higher resolution inside the circle, and lower resolution outside of the circle. 
    I know that will not improve the performance, I am more interested in how it will look aesthetically.
    I thought about writing a pixel shader that will use a different value for the desired pixel density for each of the areas, but I am new to writing pixel shaders.
    Could anyone point me in the right direction as to how I can do that?
  • 4/13/2017 3:45 PM In reply to

    Re: Writing a pixel shader that changes the resolution

    Mipmaps are lower resolutions of your texture. You can use tex2dlod to sample from different levels of mipmap.

    https://msdn.microsoft.com/en-us/library/windows/desktop/bb509680(v=vs.85).aspx

    So if you can calculte the distance from the center of your texture you can switch lod
Page 1 of 1 (2 posts) Previous Discussion Next Discussion