• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 … 34 35 36 37 38 … 117 Next »

Custom Shaders - Changing Rgb Colors
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Custom Shaders - Changing Rgb Colors
05-17-2015, 07:58 AM
#1
gondracorn Offline
Member
***
Posts: 50
Threads: 25
Joined: Dec 2014
I found that you can swap the rgb colors with each other. However, say you were going to swap rgb to rrr, making all the colors red-like? Well, instead of this happening, you get a poor grayscale color. Same goes with ggg or bbb.

My question is, is there a way you can change a specific channel to a specific color?

I'm trying to make all the colors a different shade of red for a test, but I cannot figure out how to do this, since the only way I found how to do this is by swapping the channels, but this presents a grayscale tone

Thanks.
Find
Reply
05-17-2015, 08:33 AM
#2
Tino Offline
Above and Beyond
*******
Posts: 2,276
Threads: 1
Joined: Oct 2013
if you set every channel of the output to the same value you will always get a gray outputs. if you need to make restrict the output to a shade of red, clear the values of the remaining channel and only use red. for example
SetOutput(float4(Sample().r, 0, 0, 1));
will give you only the red channel only, if instead you whant the color intensity encoded in the red channel you can for example use this line.
SetOutput(float4(dot(Sample().rgb, float3(0.2126729, 0.7151522, 0.0721750)), 0, 0, 1));
Find
Reply
05-18-2015, 01:48 AM
#3
gondracorn Offline
Member
***
Posts: 50
Threads: 25
Joined: Dec 2014
(05-17-2015, 08:33 AM)Tino Wrote: SetOutput(float4(Sample().r, 0, 0, 1));

So, this will only give me a red channel of all "Red". Is there a way to specifically make a "blue" channel a different shade of that "Red", while the green channel another different shade of that "Red", or is this basically impossible?

I know it's possible with a paint program, so is it possible with this?
Find
Reply
05-18-2015, 04:53 AM
#4
Tino Offline
Above and Beyond
*******
Posts: 2,276
Threads: 1
Joined: Oct 2013
If you give a more explicit example of what you whant to achieve i can show you how to do it with shaders. If you have an example image or can improve the explanation will be great
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma