how to set the pixel content of coordinates " x ,y " of my screen

Hi,
I would ask you if it’s possible to set some pixel content having [x,y] coordinate it in the material editor. I have some texture data and I want set some piece of this texture in particular pixel.

Any suggest is accepted, c++ solution too.

Are you wanting to set a pixel value relative to the whole game viewport (ie. relative to the final full rendered frame)? Or relative to an x, y position within a texture you are using inside of a material?

Hi Krxtopher,
I need exactly to set a pixel value relative to the final full rendered frame.

There are potentially multiple ways to achieve this. Can you post a picture of what you want the final output to look like so we have a better idea of what you’re trying to achieve?

I need to do this for each pixel.

How many of these individual pixels are you likely to need to draw at once? Is it just a handful of pixels, or is it a large number? (FWIW, a resolution of 1920 x 1080 would be a total of 2,073,600 pixels.)

Maybe if you could explain a little more about why you need to be able to draw one pixel at a time - what final visual output you’re trying to present to the user/player - we could suggest some good approaches.

I’m trying to create a plugin for an autostereoscopic monitor. This type of monitor composing the image using a specific pattern.
To achieve my goal I tried to use material editor, but did not get the desired result.

Interesting! That’s helpful. I don’t know much about autostereoscopy. How many cameras/viewing angles are required? Just two, or more? If it’s just two then I think I have a simple solution for you.

Thanks for your interest , my monitor works with 5 points of view. but many monitors work with two point of view, then it is possible that your solution can also be adapted to my case and many other!

Doctor, here’s one approach that might work for you…

To merge textures representing multiple view angles into a final interleaved image you can create and use your own post processing material. Within that post processing material, a mask image containing only black and white pixels can be applied to each of the view angle images to hide (black) or reveal (white) the pixels you want. In my example, the mask image I’m using is going to be a simple checkerboard pattern, but this could be any pattern you’d like…

(This version is scaled up for illustration purposes. Do not use this image directly.)

96999-pattern.png


Setup

Create your pattern in your favorite graphics program and import it into Unreal Engine.

Open the texture you just created in Unreal’s Texture Editor and change it’s “Texture > Filter” value to “Nearest”. This will keep the texture from being smoothed.

In your map, add a Post Processing Volume and turn on it’s “Unbound” tick box.

In the Content Browser, create a new Material and open it for editing.

With the main material node selected, change it’s “Material Domain” to “Post Process” and save.

Back in your map, select your Post Processing Volume and add an element to the “Blendables” array selecting “Asset Reference” as its type. Then, open the asset drop-down that appears and select your post processing material.


The Material

Here’s what the post processing material graph looks like:


The Result

Here’s a zoomed in version of what the final running app looks like…

I hope this helps. If any of this is unclear just let me know and I’ll explain further.

Krxtopher,I thank you very much for your help, unfortunately I had already tried a similar approach using HUD, the issue is the rendering at real time of this view(s). When i replace your texture sample with my RenderTarget2D, the final output suffers from stuttering and devours my Ram.
Thinking I need to override the Draw function of the GameViewportClient to get the best result.

Well, since you’re trying to capture and render multiple full-frame 3D views that doesn’t surprise me! Have you tried it with a blank project using the “Mobile”, “Scalable 3D/2D” presets and explicitly disabling all post processing by adding an “unbound” Post Process Volume with all values set to 0?

It works! trying with the settings you suggested I get what I want. I give you thanks very much.