<p dir="auto">Do you have any clue for passing a native WebGLTexture to one Shader in a Three material?</p>
<p dir="auto">We are sharing the Three gl context to do a series of calculations and stuff on the GPU, but the main purpose is to render the final data with three, so I need to put my output texture (WebGLTexture) as a Sampler2D uniform in a THREE.RawShaderMaterial. I don't know if this is possible using the available API of the engine.</p>
<p dir="auto">Thanks in advance and keep up the great work!</p>
<p dir="auto">Moved the discussion from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="51043523" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/5728" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/5728/hovercard" href="https://github.com/mrdoob/three.js/issues/5728">#5728</a> to a separate issue.</p>
<p dir="auto">The idea is to add <code class="notranslate">THREE.Image</code> as an additional class which is used by <code class="notranslate">THREE.Texture</code>. An instance of <code class="notranslate">THREE.Image</code> is directly mapped to an instance of <code class="notranslate">WebGLTexture</code> (the raw WebGL texture object). That means multiple textures can refer to the same instance of <code class="notranslate">THREE.Image</code> and not causing redundant texture uploads anymore (related issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="51043523" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/5728" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/5728/hovercard" href="https://github.com/mrdoob/three.js/issues/5728">#5728</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="52951011" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/5821" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/5821/hovercard" href="https://github.com/mrdoob/three.js/issues/5821">#5821</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="107932567" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/7223" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/7223/hovercard" href="https://github.com/mrdoob/three.js/issues/7223">#7223</a>)</p>
<p dir="auto">Ideally, <code class="notranslate">THREE.Image</code> will make the handling of image objects transparent (e.g. the difference in <code class="notranslate">HTMLImageElement</code>, <code class="notranslate">ImageBitmap</code> or the image stub in <code class="notranslate">DataTexture</code> is encapsulated in this new class).</p>