1
vote
1answer
46 views

Unity, shader, vertexID

I'm writing a shader and I just wanna ask if it's possible to get the ID of the vertex that is currently being manipulated. I read something about gl_vertexID, but I couldn't find out if that is ...
0
votes
0answers
18 views

Shader: vertex manipulation basics [duplicate]

I know this is a very noob question, but please bear with me I'm very new to graphics programming (I come from an iOS and web app development background). When you modify the position of a vertex ...
1
vote
1answer
119 views

Why Does unity_LightPosition[0] Seem to Depend on Camera Position?

I'm trying to write a fairly basic shader but I keep running into lighting issues with Unity. My first problem was trying to figure out which variable stored the light's position in world space. ...
2
votes
1answer
106 views

How can I compile a Direct3D 9 effect from a file?

I started working with shaders recently in DirectX9. I noticed that there is a D3DXCompileShaderFromFile function for IDirect3DVertexShader9 and pixel shader. Which compiles the shader and gives you ...
0
votes
2answers
142 views

Rendering terrain only with GPU

This is not about generating plane geometry and then applying a shader on it. Instead, I want a big single flat plane, then apply a shader on it. The vertex shader has a uniform vec3 ...
0
votes
1answer
118 views

How do I pass an object location into a vertex shader?

I am using Blender Game Engine. I want to create a large flat plane, and deform it locally near a moving object. So far (despite being a beginner at shaders) I've written a vertex shader for the ...
3
votes
1answer
311 views

Spritebatch Vertex shader world matrix change after each draw

I have a spritebatch where I draw some textures transformed in 3d space. The easy way was just Begin with the transformation matrix, draw, and end it right after. But that is silly, so I'm trying ...
3
votes
1answer
589 views

How do I create a manual object with colors for each vertex?

How do I create a shaded manual object with colours for each vertex? Eg if ogreObj is the Ogre::ManualObject : ogreObj->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST); ...
0
votes
1answer
127 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
3
votes
1answer
114 views

Surface normal to screen angle

I've been struggling to get this working. I simply wish to take a surface normal and convert it to a screen angle. As an example, assuming we're working with the highlighted surface on the sphere ...
0
votes
1answer
204 views

Get world-position in Vertex shader

I'm wondering how I can get the final position of a vertex. I use glTranslate in my render code, and I'm not getting the world-coordinates correct. My world is devided in chunks and my position get's ...
0
votes
1answer
269 views

GLSL Shaders-> How to manage?

As your game get's bigger and bigger, you will use more and more different shader effects. Let's take an easy example: I have clouds in my voxel-based world, and I want to give it a blue-ish tint ...
1
vote
0answers
202 views

Vertex shader to Pixel shader NVIDIA problem - restarting drivers

I have problem with my shader on NVIDIA cards. On AMD it's working right. Shader Builder exported CODE: //ROOT //PSParts //VSParts //Samplers sampler sLod23ColorGround : register(s0); sampler ...
-1
votes
1answer
697 views

Vertex shader are evil for performance?

I found that the vertex shaders are sometimes very useful, especially because they can generate geometries and extract and use a lot of informations from just 1 image. The problem is that my project ...
10
votes
1answer
517 views

Special relativity shader in GLSL

I'm trying to implement a GLSL shader which helps understanding special relativity Lorentz Transformation. Let's take two axis-aligned inertial observer O and O' . The observer O' is in motion w.r.t ...
2
votes
1answer
324 views

Implementing IVertexType Interface

In XNA, I have created a new VertexType, called it VertexPositionTextureLight which inherts the IVertexType Interface, but apparently I need to implement the member of VertexDeclartion which I cleary ...
1
vote
1answer
624 views

XNA - multiple VertexBuffers?

I'm trying to learn how to use VertexBuffers in XNA 4.0. I can render wireframe shapes and I can render textured shapes. However, I'm having some trouble rendering them both at once. I'm ...
4
votes
1answer
790 views

Using raw vertex information for sprites rather than SpriteBatch in XNA

I have been wondering whether using SpriteBatch is the best option. Obviously for prototyping or small games it works well. However, I've been wanting to apply techniques such as shaders and lighting ...
1
vote
1answer
333 views

Output from vertex shader in D3D9

I've been looking at creating some 2D rendering systems in D3D9, basically because I don't like ID3DXSprite. For the output of the vertex shader, what co-ordinate system does the run-time expect ...