Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: samples/shadow-map.html

Issue 155718: Fixed bug where shadowmap shaders didn't compile on windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2009, Google Inc. 2 Copyright 2009, Google Inc.
3 All rights reserved. 3 All rights reserved.
4 4
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are 6 modification, are permitted provided that the following conditions are
7 met: 7 met:
8 8
9 * Redistributions of source code must retain the above copyright 9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer. 10 notice, this list of conditions and the following disclaimer.
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 return output; 506 return output;
507 } 507 }
508 508
509 /** 509 /**
510 * The pixel shader returns a shade of gray. The lighter the shade the 510 * The pixel shader returns a shade of gray. The lighter the shade the
511 * farther that fragment is from the light. 511 * farther that fragment is from the light.
512 */ 512 */
513 float4 pixelShaderFunction(PixelShaderInput input): COLOR { 513 float4 pixelShaderFunction(PixelShaderInput input): COLOR {
514 // Pixels in the shadowmap store the pixel depth from the light's 514 // Pixels in the shadowmap store the pixel depth from the light's
515 // perspective in normalized device coordinates. 515 // perspective in normalized device coordinates.
516 return float4(input.depth.x / input.depth.y); 516 float t = input.depth.x / input.depth.y;
517 return float4(t, t, t, 1);
517 } 518 }
518 519
519 // #o3d VertexShaderEntryPoint vertexShaderFunction 520 // #o3d VertexShaderEntryPoint vertexShaderFunction
520 // #o3d PixelShaderEntryPoint pixelShaderFunction 521 // #o3d PixelShaderEntryPoint pixelShaderFunction
521 // #o3d MatrixLoadOrder RowMajor 522 // #o3d MatrixLoadOrder RowMajor
522 </script> 523 </script>
523 524
524 525
525 <script id="shadowColorShader" type="text/O3DShader"> 526 <script id="shadowColorShader" type="text/O3DShader">
526 /** 527 /**
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 <h1>Shadow Maps</h1> 619 <h1>Shadow Maps</h1>
619 This sample implements a basic shadow map. 620 This sample implements a basic shadow map.
620 <br/> 621 <br/>
621 <!-- Start of O3D plugin --> 622 <!-- Start of O3D plugin -->
622 <div id="o3d" style="width: 600px; height: 600px;"></div> 623 <div id="o3d" style="width: 600px; height: 600px;"></div>
623 <!-- End of O3D plugin --> 624 <!-- End of O3D plugin -->
624 Use A, S, D, W, I and O to move the light. 625 Use A, S, D, W, I and O to move the light.
625 Press spacebar to see the shadow map. 626 Press spacebar to see the shadow map.
626 </body> 627 </body>
627 </html> 628 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698