Advertisement Jump to content
  • Advertisement

Search the Community

Showing results for tags 'Textures'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum
  • Unreal Engine Users's Unreal Engine Group Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 61 results

  1. Hello again Recently I was trying to apply 6 different textures in a cube and I noticed that some textures would not apply correctly, but if i change the texture image with another it works just fine. I can't really understand what's going on. I will also attach the image files. So does this might have to do anything with coding or its just the image fault??? This is a high quality texture 2048x2048 brick1.jpg, which does the following: And this is another texture 512x512 container.jpg which is getting applied correctly with the exact same texture coordinates as the prev one: Vertex Shader #version 330 core layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; layout(location = 2) in vec2 aTexCoord; uniform mat4 model; uniform mat4 view; uniform mat4 proj; out vec2 TexCoord; void main() { gl_Position = proj * view * model * vec4(aPos, 1.0); TexCoord = aTexCoord; } Fragment Shader #version 330 core out vec4 Color; in vec2 TexCoord; uniform sampler2D diffuse; void main() { Color = texture(diffuse, TexCoord); } Texture Loader Texture::Texture(std::string path, bool trans, int unit) { //Reverse the pixels. stbi_set_flip_vertically_on_load(1); //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 0); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (!trans) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); } //Loading Failed. else throw EngineError("The was an error loading image: " + path); //Free the image data. stbi_image_free(data); } Texture::~Texture() { } void Texture::Bind(int unit) { GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); } Rendering Code: Renderer::Renderer() { float vertices[] = { // positions // normals // texture coords -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }; //Create the Vertex Array. m_vao = new Vao(); //Create the Vertex Buffer. m_vbo = new Vbo(vertices, sizeof(vertices)); //Create the attributes. m_attributes = new VertexAttributes(); m_attributes->Push(3); m_attributes->Push(3); m_attributes->Push(2); m_attributes->Commit(m_vbo); } Renderer::~Renderer() { delete m_vao; delete m_vbo; delete m_attributes; } void Renderer::DrawArrays(Cube *cube) { //Render the cube. cube->Render(); unsigned int tex = 0; for (unsigned int i = 0; i < 36; i += 6) { if (tex < cube->m_textures.size()) cube->m_textures[tex]->Bind(); GLCall(glDrawArrays(GL_TRIANGLES, i, 6)); tex++; } }
  2. Hello! My texture problems just don't want to stop keep coming... After a lot of discussions here with you guys, I've learned a lot about textures and digital images and I fixed my bugs. But right now I'm making an animation system and this happened. Now if you see, the first animation (bomb) is ok. But the second and the third (which are arrows changing direction) are being render weird (They get the GL_REPEAT effect). In order to be sure, I only rendered (without using my animation system or anything else i created in my project, just using simple opengl rendering code) the textures that are causing this issue and this is the result (all these textures have exactly 115x93 resolution) I will attach all the images which I'm using. giphy-27 and giphy-28 are rendering just fine. All the others not.They give me an effect like GL_REPEAT which I use in my code. This is why I'm getting this result? But my texture coordinates are inside the range of -1 and 1 so why? My Texture Code: #include "Texture.h" #include "STB_IMAGE/stb_image.h" #include "GLCall.h" #include "EngineError.h" #include "Logger.h" Texture::Texture(std::string path, int unit) { //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 0); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (m_channels == 3) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else if (m_channels == 4) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } //This image is not supported. else { std::string err = "The Image: " + path; err += " , is using " + m_channels; err += " channels which are not supported."; throw VampEngine::EngineError(err); } //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); } //Loading Failed. else throw VampEngine::EngineError("There was an error loading image \ (Myabe the image format is not supported): " + path); //Unbind the texture. GLCall(glBindTexture(GL_TEXTURE_2D, 0)); //Free the image data. stbi_image_free(data); } Texture::~Texture() { GLCall(glDeleteTextures(1, &m_id)); } void Texture::Bind(int unit) { GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); } My Render Code: #include "Renderer.h" #include "glcall.h" #include "shader.h" Renderer::Renderer() { //Vertices. float vertices[] = { //Positions Texture Coordinates. 0.0f, 0.0f, 0.0f, 0.0f, //Left Bottom. 0.0f, 1.0f, 0.0f, 1.0f, //Left Top. 1.0f, 1.0f, 1.0f, 1.0f, //Right Top. 1.0f, 0.0f, 1.0f, 0.0f //Right Bottom. }; //Indices. unsigned int indices[] = { 0, 1, 2, //Left Up Triangle. 0, 3, 2 //Right Down Triangle. }; //Create and bind a Vertex Array. GLCall(glGenVertexArrays(1, &VAO)); GLCall(glBindVertexArray(VAO)); //Create and bind a Vertex Buffer. GLCall(glGenBuffers(1, &VBO)); GLCall(glBindBuffer(GL_ARRAY_BUFFER, VBO)); //Create and bind an Index Buffer. GLCall(glGenBuffers(1, &EBO)); GLCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO)); //Transfer the data to the VBO and EBO. GLCall(glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW)); GLCall(glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW)); //Enable and create the attribute for both Positions and Texture Coordinates. GLCall(glEnableVertexAttribArray(0)); GLCall(glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4, (void *)0)); //Create the shader program. m_shader = new Shader("Shaders/sprite_vertex.glsl", "Shaders/sprite_fragment.glsl"); } Renderer::~Renderer() { //Clean Up. GLCall(glDeleteVertexArrays(1, &VAO)); GLCall(glDeleteBuffers(1, &VBO)); GLCall(glDeleteBuffers(1, &EBO)); delete m_shader; } void Renderer::RenderElements(glm::mat4 model) { //Create the projection matrix. glm::mat4 proj = glm::ortho(0.0f, 600.0f, 600.0f, 0.0f, -1.0f, 1.0f); //Set the texture unit to be used. m_shader->SetUniform1i("diffuse", 0); //Set the transformation matrices. m_shader->SetUniformMat4f("model", model); m_shader->SetUniformMat4f("proj", proj); //Draw Call. GLCall(glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL)); } Vertex Shader: #version 330 core layout(location = 0) in vec4 aData; uniform mat4 model; uniform mat4 proj; out vec2 TexCoord; void main() { gl_Position = proj * model * vec4(aData.xy, 0.0f, 1.0); TexCoord = aData.zw; } Fragment Shader: #version 330 core out vec4 Color; in vec2 TexCoord; uniform sampler2D diffuse; void main() { Color = texture(diffuse, TexCoord); }
  3. Hello! For those who don't know me I have started a quite amount of threads about textures in opengl. I was encountering bugs like the texture was not appearing correctly (even that my code and shaders where fine) or I was getting access violation in memory when I was uploading a texture into the gpu. Mostly I thought that these might be AMD's bugs because when someone was running my code he was getting a nice result. Then someone told me "Some drivers implementations are more forgiven than others, so it might happen that your driver does not forgive that easily. This might be the reason that other can see the output you where expecting". I did not believe him and move on. Then Mr. @Hodgman gave me the light. He explained me somethings about images and what channels are (I had no clue) and with some research from my perspective I learned how digital images work in theory and what channels are. Then by also reading this article about image formats I also learned some more stuff. The question now is, if for example I want to upload a PNG to the gpu, am I 100% that I can use 4 channels? Or even that the image is a PNG it might not contain all 4 channels (rgba). So I need somehow to retrieve that information so my code below will be able to tell the driver how to read the data based on the channels. I'm asking this just to know how to properly write the code below (with capitals are the variables which I want you to tell me how to specify) stbi_set_flip_vertically_on_load(1); //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, HOW_MANY_CHANNELS_TO_USE); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); GLCall(glTexImage2D(GL_TEXTURE_2D, 0, WHAT_FORMAT_FOR_THE_TEXTURE, m_width, m_height, 0, WHAT_FORMAT_FOR_THE_DATA, GL_UNSIGNED_BYTE, data)); } So back to my question. If I'm loading a PNG, and tell stbi_load to use 4 channels and then into glTexImage2D, WHAT_FORMAT_FOR_THE_DATA = RGBA will I be sure that the driver will properly read the data without getting an access violation? I want to write a code that no matter the image file, it will always be able to read the data correctly and upload them to the GPU. Like 100% of the tutorials and guides about openGL out there (even one which I purchased from Udemy) where not explaining all these stuff and this is why I was experiencing all these bugs and got stuck for months! Also some documentation you might need to know about stbi_load to help me more: // Limitations: // - no 12-bit-per-channel JPEG // - no JPEGs with arithmetic coding // - GIF always returns *comp=4 // // Basic usage (see HDR discussion below for HDR usage): // int x,y,n; // unsigned char *data = stbi_load(filename, &x, &y, &n, 0); // // ... process data if not NULL ... // // ... x = width, y = height, n = # 8-bit components per pixel ... // // ... replace '0' with '1'..'4' to force that many components per pixel // // ... but 'n' will always be the number that it would have been if you said 0 // stbi_image_free(data)
  4. Hello! I was trying to load some textures and I was getting this access violation atioglxx.dll access violation stb image which i'm using to load the png file into the memory, was not reporting any errors. I found this on the internet explaining that it is a bug from AMD. I fixed that problem by changing the image file which i was using. The image that was causing this issue was generated by this online converter from gif to pngs. Does anyone know more about it? Thank you.
  5. Today starts our new sprint 30. During the last sprint, we did get much work done. 😊 We can’t publish that much pics these days, since we don’t want to spoil the new video scenes. But, I tell you something. 😄 We finished modeling all objects for the kitchen, also for Clearwaters home-office and main hall. We offer you a lil’ glimpse 😉: We need more special textures for some of these objects. It’s a work item for the current sprint. We designed furniture and had fun. We finished texturing some houses from Clearwaters world-outside. We’ve to continue, anyway. We finished modeling all animations relevant for the new video as listed in the script from the last sprint. We made a first-scene animation where he realizes something is weird. We modeled a look-out-of-the-window animation, a looking-around animation, a sneak-animation, and so on. We also modeled several facial animations for the above-mentioned body animations. Some new faces can look left, right, up and down, etc. Clearwater is therefore able to move his eyes and to blink. But we still need to test ALL of these newly created animations in the current sprint. Now, we can throw all necessary-for-the-new-video ingredients in a big bowl. It’s our mission henceforth to make a tasteful soup out of it. How euphemistic! We want to start creating some video sequences, i.e. positioning the cameras in Clearwaters apartment, set light, test all animations, fix all Bugs and issues, adapt Clearwaters appearance, and make everything looking good. After having eaten all Bugs, the video is ready for YouTube. Furthermore, we modeled a hot animation for Clearwaters full body 4K Pic. It’s supposed to be a promotional pic that will appear on social media and on our new game blog as appetizer. 😉 During the current sprint, we want to test and render the pic of him, just minutes before we publish it. This week, I swear, I’ll continue writing the book BIZARRE Episode I! Charly Men’s website charly-men.com gets a new design, too. Our software developer started writing code. I get my own new Content Management System called BeeMS. Don’t ask me why it is so called. 😛 The new game blog for BIZARRE is included in the charly-men.com website as it is now. The Charly Men website get’s expanded and will later include the Charly Men’s BIZARRE game blog, all Charly Men’s books, paintings, lyrics and songs. It gets published hopefully before the sun used up all its helium. I sum all up: We want to texture houses and objects in the apartment. We want to create some video sequences to test all animations and textures. We want to fix all issues and Bugs seen during the video sequence tests. We want to continue writing the book BIZARRE Episode I. We want to render a nice 4K Pic of Clearwater and publish it. We want to continue programming the new Charly Men website as well as the new game blog. I have a great appetite for soup now!
  6. piecuch.p

    UI refinements

    I have UI almost completed (at least for rendering and atlas management parts). I can render (using FreeType) glyphs from multiply fonts onto multi-pages atlas. There is now some basic management for viewing/browsing images. Everything is Qt-based so application is still cross-platform. I have added initial SVG export too.
  7. I was wondering if anyone knows of any tools to help design procedural textures. More specially I need something that will output the actual procedure rather than just the texture. It could output HLSL or some pseudo code that I can port to HLSL. The important thing is I need the algorithm, not just the texture so I can put it into a pixel shader myself. I posted the question on the Allegorithmic forum, but someone answered that while Substance Designer uses procedures internally, it doesn't support output of code, so I guess that one is out.
  8. I'm trying to figure out how to design the vegetation/detail system for my procedural chunked-lod based planet renderer. While I've found a lot of papers talking about how to homogeneously scatter things over a planar or spherical surface, I couldn't find too much info about how the location of objects is actually encoded. There seems to be a common approach that involves using some sort of texture mapping where different layers of vegetation/rocks/trees etc. define what and where things are placed, but can't figure out how this is actually rendered. I guess that for billboards, these textures could be sampled from the vertex shader and then use a geometry shader to draw a texture onto a generated quad? what about near trees or rocks that need a 3D model instead? Is this handled from the CPU? Is there a specific solution that works better with a chunked-lod approach? Thanks in advance!
  9. How can I get scaling of a texture when drawn on screen? In the other words: how can I get the amount of texture elements (texel) a pixel on the screen takes up? i.e. if a texture has 100x100 pixels in size and it only takes up 20x20 pixels on the monitor screen then I want to calculate 5.0 as value. I don't need anything complex since it's a 2D scene with ortographic camera setup. I'm trying to do manual texture sampling in my fragment shader. It's a Cg prorgam inside a Unity project so if there is a built-in way to get/calculate this let me know. I feel like there are two ways: Calculate using viewport and camera information Calculate using world to screen space transformations Is there a better way? Which one should I implement and how?
  10. Let's say you have a random sprite sheet like this: How can you sample from it? I want to create a sprite system which you give it a sprite texture sheet and automatically samples from it and creates different textures. I really don't have a clue how to do this. The only think i can do now, is to manually try different texture coordinates for each figure i see on the texture (somehow to guess the texture coordinates for each figure) and then try them to see if I'm getting the correct part from the sprite sheet and if not depending on the output, i adjust the texture coordinates (a little to the left, or right or bottom or top) in order to get the part of the texture i want. This is cumbersome and does not allow me to create an automatic system for that. If only I knew the texture coordinates for each figure that would be easy. So am I missing something? Just downloading images from google is not enough? Do i need to find a special sprite sheet format or something which the creator already includes the texture coordinates too? Thank you.
  11. I'm currently learning how to import models. I created some code that works well following this tutorial which uses only one sampler2D in the fragment shader and the model loads just fine with all the textures. The thing is what happens when a mesh has more than one textures? The tutorial says to define inside the fragment shader N diffuse and specular samplers with the format texture_diffuseN, texture_specularN and set them via code, where N is 1,2,3, .. , max_samplers. I understand that but how do you use them inside the shader? In the tutorial the shader is: #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform sampler2D texture_diffuse1; void main() { FragColor = texture(texture_diffuse1, TexCoords); } which works perfectly for the test model that the tutorial is giving us. Now lets say you have the general shader: #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform sampler2D texture_diffuse1; uniform sampler2D texture_diffuse2; uniform sampler2D texture_diffuse3; uniform sampler2D texture_diffuse4; uniform sampler2D texture_diffuse5; uniform sampler2D texture_diffuse6; uniform sampler2D texture_diffuse7; uniform sampler2D texture_specular1; uniform sampler2D texture_specular2; uniform sampler2D texture_specular3; uniform sampler2D texture_specular4; uniform sampler2D texture_specular5; uniform sampler2D texture_specular6; uniform sampler2D texture_specular7; void main() { //How am i going to decide here which diffuse texture to output? FragColor = texture(texture_diffuse1, TexCoords); } Can you explain me this with a cube example? Lets say i have a cube which is a mesh and i want to apply a different texture for each face (6 total). #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform sampler2D texture_diffuse1; uniform sampler2D texture_diffuse2; uniform sampler2D texture_diffuse3; uniform sampler2D texture_diffuse4; uniform sampler2D texture_diffuse5; uniform sampler2D texture_diffuse6; void main() { //How am i going to output the correct texture for each face? FragColor = texture(texture_diffuse1, TexCoords); } I know that the text coordinates will apply the texture at the correct face, but how do i now which sampler to use every time the fragments shader is called? I hope you understand why I'm frustrated. Thank you
  12. I know that there are Vehicle and Car blueprints all over the net on almost every car model that exists and has existed, but surprisingly few textures. To be precise, photo textures of side view, front view and rear view of even common car models is hard to find. Even raster graphics drawn textures are rare. The best that could be found is on the Google Warehouse and typing 'textured car' in the search box. This will give you some good numbers of textured cars and car textures. Google warehouse is also excellent for finding textured buildings and building textures for any region. But where on earth are the vehicle textures?
  13. ShaderMap 4.1 is here and is a major update. It brings with it a lot of new features, changes, and bug fixes. Most exciting is PBR (Physically Based Rendering) Map creation, PBR Materials, and Multi Angle Light Scan nodes. Check out ShaderMap 4.1 here: https://shadermap.com I put a lot of work into this version so I hope everyone enjoys the update.
  14. Hornok Tibor

    Lack of idea for background

    Hello! I new for game developing and to gamedev.net. I hope somebody can point me to the right direction. I developing a vertical shoot em' up and I want to make some non-traditional backgrounds. I want to make something like hyperspace but more cartoonish and colorful, and of course in top-down. i can't find any good example, so if any of you know any way to get good inspiration to make it, thanks!
  15. Cultusfit

    GIMP Alpha Channel packing

    Just grabbed the GIMP program to try to do some channel packing to give myself more optimized textures. I am able to add the alpha channel. But I cant just seem to bring a greyscale image in as my Alpha. Any one familiar with this in this program and able to help me out? I would appreciate it. I know you cant draw directly on the Alpha, you have to use a mask, so i assume i'm over looking how to just pull the image in as the mask?
  16. For two days I have been struggling with trying to draw a image on a plane at the exact point. I have a UV point, however because of how the shaders work, or at least my understanding of it, I the piece of code only effects the current pixel. So I can easily draw gradients, change the color of the pixel at that UV point and all kinds of effects. However the only way I could think of drawing the image was to calculate the four corners from the center point, except after I found these points using 4 "If" branches I have no idea on how to use these points to draw the images. The shader is just a basic shadless vertex and fragment shader. Unlit.
  17. I'm looking for someone i can collaborate with in Unity or UE4, honestly any game engine is fine. My style of art is low to mid poly range, 3rd or 3rd person top down. Dungeon / Wolrd of Warcraft-esk style. Let me know if anyone is looking for group project practice. Lets make a small, simple game to start.Follow up for contact info.Here's a few examples.
  18. Sprint no. 27 is here, and we skipped the sprint 26 on gamedev.net in June as the #WORDSproductions team members sent me a lot of vacation requests over the last few weeks (and I was on holiday, too 😉), so that we could not complete as much items from the sprints as we initially wanted, but we opened up a lot of nice issues either way. Take a look! First, the concept art of the next game scene is finished. The scene we want to recreate after Clearwater's apartement scene has been completed. It looks nice. It's a scene from the book BIZARRE Episode I. Furthermore, we continued texturing the houses of the world-outside-Charlys-apartement-window. We haven’t finished it yet, as it became a little game environment already, with many houses, with streets, street lamps, fences, and so on. We use a nice texturing software and began painting the bricks or the colored cement onto the houses exterior walls. Bit by bit, one by one. We use textures, we photographed in our neighborhood, or we’ve found by accident anywhere in the world. We continued programming Clearwater’s shooting behavior. We implemented some basic shooting mechanics in the player controller using c++. The player is now able to pull his gun which triggers the correct state transition causing the associated animation to play. The logic to control the shooting animation blueprint and aim offset, letting Charly aim at the target he is shooting at, is now in place. We did improve main-character Charly Clearwater’s appearance again, by adapting vertices and textures and light. But, obviously, we won’t stop improving his appearance and behavior until the finished game is published one day, and after that, we’ll permanently upload updates including some nice main-character improvements. 😄 Next, we started modelling Charly Clearwater’s facial animations. As I said, during the colored woman video, we’d published on Halloween last year, the facial animations could not be imported in UE4 caused by a mean Bug. But now I ate the Bug, and the animations can be imported now without any errors. We need some facial expressions for the planned video, but also for some 4k pics of Clearwater, we want to render later on. He’s now able to smile. To be continued… I continued writing the book BIZARRE Epsiode I. It works fluently. No Bugs, no thinking barriers. I’ll keep writing. Our plans for the current sprint 27 are: We'll continue painting walls and modelling houses, trees etc. We'll continue programming Clearwater’s shooting animation and behavior. We need to adjust his pull-the-gun-and-shoot animation. We need to make him look hot and unaffected while killing. We'll continue modelling some relevant facial expressions and import them correctly in UE4, hopefully. Test them. Adapt them. Until they look flawless. We want to shoot a status report video, in which I talk about our successes of the last year and our targets for the next year. In May 2017, the BIZARRE Game project was born and one year after, I pass the year in review. It’s planned to include English subtitles. It is also planned to publish this video in July on YouTube. I’ll post it here, too. Yeah, some props must be done, too. Stuff for the kitchen, some books, a couch. Peanuts. Did I miss something? I think that’s enough. CU
  19. Dark Fantasy Environment and Props Hi GameDevs, I am currently working on a model pack for the Unity Asset Store. I am however not satisfied with the overall look of these game-ready models. There would be many architectual and prop objects from gates and windows to lamps, furniture, decoration etc. The style would be a gloomy, mystical, dark fantasy-inspired look, similar to a dark elf or vampire castle interior. For modeling I use Blender, for texturing Substance Designer and PS. Please take a look at my work and help me figuring out how should I improve the textures. I use the Smoothness / Metallic workflow, and would like to add Ambient Occlusion separately (screen space). I also use Emissive maps where needed (lamps). If you see some obvious flaws in contour, colors, etc please note those too. In these images I threw the objects into Unity, no light setup and compositing was done (I still need to learn those for presenting my stuff). Link to my Sketchfab (here you can see the crystal lamps in 3D). Thank you for your attention!
  20. I'm very new to OpenGL and graphics programming, and there is probably a simple answer to this. I've made a function that defines a grid and used it to make the "ground" of my game. I added the textures, which have a diffuse, specular, and normal map. When viewed closely the textures look fine However, from the side they look very pixelated I would appreciate if someone points me in the right direction as to how to handle this problem, as since i'm a beginner i'm not quite sure what's causing it. I'm not sure if they'd help but the texture params i'm using are: GL_LINEAR_MIPMAP_LINEAR for min filter, GL_LINEAR for mag filter, and i'm using openGL to generate the mipmaps (glGenerateMipmap). Thanks again
  21. Hello everyone, I'm looking for some advice since I have some issues with my textures for my mouse pointer and I'm not sure where to start to look. I have checked everything that I know off and now I'm in need of advice on what to look for in my code when I try to fix it. I have a planet that is rendered, I have a UI that is rendered and I also have a mouse pointer that is rendered. First the planet is rendered, then the UI and then the mouse pointer last. When the planet is done rendering I turn off Z-Buffer and enable Alpha Blending while I render the UI and the Mouse Pointer. In the Mouse Pointers Pixel Shader I look for black color and if that is the case I blend it. But what seems to happen is that it also blends part of the texture that isn't supose to be blended. I'm going to provide some screenshot of the effect. In the first image you can see that the mouse pointer changes color to a more white one when behing infront of the planet. The correct color is the one that is displayed when it's not infron of the planet. The second thing I find weird is that the mouse pointer is behind the ui text even tho it is rendered after. I also tried switching them around and it makes no difference. Also the UI doesn't have the same issues when being above the planet, it's color is displayed as it should. Here comes the Pixel Shader code if that helps anyone get a better grip of the issue: float4 color; color = shaderTexture.Sample(sampleType, input.tex); if(color.b == 0.0f && color.r == 0.0f && color.g == 0.0f) { color.a = 0.0f; } else { color.a = 1.0f; } return color; The UI uses almost the same code, but only checks the r channel of the color but I'm using all 3 channels in the Mouse Pointer due to colors might be abit more off. Should be that if the pixel is black it's should be blended. And it does work, but it's just that somehow it also does something with the parts that shouldn't be blended. Right now I'm leaning towards there being something in the Pixel Shader since I can set all pixels to white and it behaves as it should and creates a white box for me. Any pointers of what kind of issues I'm looking at here and what to search for to find a solution will be appreciated alot Best Regards and Thanks in Advance Toastmastern
  22. Hi all, I'm trying to generate MIP-maps of a 2D-array texture, but only a limited amount of array layers and MIP-levels. For instance, to generate only the first 3 MIP-maps of a single array layer of a large 2D-array. After experimenting with glBlitFramebuffer to generate the MIP-maps manually but still with some sort of hardware acceleration, I ended up with glTextureView which already works with the limited amount of array layers (I can also verify the result in RenderDoc). However, glGenerateMipmap (or glGenerateTextureMipmap) always generates the entire MIP-chain for the specified array layer. Thus, the <numlevels> parameter of glTextureView seems to be ignored in the MIP-map generation process. I also tried to use glTexParameteri(..., GL_TEXTURE_MAX_LEVEL, 3), but this has the same result. Can anyone explain me how to solve this? Here is an example code, how I do it: void GenerateSubMips( GLuint texID, GLenum texTarget, GLenum internalFormat, GLuint baseMipLevel, GLuint numMipLevels, GLuint baseArrayLayer, GLuint numArrayLayers) { GLuint texViewID = 0; glGenTextures(1, &texViewID); glTextureView( texViewID, texTarget, texID, internalFormat, baseMipLevel, numMipLevels, baseArrayLayer, numArrayLayers ); glGenerateTextureMipmap(texViewID); glDeleteTextures(1, &texViewID); } GenerateSubMips( myTex, GL_TEXTURE_2D_ARRAY, GL_RGBA8, 0, 3, // only the first 3 MIP-maps 4, 1 // only one array layer with index 4 ); Thanks and kind regards, Lukas
  23. Kjell Andersson

    Caustics Generator 5.0 Available

    Spectral rendering enters the computer graphics world. After a period with not that many feature improvements, Dual Heights Software have now finally released a new major version of their water texture generator software called Caustics Generator. The new version includes full spectrum color rendering allowing the simulation of spectral refraction which produces prismatic coloring effects and thus bringing caustics simulation to a new level. The spectral functionality is available in the Pro version on both Windows, Mac and Linux. Read more about the Caustics Generator at https://www.dualheights.se/caustics/
  24. Vilem Otte

    Dynamic resource reloading

    Making editors is a pain. I have a list of thousands of items I'd rather do than this - yet I made myself a promise to drag at least one full featured editor tool over the finish line. There are few reasons for that: I believe I have quite useful engine, it was my pet project all these years, it went through many transformations and stages - and solid tool is something like a goal I'd like to do with it, to make it something better than "just a framework". I'm very patient person, and I believe also hard working one. Throughout the years my goal is to make a game on my own engine (note, I've made games with other engines and I've used my engine for multiple non-game projects so far -> it eventually branched to be a full-featured commercial project in past few years). I've made few attempts but mostly was stopped by lacking such tool - that would allow me to build scenes and levels, in an easy way. And the most important one ... I consider tools one of the hardest part in making any larger project, so it is something like a challenge for me. Anyways so much for motivation, the tool is progressing well - it can be used to assemble scene so far, various entities (like light or materials) can have their properties (components) modified, with full undo/redo system of course. And so the next big part was ahead of me - asset loading and dynamic reloading. So here are the results: Engine editor and texture editor before my work on the texture. And then I worked on the texture: And after I used my highly professional programmer-art skills to modify the texture! All credits for GameDev.net logo go to its author! Yes, it's working. The whole system needs a bit of cleanup - but in short this is how it works: All textures are managed by Manager<Texture> class instance, this one is defined in Editor class There is a thread waiting for change on hard drive with ReadDirectoryChangesW Upon change in directory (or subdirectories), DirectoryTree class instance is notified. It updates view in bottom left (which is just a directory-file structure for watched directory and subdirectories), and also for modified/new files creates or reloads records in Manager<Texture> class instance (on Editor level) The trick is, reloading the records can only be done while they're not in use (so some clever synchronization needs to be done) I might write out some interesting information or even short article on this. Implementing it was quite a pain, but it's finally done. Now short cleanup - and towards the next one on my editor todo list! Thanks for reading & see you around!
  25. flatingo

    How to learn to draw game graphics

    So, drawing. How to learn how to draw game graphics and how to learn to draw at all, when is your maximum this? Okay, then let's discuss this. To begin with, I'm not a cool artist, but I persistently develop this skill in myself, every day drawing and stacking tons of paper. By the way, I advise this to you. This is good advice. As in the beginning of any business that you start, you do not need to show yourself a super genius, have super equipment and immediately invest huge amounts of money in your development. No, my dear friend, start small, and everything else will come with time. Therefore, to begin with, choose the style of drawing that you want and just practice in it. Just do not paint in all styles at once. To begin with, determine what you like and understand what styles there is. Watching how the games and their style develop, I can say with confidence that now the pixel art, cartoonish and comic graphics are in fashion. Who needs hyperrealistic humanoids and canons now? This is a huge zamorochki in creating games and stereotyped. Do not be afraid to draw a fist bigger than your head, and legs are the size of a joystick. Fashion, where beautifully painted drawings and brought them to realism, gradually disappears. Minimalism, simplicity and violation of proportions is what is now actual. Look at the latest games, because they became easier in style and no less beautiful (Overwatch, Dota2, Pixel Piracy, etc.). I will also say that I am a big fan of vector graphics and how it looks. What not to say about China and the eastern countries that can not live without it. This is not a joke, because in fact, Chinese developers are styling their games for a bright cartoon graphics with the addition of anime. In the east This is popular. Here are the games of Klei Entertainment. Pay attention to the style. You see? He's alone in all games and it's cool. This is the most important thing - to find your own style. I'm sure the director will not fire this artist. Look at other industries: advertising, television, etc. Everywhere simple graphics are used, for it is easy to perceive. People are now very lazy and quickly get used to everything, so vector graphics are now gaining good growth. By the way, to draw graphics for games, you need and do not need a graphics tablet. Look, the point is that you can draw a vector and pixels with your mouse. Believe me, this will be enough for you. But the tablet is relevant when you are drawing something more or less detailed. More often it is used for detailing and texturing an object in Photoshop. I once read Christopher Hart's book about drawing comics. You can also read the book of your chosen style, as well as redraw the different pictures you like. Why? Over time, the hand and the brain will memorize the outline and images, and it will be easier for you to come up with something new in the future, as well as draw already existing pictures in your head. Well, I probably will finish this, but this is not my last article. I will be happy if you need my experience. By the way, more information about the development of games and everything related to it you can find out on my YouTube channel. With you was a Ukrainian developer of indie games - Flatingo. Good luck to you.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!