day & night cycle sky shader for you

Started by
12 comments, last by pachesantiago 11 years, 11 months ago
this line fails:
D3DXCreateEffectFromFile( device, "shaders/sky.fx", 0, 0, 0, 0, &effect, 0);

When i compile it with D3DXSHADER_NO_PRESHADER|D3DXSHADER_SKIPOPTIMIZATION|D3DXSHADER_DEBUG
then i get this error msg:

shaders\sky.fx(79,11): error X5608: Compiled shader code uses too many arithmetic instruction slots (100). Max. allowed by the target (ps_2_0) is 64.
(1,1): error X5609: Compiled shader code uses too many instruction slots (103). Max. allowed by the target (ps_2_0) is 96.

Advertisement
hrmm got it to compile & work by changing it to:
D3DXCreateEffectFromFile( device, "shaders/sky.fx", 0, 0, D3DXSHADER_NO_PRESHADER|D3DXSHADER_DEBUG, 0, &effect, null);
Hi! Thanks to you all for testing this!

The number of arithmetic instructions was actually be below 60 in FX Composer. I always test my shaders in FX Composer. The shader works in FX Composer for me.

Changing the shader versions to 3.0 might help if there are too many instructions.

It's strange that you get like 4 fps on your 7700. The whole scene with water and terrain runs at 20-25 fps on a 6200 gs. I don't get an error on exit either :/

i'm using the directx sdk from december 2006 btw.

my system specs are:

intel e6400 (core 2 duo)
ati hd 4850
2gb ram
Win XP 32 Bit SP3


I will inspect the project again but since it works on my pc i have no idea what causes the problems lol.


Here's a screenshot after i dropped the fx file from the demo app onto a sphere in fx composer:



Asm output in FXC says: approximately 60 instruction slots used (3 texture, 57 arithmetic)

edit: just removed LightDir from shader because it wasnt used.

[Edited by - Daniel E on June 20, 2009 6:58:34 AM]
with your permission, i'm gonna grab this to put it in my game.
credits on you of course, but might modify it.

This topic is closed to new replies.

Advertisement