<p dir="auto">I ran into this when trying to add a user toggle for switching between point and linear filtering like so:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const renderTarget = new WebGLRenderTarget();

// ...render scene...

renderTarget.texture.minFilter = NearestFilter;
renderTarget.texture.needsUpdate = true;

// rendering fails because texture can't be updated"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">renderTarget</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">WebGLRenderTarget</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// ...render scene...</span>

<span class="pl-s1">renderTarget</span><span class="pl-kos">.</span><span class="pl-c1">texture</span><span class="pl-kos">.</span><span class="pl-c1">minFilter</span> <span class="pl-c1">=</span> <span class="pl-v">NearestFilter</span><span class="pl-kos">;</span>
<span class="pl-s1">renderTarget</span><span class="pl-kos">.</span><span class="pl-c1">texture</span><span class="pl-kos">.</span><span class="pl-c1">needsUpdate</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>

<span class="pl-c">// rendering fails because texture can't be updated</span></pre></div>
<p dir="auto">Here's a fiddle demonstrating the issue (needsUpdate is set in the render loop):</p>
<p dir="auto"><a href="https://jsfiddle.net/qg7rmu4k/" rel="nofollow">https://jsfiddle.net/qg7rmu4k/</a></p>
<p dir="auto">I see that issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="165206925" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/9327" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/9327/hovercard" href="https://github.com/mrdoob/three.js/issues/9327">#9327</a> was closed previously for not having a use case attached to it. In this case it's because I'm setting needsUpdate in order to change any of the texture sampling fields.</p>
<p dir="auto">Sometimes, when we want to save some memory, it happens that we have to reuse a render target, by just changing some possible parameters on the fly. I am talking about wrapping and filtering, obviously not format and type. Changing these parameters is (generally) fast enough (depending on the drivers).</p>
<p dir="auto">However, it is not currently possible to do that, because of this part of the code:</p>
<p dir="auto"><a href="https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgl/WebGLTextures.js#L225-L244">https://github.com/mrdoob/three.js/blob/dev/src/renderers/webgl/WebGLTextures.js#L225-L244</a></p>
<p dir="auto">As a <code class="notranslate">WebGLRenderTarget</code> has obviously no image attribute.</p>
<p dir="auto">Maybe I am missing something, but it looks like the data uploading and the parameters and couple together. Am I the only one looking for a change on this side?</p>
<p dir="auto">It would be nice to separate the data uploading from the parameters.</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
</ul>