{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/Win2D/issues/342","repository_url":"https://api.github.com/repos/Microsoft/Win2D","labels_url":"https://api.github.com/repos/Microsoft/Win2D/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/Win2D/issues/342/comments","events_url":"https://api.github.com/repos/Microsoft/Win2D/issues/342/events","html_url":"https://github.com/Microsoft/Win2D/issues/342","id":152951353,"number":342,"title":"way to get the image uv and sampler2D in a hlsl custom effect?","user":{"login":"juanpaexpedite","id":5947026,"avatar_url":"https://avatars.githubusercontent.com/u/5947026?v=3","gravatar_id":"","url":"https://api.github.com/users/juanpaexpedite","html_url":"https://github.com/juanpaexpedite","followers_url":"https://api.github.com/users/juanpaexpedite/followers","following_url":"https://api.github.com/users/juanpaexpedite/following{/other_user}","gists_url":"https://api.github.com/users/juanpaexpedite/gists{/gist_id}","starred_url":"https://api.github.com/users/juanpaexpedite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanpaexpedite/subscriptions","organizations_url":"https://api.github.com/users/juanpaexpedite/orgs","repos_url":"https://api.github.com/users/juanpaexpedite/repos","events_url":"https://api.github.com/users/juanpaexpedite/events{/privacy}","received_events_url":"https://api.github.com/users/juanpaexpedite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-04T08:04:02Z","updated_at":"2016-05-04T08:04:02Z","closed_at":null,"body":"I do not know too much about shaders, so really sorry for that, this is my first attempt and what I understand from the example files is that are defined some input values that are used and at the end the processed value is returned.\r\n\r\nI want to create a pixelation effect but I do not know how to get the image pixel in this case. I understand it is a bit different because I have to use D2D_PS_ENTRY instead of the comment:\r\n\r\n    //float4 main(float2 uv : TEXCOORD) : COLOR\r\n    D2D_PS_ENTRY(main)\r\n\r\nSo how I begin with that because then I have to use it to be able to create the effect:\r\n\r\n    #define D2D_INPUT_COUNT 3\r\n    #define D2D_INPUT0_SIMPLE\r\n    #define D2D_INPUT1_SIMPLE\r\n    //#define D2D_INPUT2_COMPLEX ? Do I need it or get from the method instead of the following line?\r\n    //sampler2D implicitInputSampler : register(S0); this is from the original example\r\n\r\n    #include \"d2d1effecthelpers.hlsli\"\r\n    D2D_PS_ENTRY(main)\r\n    {\r\n    float HorizontalPixelCounts = D2DGetInput(0);\r\n    float VerticalPixelCounts = D2DGetInput(1);\r\n    //sampler2D implicitInputSampler = register(2);\r\n\r\n    float2 brickCounts = { HorizontalPixelCounts, VerticalPixelCounts };\r\n    float2 brickSize = 1.0 / brickCounts;\r\n    \r\n    float2 offsetuv = uv; //How do I get this from the code?\r\n    bool oddRow = floor(offsetuv.y / brickSize.y) % 2.0 >= 1.0;\r\n    if (oddRow)\r\n    {\r\n        offsetuv.x += brickSize.x / 2.0;\r\n    }\r\n\r\n    float2 brickNum = floor(offsetuv / brickSize);\r\n    float2 centerOfBrick = brickNum * brickSize + brickSize / 2;\r\n\r\n    //float4 color = tex2D(implicitInputSampler, centerOfBrick); \r\n    float4 color = tex2D(D2DGetInput(2).rgb, centerOfBrick);\r\n\r\n    return color;\r\n    }\r\n\r\nI know it is not a complex effect and if I understand how to get this work then I would able to create any effect. Thank you in advance."}}