why I must hit the bang to let it start? it should start on opening the patch
I used here a FrameDelay (DX11.Texture 2D) because need to apply the process again and again… there is a better way to implement this, inside the code I guess? I mean, how can I access to the previous texture output?
I declare two constant array ( "int NNeigh(8) " and "float CoordNeigh(288) ") inside the main function (float4 pVonNeumann). There is a better place to put them?
1.) can be done by a texture switch to avoid the noise calculation in the CA code
2.) there was a semantic to allow access to the last texture in tfx but i think it never really worked, its correct how you did it
3.) this is the biggest performance drop in your shader, you should only calculate the neighbor offset once in tha vvvv patch and pass the values as buffer to the shader. this saves 288 divisions per pixel, which is 75.497.472 for a 512x512 texture… this was taking more performance as the whole cellular automata algorithm itself.
there was also a unnecessary texture coordinate conversion, if you use POINT mode for the sampler its more efficient and you don’t need the offset to the pixel center.
hey cool!!! many many thanks, now I’ll play with this new info
BTW about 1) there’s something wrong with “calculation in the CA code” (about the performances)? Also I need to noise to be in the selected “Range” in order to process correctly the texture (I mean, if I have 6 states every pixel of the noise must be in one of this states)
about 3), there is no way to let the shader do a set of operation ONLY ONE TIME, right? Some kind of special function declaration perhaps?
there is nothing wrong with it only that it makes to code more complicated. and the noise does not have to be in one of the stages since
will quantize the values, so it does not matter whats the actual value as long as its between 0-0.99.
not that i know of… but i don’t know all the details about DX11.