HLSL circular/spiral transition shader
I am developing some shaders for WPF, and so far I managed to get fadeout, and swipe shader working, but for this one, I have no idea where to start.
Could someone please hand me out a few tips on how to approach this problem?
What I am trying to achieve is the following:
Thank you
wpf hlsl
add a comment |
I am developing some shaders for WPF, and so far I managed to get fadeout, and swipe shader working, but for this one, I have no idea where to start.
Could someone please hand me out a few tips on how to approach this problem?
What I am trying to achieve is the following:
Thank you
wpf hlsl
I've literally never written a shader myself. What you have there doesn't really look like shaders I've seen. Maybe you would do better with 4 or 5 paths and change between them. There are some shaders available which are quite tricky to find. Have you seen these youtube.com/watch?v=q60fF2rZUiU
– Andy
Nov 17 '18 at 15:53
I googled and found this archive.codeplex.com/?p=transitionals , The spiral transition shader is not available, but there are many transition which you can take help.
– Satish Pai
Nov 18 '18 at 10:22
add a comment |
I am developing some shaders for WPF, and so far I managed to get fadeout, and swipe shader working, but for this one, I have no idea where to start.
Could someone please hand me out a few tips on how to approach this problem?
What I am trying to achieve is the following:
Thank you
wpf hlsl
I am developing some shaders for WPF, and so far I managed to get fadeout, and swipe shader working, but for this one, I have no idea where to start.
Could someone please hand me out a few tips on how to approach this problem?
What I am trying to achieve is the following:
Thank you
wpf hlsl
wpf hlsl
edited Nov 14 '18 at 11:37
Mike
asked Nov 13 '18 at 16:59
MikeMike
51214
51214
I've literally never written a shader myself. What you have there doesn't really look like shaders I've seen. Maybe you would do better with 4 or 5 paths and change between them. There are some shaders available which are quite tricky to find. Have you seen these youtube.com/watch?v=q60fF2rZUiU
– Andy
Nov 17 '18 at 15:53
I googled and found this archive.codeplex.com/?p=transitionals , The spiral transition shader is not available, but there are many transition which you can take help.
– Satish Pai
Nov 18 '18 at 10:22
add a comment |
I've literally never written a shader myself. What you have there doesn't really look like shaders I've seen. Maybe you would do better with 4 or 5 paths and change between them. There are some shaders available which are quite tricky to find. Have you seen these youtube.com/watch?v=q60fF2rZUiU
– Andy
Nov 17 '18 at 15:53
I googled and found this archive.codeplex.com/?p=transitionals , The spiral transition shader is not available, but there are many transition which you can take help.
– Satish Pai
Nov 18 '18 at 10:22
I've literally never written a shader myself. What you have there doesn't really look like shaders I've seen. Maybe you would do better with 4 or 5 paths and change between them. There are some shaders available which are quite tricky to find. Have you seen these youtube.com/watch?v=q60fF2rZUiU
– Andy
Nov 17 '18 at 15:53
I've literally never written a shader myself. What you have there doesn't really look like shaders I've seen. Maybe you would do better with 4 or 5 paths and change between them. There are some shaders available which are quite tricky to find. Have you seen these youtube.com/watch?v=q60fF2rZUiU
– Andy
Nov 17 '18 at 15:53
I googled and found this archive.codeplex.com/?p=transitionals , The spiral transition shader is not available, but there are many transition which you can take help.
– Satish Pai
Nov 18 '18 at 10:22
I googled and found this archive.codeplex.com/?p=transitionals , The spiral transition shader is not available, but there are many transition which you can take help.
– Satish Pai
Nov 18 '18 at 10:22
add a comment |
1 Answer
1
active
oldest
votes
In my opinion the easiest way to build any complicated effect is to decompose the original effect into small parts and add them together. In your case the effect consists of 3 parts:
- 5 rings filled after each other
- each ring is filled counterclockwise from the left
- the filling of a ring is a circle at each end
This in mind you can build a solution for each part separately and add the results together.
I assume that there will be a variable float progress;
rolling from 0 to 1 which determines the progress of the transistion.
In following some starting points for each part:
For 1. you check the distance of the texture coordinate of the fragment to the center of the screen and divide the maximum distance into 5 parts. While the progress is 0 <= progress < 0.2, the first ring is visible, while 0.2 <= progress < 0.4 the second and so on.
For 2. you check the angle of the difference vector between the fragment and the center to the left vector, e.g. using atan2
. Within each part (such as 0.0-0.2) you compare the local progress of the stage to the angle to determine the visibility, making the fragments appear in an angle dependent way.
The 3. might be the most tricky part, as you will have to construct the center of the progress ring ends and compute the distance to the fragment. If it is within the current ring thickness is is visible.
Hopefully this quick thoughts give you a rough starting point for your effect!
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53286019%2fhlsl-circular-spiral-transition-shader%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In my opinion the easiest way to build any complicated effect is to decompose the original effect into small parts and add them together. In your case the effect consists of 3 parts:
- 5 rings filled after each other
- each ring is filled counterclockwise from the left
- the filling of a ring is a circle at each end
This in mind you can build a solution for each part separately and add the results together.
I assume that there will be a variable float progress;
rolling from 0 to 1 which determines the progress of the transistion.
In following some starting points for each part:
For 1. you check the distance of the texture coordinate of the fragment to the center of the screen and divide the maximum distance into 5 parts. While the progress is 0 <= progress < 0.2, the first ring is visible, while 0.2 <= progress < 0.4 the second and so on.
For 2. you check the angle of the difference vector between the fragment and the center to the left vector, e.g. using atan2
. Within each part (such as 0.0-0.2) you compare the local progress of the stage to the angle to determine the visibility, making the fragments appear in an angle dependent way.
The 3. might be the most tricky part, as you will have to construct the center of the progress ring ends and compute the distance to the fragment. If it is within the current ring thickness is is visible.
Hopefully this quick thoughts give you a rough starting point for your effect!
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
add a comment |
In my opinion the easiest way to build any complicated effect is to decompose the original effect into small parts and add them together. In your case the effect consists of 3 parts:
- 5 rings filled after each other
- each ring is filled counterclockwise from the left
- the filling of a ring is a circle at each end
This in mind you can build a solution for each part separately and add the results together.
I assume that there will be a variable float progress;
rolling from 0 to 1 which determines the progress of the transistion.
In following some starting points for each part:
For 1. you check the distance of the texture coordinate of the fragment to the center of the screen and divide the maximum distance into 5 parts. While the progress is 0 <= progress < 0.2, the first ring is visible, while 0.2 <= progress < 0.4 the second and so on.
For 2. you check the angle of the difference vector between the fragment and the center to the left vector, e.g. using atan2
. Within each part (such as 0.0-0.2) you compare the local progress of the stage to the angle to determine the visibility, making the fragments appear in an angle dependent way.
The 3. might be the most tricky part, as you will have to construct the center of the progress ring ends and compute the distance to the fragment. If it is within the current ring thickness is is visible.
Hopefully this quick thoughts give you a rough starting point for your effect!
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
add a comment |
In my opinion the easiest way to build any complicated effect is to decompose the original effect into small parts and add them together. In your case the effect consists of 3 parts:
- 5 rings filled after each other
- each ring is filled counterclockwise from the left
- the filling of a ring is a circle at each end
This in mind you can build a solution for each part separately and add the results together.
I assume that there will be a variable float progress;
rolling from 0 to 1 which determines the progress of the transistion.
In following some starting points for each part:
For 1. you check the distance of the texture coordinate of the fragment to the center of the screen and divide the maximum distance into 5 parts. While the progress is 0 <= progress < 0.2, the first ring is visible, while 0.2 <= progress < 0.4 the second and so on.
For 2. you check the angle of the difference vector between the fragment and the center to the left vector, e.g. using atan2
. Within each part (such as 0.0-0.2) you compare the local progress of the stage to the angle to determine the visibility, making the fragments appear in an angle dependent way.
The 3. might be the most tricky part, as you will have to construct the center of the progress ring ends and compute the distance to the fragment. If it is within the current ring thickness is is visible.
Hopefully this quick thoughts give you a rough starting point for your effect!
In my opinion the easiest way to build any complicated effect is to decompose the original effect into small parts and add them together. In your case the effect consists of 3 parts:
- 5 rings filled after each other
- each ring is filled counterclockwise from the left
- the filling of a ring is a circle at each end
This in mind you can build a solution for each part separately and add the results together.
I assume that there will be a variable float progress;
rolling from 0 to 1 which determines the progress of the transistion.
In following some starting points for each part:
For 1. you check the distance of the texture coordinate of the fragment to the center of the screen and divide the maximum distance into 5 parts. While the progress is 0 <= progress < 0.2, the first ring is visible, while 0.2 <= progress < 0.4 the second and so on.
For 2. you check the angle of the difference vector between the fragment and the center to the left vector, e.g. using atan2
. Within each part (such as 0.0-0.2) you compare the local progress of the stage to the angle to determine the visibility, making the fragments appear in an angle dependent way.
The 3. might be the most tricky part, as you will have to construct the center of the progress ring ends and compute the distance to the fragment. If it is within the current ring thickness is is visible.
Hopefully this quick thoughts give you a rough starting point for your effect!
answered Nov 22 '18 at 16:36
GnietschowGnietschow
2,39111021
2,39111021
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
add a comment |
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
Thank you, this is exactly the type of help I am looking into!
– Mike
Nov 22 '18 at 16:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53286019%2fhlsl-circular-spiral-transition-shader%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've literally never written a shader myself. What you have there doesn't really look like shaders I've seen. Maybe you would do better with 4 or 5 paths and change between them. There are some shaders available which are quite tricky to find. Have you seen these youtube.com/watch?v=q60fF2rZUiU
– Andy
Nov 17 '18 at 15:53
I googled and found this archive.codeplex.com/?p=transitionals , The spiral transition shader is not available, but there are many transition which you can take help.
– Satish Pai
Nov 18 '18 at 10:22