Some questions about effect creation

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Sun Oct 25, 2009 4:32 pm

It may sound silly, but could someone give a definition of the following variables?
-ForegroundTexture
-BackgroundTexture
-SourceTexture
-PreviousTexture
It seems straight forward and self-explanatory, but sometimes I get unwanted results or can use whatever I want and get the same result (and not the one I intended). Please, don't laugh at me :oops:

The HLSL intrinsic functions list one called noise. If you look at the reference on msdn, it says that the function ist fully supported with shader model 2 and above. But when I try to use it I get an "cannot map expression..." error, if using a variable as input (noise takes a vector of any size as input). With values as input no error is raised, but the output value is always the same no matter what input values I use.

no error, but always the same output value:
a) noise(0.6f)
b) noise(float2(0.25, 0.5))
c) float nseed = 1000.6f
noise(nseed)

error message:
a) float nseed = Tex.x
noise(nseed)
b) float2 nseed = Tex.xy
noise(nseed)
c) float2 nseed = float2(Tex.x, Tex.y)
noise(nseed)
d) noise(tex.xy)
e) noise(float2(Tex.x, Tex.y))

The only thing I could find on the web was a thread on the msdn-forum, posted 2 years ago, where someone said:
"noise() is only supported for tx_x_0 profiles, i.e. software shader implemented by D3DX TextureFill functions."
I have no clue what this means, but the tx_x_0 profile restriction is only shown for shader model 1

Any ideas?

And if it comes to the point, that the perlin noise function is not usable, how can I setup my own random noise function?
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Oct 25, 2009 7:14 pm

I don't know what's wrong with the noise() function (maybe it's not really supported under PS 2.0). You can read about Construct's built in shader parameters here though:

http://sourceforge.net/apps/mediawiki/c ... el_Shaders
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Mon Oct 26, 2009 4:33 am

Thanks for the link, I left this out somehow when looking through the wiki. Exactly the informations I was looking for.

I still hope, someone may help on the other problem (an algorithm for pseudo random numbers maybe?). I'm not that deep into programming, that's why I ask :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests