Advertisement

Small question about textures creation

Started by November 16, 2018 09:32 AM
3 comments, last by alx119 6 years ago

Hello all,

 

I'm working with Opengl for maybe, a future space game and let's say I want to create skybox textures, but I don't want to use photoshop or other tools. Let's say, I want to generate them procedurally.
How can I do that, because from what I know, I have to modify all the images per pixel and OpenGL doesn't support this. Or I have to modify an image with, let's say OpenCV and then import them in OpenGL and modify them colors ?

Thank you!

6 minutes ago, alx119 said:

How can I do that, because from what I know, I have to modify all the images per pixel and OpenGL doesn't support this.

OpenGL is an API for modifying pixels... What specific issue are you referring to? 

Advertisement

From a high level perspective, there are two ways to do it:

- You could create the texture somewhere, somehow, and then (using OpenGL) send it to the graphics card and render it regularly. In that case your OpenGL workflow is the same as when rendering any "regular" texture. And you can choose whatever tool or code you want to generate the texture data.

- Or, you could calculate the colors in OpenGL directly, in the shader you write. Then your shader is the tool for generating the texture: instead of getting the pixels from an existing texture, you instead somehow calculate the color for each pixel in the shader itself.

Hi,

Thank you for your replies.
To be more specifically, if I have made this from the picture in glsl, my question is how do I attach it to a uniform sampler2D texture for my skybox in OpenGL?
I hope I made you to understand what I mean. :P

Thanks in advance!

PerlinNoise2d.png

This topic is closed to new replies.

Advertisement