Wondering if it is possible to render a procedural texture to an intermediate image texture rather than straight to screen? When I using DrawTexture to draw a procedural texture to another texture it seems to copy the procedure but not render. In case helpful, a specific e.g. is in the following toy code--if it actually drew the final image when drawing the procedural texture to an intermediate texture I would expect the result of the two passes to be the same (but they aren't). Thanks!
p.s. unrelated but a little bug report: CreateProceduralGabor throws an unexpected error if you pass non-integer dimension values to it when using the Oculus Rift (not when using a standard screen).
clear all
clc
try
w = PsychImaging('OpenWindow', 0, [0 0 0]);
Screen('ColorRange', w, 1.0, [], 1);
o = Screen('OpenOffscreenWindow', w, [0 0 0 0]);
%[gaborid, gaborrect] = CreateProceduralGabor(windowPtr, width, height [, nonSymmetric=0][, backgroundColorOffset =(0,0,0,0)][, disableNorm=0][, contrastPreMultiplicator=1][, validModulationRange=[-2,2]])
g = CreateProceduralGabor(w, 400, 400, [], [0.5 0.5 0.5 0], 1, 0.5);
%DRAW TO INTERMEDIATE TEXTURE WITH NO BLENDING, THEN DRAW THAT TEXTURE TO SCREEN WITH BLENDING
%---
%Screen('DrawTexture', windowPointer, texturePointer [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode] [, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags], [phase, freq, sc, contrast, aspectratio, 0, 0, 0]);
Screen('BlendFunction', o, 'GL_ONE', 'GL_ZERO');
Screen('BlendFunction', w, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
Screen('DrawTexture', o, g, [], [], 45, [], [], [], [], kPsychDontDoRotation, [0 0.023 100 1 1 0 0 0])
Screen('DrawTexture', w, o)
Screen('Flip', w);
WaitSecs(5)
%---
%DRAW STRAIGHT TO SCREEN WITH NO BLENDING
%---
Screen('BlendFunction', w, 'GL_ONE', 'GL_ZERO');
Screen('DrawTexture', w, g, [], [], 45, [], [], [], [], kPsychDontDoRotation, [0 0.023 100 1 1 0 0 0])
Screen('Flip', w);
WaitSecs(5)
%---
sca
catch X
sca
rethrow(X)
end