shader

Building A static version of Qt 5.2.1 with Visual Studio 2013

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been trying for a few days now to build a static version of Qt with Visual Studio 2013. I just cannot figure out what I did wrong. System: Windows 7 64 bit Visual Studio 2013 (Visual Studio 2012 is still installed) Perl is installed (ActivePerl-5.18.2.1801-MSWin32-x64-297964.msi) Python is installed (python-2.7.6.amd64.msi) Direct X 10 SDK is installed (DXSDK_Jun10.exe I had to use this workaround ) Downloaded Qt 5.2.1 Downloaded Qt 5.3.0 alpha What I did multiple time: Extract the sources in a temp folder (C:\QtSrc) Delete qtwebkit

How does vertex shader pass color information to fragment shader?

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In a simple hello-world OpenGL program, which simply draws a static triangle on the window, when I set the 3 vertex of the triangle to red, green and blue color, the triangle is filled with gradient. But when I use shaders like this: Vertex Shader: attribute vec4 aVertex; attribute vec4 aColor; varying vec4 vColor; void main(void) { gl_Position = gl_ModelViewMatrix * gl_ProjectionMatrix * aVertex; vColor = aColor; } where the attributes aVertex and aColor comes from a vertex buffer, passed through a call of glVertexAttribPointer . Fragment

How to implement a ShaderToy shader in three.js?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: looking for info on how to recreate the ShaderToy parameters iGlobalTime, iChannel etc within threejs. I know that iGlobalTime is the time elapsed since the Shader started, and I think the iChannel stuff is for pulling rgb out of textures, but would appreciate info on how to set these. edit: have been going through all the shaders that come with three.js examples and think that the answers are all in there somewhere - just have to find the equivalent to e.g. iChannel1 = a texture input etc. 回答1: I am not sure if you have answered your

Multiple objects drawing (OpenGL)

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The issue is that I can't figure out how to properly draw two objects, because my another object isn't being drawn. Here's the main code: GLuint VertexArrayID; glGenVertexArrays(1, &VertexArrayID); glBindVertexArray(VertexArrayID); GLuint VertexArrayID2; glGenVertexArrays(1, &VertexArrayID2); glBindVertexArray(VertexArrayID2); GLuint programID = LoadShaders( "SimpleVertexShader.vertexshader", "SimpleFragmentShader.fragmentshader" ); GLuint MatrixID = glGetUniformLocation(programID, "MVP"); GLuint MatrixID2 = glGetUniformLocation(programID,

Shader to bevel the edges of a cube?

核能气质少年 提交于 2019-12-03 02:47:43
This question relates to using shaders (probably in the Unity3D milieu, but Metal or OpenGL is fine), to achieve rounded edges on a mesh-minimal cube. I wish to use only 12-triangle minimalist mesh cubes, and then via the shader, Achieve the edges (/corners) of each block being slightly bevelled. In fact, can this be done with a shader ? Thanks, shader gurus! I recently finished creating such shader. The only way it can work is by providing 4 normal vectors instead of one for each vertex (smooth, sharp and one for each edge of the triangle for the given vertex). You will also need one float3

How to debug GLSL Fragment shader (Program Linking error after code change)

匿名 (未验证) 提交于 2019-12-03 02:43:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: (original Title) Please help me debug my glsl lighting shader so that it will compile! This is my first time debugging glsl Hello I am VERY new to opengl. I am working on modifying another shader I found online. The version I found online works just great, however somewhere along in my code I made a mistake while editing. The problem is I have combed through it and can not see it, I was hoping for some fresh eyes. To be clear it is not that what is being drawn is incorrect, it flat out wont compile #version 330 core struct Material {

identifier “ ” is undefined

匿名 (未验证) 提交于 2019-12-03 02:43:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am coding a 3D opengl test application, I have a function set up like this: Shader::Shader(const std::string& fileName) { program = glCreateProgram(); shaders[0] = CreateShader(LoadShader(fileName + ".vs"), GL_VERTEX_SHADER); shaders[1] = CreateShader(LoadShader(fileName + ".fs"), GL_FRAGMENT_SHADER); for (unsigned int i=0; i < NUM_SHADERS; i++) glAttachShader(program, shaders[1]); glBindAttribLocation(program, 0, "position"); glLinkProgram(program); } However when I try to declare shaders[0] = CreateShader(LoadShader(fileName + ".vs"), GL

OO architecture for rendering in shader based games

ぃ、小莉子 提交于 2019-12-03 02:41:31
I keep hitting this problem when building game engines where my classes want to look like this: interface Entity { draw(); } class World { draw() { for (e in entities) e.draw(); } } That's just pseudo-code to show roughly how the drawing happens. Each entity subclass implements its own drawing. The world loops through all the entities in no particular order and tells them to draw themselves one by one. But with shader based graphics, this tends to be horribly inefficient or even infeasible. Each entity type is probably going to have its own shader program. To minimize program changes, all

How to implemen shadertoy code into three.js - clarifying the details

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So here is a previous question: How to implement a ShaderToy shader in three.js Tried to implement the steps from the link above into this code unsucessfully: three.js/blob/master/examples/webgl_shader.html So I replaced the original vertex shader and the origianl fragment shader so I got this code: <script id="vertexShader" type="x-shader/x-vertex"> varying vec2 vUv; void main() { vUv = uv; vec4 mvPosition = modelViewMatrix * vec4(position, 1.0 ); gl_Position = projectionMatrix * mvPosition; } </script> <script id="fragmentShader" type="x

OpenGL ES 2.0 Extensions on Android Devices [closed]

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As this page for OpenGL ES 1.x, I collect OpenGL ES 2.x Extensions for Android Devices on this page. The listing can be found with my benchmark tool gpubench . This information can help many game developpers. Thanks for your help, 回答1: Motorola Xoom Vendor:NVIDIA Corporation Driver:OpenGL ES 2.0 Render:NVIDIA Tegra NV_platform_binary OES_rgb8_rgba8 OES_EGL_sync OES_fbo_render_mipmap NV_depth_nonlinear NV_draw_path NV_texture_npot_2D_mipmap OES_EGL_image OES_EGL_image_external OES_vertex_half_float NV_framebuffer_vertex_attrib_array NV