Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Download the last project(<i>Special Effects</i>) in this url <a href="http://golabistudio.com/siamak/portfolio.html" rel="nofollow">http://golabistudio.com/siamak/portfolio.html</a><br> The c++ source is not available but the shader source is there.<br> What you need to do is pass 2 textures to your shader(while rendering the plane). the first texture is your standard skybox texture. the second texture is your day/night cycle texture. at it's simplest it can be a wide gradient texture of height 1, going from blue to dark. with this second texture passed to your shader you can pick-up one pixel out of it at position of x=time and add the color to your diffuse texture(the first texture). </p> <p>The next step is having the sunrise. Again at it's simplest to do this, you have to create a texture of width 2 with one side the sunrise pixels horizontally and the another the night gradient:(enlarged in width) <a href="http://i.imgur.com/Rl8XJ.png" rel="nofollow">http://i.imgur.com/Rl8XJ.png</a></p> <p>Now having your incoming uv coordinate for the diffuse texture(the first skybox texture) you take the following</p> <pre><code> float2 uvpos; uvpos.y = IN.uv.y;//the position same as skybox texture uvpos.x = 0;//a sample from first horizontal pixel float4 colour1 = tex2D( gradientTexture, uvpos); uvpos.x = 0.5;//a sample from second horizontal pixel float4 colour2 = tex2D( gradientTexture, uvpos); float4 skycolor = lerp(colour1 , colour2, (your day time)); skycolor.xyz += tex2D(skyTexture, IN.uv).xyz; </code></pre> <p>It's very simple implementation, but should get you going i think.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload