Difference between revisions of "Blending mode"

From Project X Wiki
Jump to: navigation, search
(Blending mode)
(minor updates)
Line 63: Line 63:
 
     pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,  TRUE );
 
     pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,  TRUE );
 
   };
 
   };
 +
 +
== Behind the Beautiful Forevers ==
 +
 +
For two decades, and currently at The New Yorker, youve written about the distribution of opportunity, and the means by which people might get out of poverty, in America. What inspired you to start asking the same kinds of questions in India?
 +
 +
[[http://goodvillenews.com/Behind-the-Beautiful-Forevers-YtCKM3.html Behind the Beautiful Forevers]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== The World Waits For You ==
 +
 +
Its so easy to give up on our dreams; its so easy to do what everybody expects us to be doing; its so easy to blend in, to be like everybody else, just another person in the crowd, having nothing interested to say, nothing interesting to show, nothing interesting to share with the world. Its so easy to stay in our comfort zone, away from our doubts, fears and worries; away from change and all that is unfamiliar; away from growth and evolution; away from all the opportunities life has to offer us; away from all that is beautiful, empowering and great away from life.
 +
 +
[[http://goodvillenews.com/The-World-Waits-For-You-0I7WPz.html The World Waits For You]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== Dalai Lama Awarded 2012 Templeton Prize ==
 +
 +
The Dalai Lama, the Tibetan Buddhist spiritual leader whose long-standing engagement with multiple dimensions of science and with people far beyond his own religious traditions has made him an incomparable global voice for universal ethics, nonviolence, and harmony among world religions, has won the 2012 Templeton Prize.
 +
 +
[[http://goodvillenews.com/Dalai-Lama-Awarded-2012-Templeton-Prize-UttyfI.html Dalai Lama Awarded 2012 Templeton Prize]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== The Business 9 Women Kept A Secret For Three Decades ==
 +
 +
Somewhere in West Tennessee, not far from Graceland, nine women -- or "The 9 Nanas," as they prefer to be called -- gather in the darkness of night. At 4am they begin their daily routine -- a ritual that no one, not even their husbands, knew about for 30 years. They have one mission and one mission only: to create happiness. And it all begins with baked goods.One of us starts sifting the flour and another washing the eggs,
 +
 +
[[http://goodvillenews.com/The-Business-9-Women-Kept-A-Secret-For-Three-Decades-hOoGN8.html The Business 9 Women Kept A Secret For Three Decades]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 +
 +
== The Relationship Between Gifts & Community ==
 +
 +
Wherever I go and ask people what is missing from their lives, the most common answer (if they are not impoverished or seriously ill) is "community." What happened to community, and why dont we have it any more? There are many reasons the layout of suburbia, the disappearance of public space, the automobile and the television, the high mobility of people and jobs and, if you trace the "whys" a few levels down, they all implicate the money system.
 +
 +
[[http://goodvillenews.com/The-Relationship-Between-Gifts-Community-zbK8gw.html The Relationship Between Gifts & Community]]
 +
 +
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]

Revision as of 10:23, 9 August 2012

Blending mode

0 - no blending
1 - additive rendering instead of alpha
2 - diffusion color (col parameter in CVertex) adds to texture color, instead of multiplying
4 - like 2, but "smooth addition"
6 - multiplication & dividing by 2 after
8 - addition, then 127 is subtracted from each component
32 - disable alpha channel
64 - color of pixel is multiplied by target pixel color
128 - disable AA

it's in groups, flags 0,2,4,6,8, are choosing blending mode (color parameter target), everything else is just flags


 if (q->blend & 128)
 {
   pD3DDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, FALSE );
 } else {
   pD3DDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, TRUE );
 }
 }
 if (q->blend & 64)
 {
   pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
   pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);		 //col

 } else
 if (q->blend & 1)   //additive/replace
 {
   pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
   pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);			//additive
 } else {
   pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
   pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);	   //aplha-blending
 };


 int difftype = q->blend & 14;
 if (difftype == 2)   //diffusion to addition
 {
   pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_ADD );
 } else if (difftype == 0) {                                                         //diffusion to modulation
   pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_MODULATE );
 } else if (difftype == 4) {                                                         //diffusion to smooth addition
   pD3DDevice->SetTextureStageS 
   pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_ADDSMOOTH );
 } else if (difftype == 6) {                                                         //diffusion to double modulation
   pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_MODULATE2X );
 } else if (difftype == 8) {                                                         //diffusion to signed addition
   pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_ADDSIGNED );
 };
 if (q->blend & 3)
 { 
 if (q->blend & 32)
 {
   pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,   FALSE );
 } else {
   pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE,   TRUE );
 };

Behind the Beautiful Forevers

For two decades, and currently at The New Yorker, youve written about the distribution of opportunity, and the means by which people might get out of poverty, in America. What inspired you to start asking the same kinds of questions in India?

[Behind the Beautiful Forevers]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

The World Waits For You

Its so easy to give up on our dreams; its so easy to do what everybody expects us to be doing; its so easy to blend in, to be like everybody else, just another person in the crowd, having nothing interested to say, nothing interesting to show, nothing interesting to share with the world. Its so easy to stay in our comfort zone, away from our doubts, fears and worries; away from change and all that is unfamiliar; away from growth and evolution; away from all the opportunities life has to offer us; away from all that is beautiful, empowering and great away from life.

[The World Waits For You]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Dalai Lama Awarded 2012 Templeton Prize

The Dalai Lama, the Tibetan Buddhist spiritual leader whose long-standing engagement with multiple dimensions of science and with people far beyond his own religious traditions has made him an incomparable global voice for universal ethics, nonviolence, and harmony among world religions, has won the 2012 Templeton Prize.

[Dalai Lama Awarded 2012 Templeton Prize]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

The Business 9 Women Kept A Secret For Three Decades

Somewhere in West Tennessee, not far from Graceland, nine women -- or "The 9 Nanas," as they prefer to be called -- gather in the darkness of night. At 4am they begin their daily routine -- a ritual that no one, not even their husbands, knew about for 30 years. They have one mission and one mission only: to create happiness. And it all begins with baked goods.One of us starts sifting the flour and another washing the eggs,

[The Business 9 Women Kept A Secret For Three Decades]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

The Relationship Between Gifts & Community

Wherever I go and ask people what is missing from their lives, the most common answer (if they are not impoverished or seriously ill) is "community." What happened to community, and why dont we have it any more? There are many reasons the layout of suburbia, the disappearance of public space, the automobile and the television, the high mobility of people and jobs and, if you trace the "whys" a few levels down, they all implicate the money system.

[The Relationship Between Gifts & Community]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]