Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - XGLSuper

Pages: [1]
1
Graphics / Extremely simple vertex shader help
« on: May 25, 2015, 05:39:53 pm »
I have been trying to learn how to write a shader for my game. I have got the fragment shader working mostly. I am having trouble with the vertex shader.

I have been following this tutorial:
https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/loading.php

It gives an example that just scales all the vertices.
void main(void)
{
   vec4 a = gl_Vertex;
   a.x = a.x * 0.9;
   a.y = a.y * 0.9;


   gl_Position = gl_ModelViewProjectionMatrix * a;

}
 

I have it rendering my vertex array with this shader and nothing shows up, it is just black.

There is no simple tutorials and it is frustrating, this one is simple but it's not working xD

2
It would be smooth while standing still, but if you walked over to the next block it would make it just jump over, instead of following the player, which I have heard can be done with shaders.

3
The only problem with that is that it will end up like a minecraft circle, made of blocks and not smooth. Even if it gets smooth corner transitions it will be blocky. I also want to use shaders other times, and figured this would be a very simple tutorial for them, and possibly the best looking method of what I want

4
Graphics / Drawing a vertex array with a variable alpha level? .NET
« on: May 24, 2015, 12:00:32 am »
I am drawing my map with mutliple vertex arrays. The ground is drawn before the player, then the player, then anything that should be rendered on top of a player, such as tree leaves, or an archway or something.

I want to make it so that when you walk under the tree leaves it makes them slightly transparent so you can see your player and what you are walking on. I have read a lot about having to use shaders but I don't know a single thing about them. I don't feel like I can change the color of every vertex because I only want the layer to be transparent if you are underneath something. Can someone explain how this could be done?

It would be optimal if I could make it so like within a radius the layer becomes transparent, but the whole layer would be fine as well if it comes to it.

I am using C# so it's hard to make sense of the documentation, when I have no clue as to what shaders are to begin with. So please explain very thoroughly if you can.

Pages: [1]
anything