shader

three.js shadermaterial not working at all

倖福魔咒の 提交于 2019-12-11 18:38:59
问题 I've been fiddling around with three.js a bit, and im stumped when it comes to THREE.ShaderMaterial . it started out with copy/pasting directly from the example, shown here: http://threejs.org/examples/#webgl_materials_normalmap i copied it into a function that just returns the material. it wouldnt work (error, i'll get to the specifics later), so i removed all the uniforms that had been set and went for a complete blank material. just to see if the same error would still show. so here's my

Is there any method to hide shader used in web application from being inspect by shader editor or other tools

廉价感情. 提交于 2019-12-11 18:32:18
问题 I am digging 3D web application for VR. And I want to hide my shader from being inspected by firefox shader editer and webGL inspector. I used the way to uglify the shader and put the shader in a return function rather than in a var. But none of them works. So, is there any method to hide web application's shader? 回答1: The answer is simple, no there isn't Just printing out the shaders is pretty easy. All someone has to do is write an extension that does this WebGLRenderingContext.prototype

How to recompile JavaFX 11/12

孤街浪徒 提交于 2019-12-11 18:31:42
问题 I'm trying to recompile JavaFX 11 (or 12) from source in an eclipse project, but I encounter some problems. Here is how I proceed: 1. I download the JavaFX SDK for Windows here 2. I create an eclipse project for each JavaFX module (javafx.base, javafx.controls, javafx.fxml, javafx.graphics, javafx.media, javafx.swing and javafx.web) 3. I correct various minor compilation errors 4. Finally I create a simple JavaFX application in a new project But when I execute the application, I get this

Fragment shader rendering to off-screen frame buffer

左心房为你撑大大i 提交于 2019-12-11 18:30:14
问题 In a Qt based application I want to execute a fragment shader on two textures (both 1000x1000 pixels). I draw a rectangle and the fragment shader works fine. But, now I want to renderer the output into GL_AUX0 frame buffer to let the result read back and save to a file . Unfortunately if the window size is less than 1000x1000 pixels the output is not correct. Just the window size area is rendered onto the frame buffer. How can I execute the frame buffer for the whole texture? 回答1: The

How to draw a Point Primitive with a world space width?

蓝咒 提交于 2019-12-11 18:21:36
问题 I want to draw a point, to simulate the position of which the light originates, however the issue I am facing now is that it is always the same size, regardless of the distance: I push literally one vertex to the GPU, my code: point.vs.glsl #version 440 core layout(location = 0) in vec4 position; layout(location = 0) uniform mat4 model_matrix; layout(location = 1) uniform mat4 view_matrix; layout(location = 2) uniform mat4 proj_matrix; void main(void) { gl_PointSize = 100.0; gl_Position =

Could a vertex shader be used for a page turn effect?

巧了我就是萌 提交于 2019-12-11 18:15:33
问题 I've done Open GL ES in the past, but quite a while ago. From what I'm reading now, it seems there is a lot more emphasis on managing your own matrix stacks and pushing your matrices directly into a vertex shader to position your objects. This is all well and good, but I'm just wondering how far you're meant to go with shaders. I don't know if they are only for simple things, or can I use them for a page turn effect. There will definitely be a lot of math that needs to be calculated. It feels

Banding Problem in Multi Step Shader with Ping Pong Buffers, does not happen in ShaderToy

你离开我真会死。 提交于 2019-12-11 17:16:28
问题 I am trying to implement a Streak shader, which is described here: http://www.chrisoat.com/papers/Oat-SteerableStreakFilter.pdf Short explanation: Samples a point with a 1d kernel in a given direction. The kernel size grows exponentially in each step. Color values are weighted based on distance to sampled point and summed. The result is a smooth tail/smear/light streak effect on that direction. Here is the frag shader: precision highp float; uniform sampler2D u_texture; varying vec2 v

Using VBO to draw line string

五迷三道 提交于 2019-12-11 13:57:35
问题 I am able to render the below points using the VBO and shaders in OpenGL 4.x. typedef struct Point { double x,y,z,w; }Point; std::vector<Point>vPoints; glBufferData(GL_ARRAY_BUFFER, vPoints.size()* sizeof(Point), &vPoints[0], GL_STATIC_DRAW); glVertexAttribPointer(0, 4, GL_DOUBLE, GL_FALSE, vPoints.size()*sizeof(GLdouble), (GLvoid*)0) How do we specify VBO to draw a line string using below variables typedef struct LineString { vector<Point> vPointList; }LineString; vector<LineString> vLines;

Transparency on two rectangles in DirectX, one behind another - I see the background of window instead the second texture

放肆的年华 提交于 2019-12-11 13:55:56
问题 I have an DirectX 11 C++ application that displays two rectangles with textures and some text. Both textures are taken from TGA resources (with alpha channel added). When I run the program, I get the result: What's wrong? Take a closer look: The corners of the rectangles are transparent (and they should be). The rest of textures are set to be 30% opacity (and it works well too). But, when one texture (let's call it texture1 ) is over another ( texture2 ): The corners of texture1 are

Strange error in GLSL while assigning attribute to a varying in vertex shader

泪湿孤枕 提交于 2019-12-11 13:53:21
问题 I am writing a GLSL program for texture mapping. I am having a weird problem. From my vertex shader I am trying to pass the texture coordinate vec2 as a varying to frag shader. In a diff shader in the same prog I did the same and it worked. But for this texture its not working. If I comment that line, then everything works. I have no clue why this is happening. This is the vertex shader: attribute vec4 position; attribute vec4 color1; attribute vec4 normal; attribute vec2 texCoord; uniform