sek

10-28-2003, 08:30 AM

Hello:

I am doing 2D physical simulations of cellular automata with multi-pass rendering. My GL_NV_fragment_program performs update equations using textures as input data. The update equations are something like:

Q_new[i][j] = Q_old[i][j] + K*(T[i-1][j] - T[i][j+1])

where i-1, j+1 correspond to neighbors and Q_old and T are color components of textures.

However, At the borders I want to do something like:

Q_new[i][j] = (1/3) * ( Q_old[i-1][j+1] + Q_old[i-1][j] + Q_old[i-1][j-1] )

That is, to take the average of three neighbors. Is it possible for me to do this without performing calculations on the interior nodes/textels?

Thanks.

I am doing 2D physical simulations of cellular automata with multi-pass rendering. My GL_NV_fragment_program performs update equations using textures as input data. The update equations are something like:

Q_new[i][j] = Q_old[i][j] + K*(T[i-1][j] - T[i][j+1])

where i-1, j+1 correspond to neighbors and Q_old and T are color components of textures.

However, At the borders I want to do something like:

Q_new[i][j] = (1/3) * ( Q_old[i-1][j+1] + Q_old[i-1][j] + Q_old[i-1][j-1] )

That is, to take the average of three neighbors. Is it possible for me to do this without performing calculations on the interior nodes/textels?

Thanks.