0
votes
0answers
22 views

How to upload lights when doing one pass per light

Suppose I have a reasonable amount of light sources that I upload at once in my forward rendering and accumulate them in shader. Now that I am willing to move to deferred, and so one pass per light, ...
0
votes
0answers
25 views

HLSL Shader Relative Positioning

I've got a shader that does the texturing, lighting, etc. for my game engine (written on top of MonoGame, in case that's relevant) for my block-terrain-based game (everything is rendered as triangles ...
-1
votes
1answer
42 views

Is lighting different from Immediate mode rendering to VBOs?

I recently got a textured cube to render as a VBO, and I've noticed some strange things as I have been trying to incorporate lighting. Firstly, there is no difference if I comment out any lines ...
1
vote
2answers
136 views

Implementing directional lighting in voxel based polygon-engine

I'm having trouble implementing directional lighting. (I'm not that familiar with 3D.) The problem is that the lighting does not "follow/flow with" the other blocks next to them. How should I fix ...
0
votes
0answers
80 views

How to add a flashlight in libgdx?

So I want to add a flashlight to the game when the game starts to get darker which I already have working. I bound a light texture to the batch and the first problem is that for some reason the ...
4
votes
1answer
71 views

Lighting computation viewing direction

This is something that's really cooking my noodle. When I'm computing the light response for a material in my fragment shader, I'm using the standard 3 normalized vectors, in eye space: fragment ...
1
vote
1answer
124 views

XNA Diffuse Shader Issue. Edge lighting problem. Image Attached

As you can see in this image the diffuse shading is working correctly in some places but in other places such as the the bottom of the sphere you can see the squares/triangles of the mesh. Any ...
1
vote
0answers
74 views

SpotLight in ForwardBase pass using forward rendering

Is there anyway I can force Unity to allow me using a custom shader to render spotlights in a ForwardBase pass (using Forward Rendering Path)? For what I could see since now: Unity use and ...
0
votes
1answer
125 views

Surface shader ignores lighting in vertexLit path

I want to use a surface shader in VertexLit(not Forward) rendering path. I caused a problem that the compiled shader completely ingnores lighting from the light sources on the scene. Here's the code: ...
2
votes
1answer
219 views

Surface shader with VertexLit causes black object

I wrote the simplest possible surface shader: Shader "SimpleSurf" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Tags {"RenderType"="Opaque" } ...
2
votes
2answers
327 views

How can I calculate spotlight lighting in Vertex/Fragment shader in Unity?

I've written a vertex/fragment shader for my game. It uses 3 textures and represents a floating water on the wall (so I have 1 texture for water, 1 for geometry and the last one is mask) so it looks ...
0
votes
1answer
134 views

VertexColor shader is not working correctly in built application

I want to change the vertex colors of my mesh. The light sources must not affect the objects with this shader, its lighting must be determined only by its vertices colors, so I turned the Lighting ...
2
votes
2answers
336 views

How can I support many point light sources in a dynamically-generated level in Unity?

I'm currently working with a dungeon game which is similar to Dungeon Keeper by Mythic Entertainment. I'm using Unity and developing this game for Ipad 2 and above. Player can modify his dungeon, and ...
2
votes
2answers
216 views

Where should shaders and lights be in a component-based entity system?

Where should I put the shader and the light / shadow calculation? Should that be a component too? And should the rendering system know how to handle them or should there be a separate light system? ...
7
votes
3answers
607 views

How can I create a shader that will reproduce this lighting effect on terrain?

Notice the way in which the major light source in each image reflects off the ground, as a function of the distance between the light source and the viewer (?). Is this a (bumped) specular map? ...
1
vote
1answer
107 views

What causes still objects have lines in them when lighting is being changed? [duplicate]

First, here is what I'm talking about (I changed the contrast to make it more visable, since it's not really visible in still images): Ingore the chat box, I was spamming buttons to see which one ...
4
votes
1answer
1k views

Faking 2d light using shader (Unity, Shaderlab)

Since the concept was difficult to explain in words for someone who's not quite familiar with shader, I described it in pictures. I'm currently using Unity and it seems Shaderlab is the best choice ...
9
votes
1answer
298 views

Fast lighting with multiple lights

How can I implement fast lighting with multiple lights? I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level. The problem is ...
0
votes
1answer
816 views

Directional light causes an FPS drop

I have only one object in the scene and it is lit with a directional light. It uses the mobile/diffuse shader. The issue is that on iPhone 4 the FPS drops from ~42FPS to ~11FPS when the directional ...
2
votes
1answer
387 views

Compute Shader Memory Sharing

Ok guys I have had some pretty good success on this site but I feel that this is a pretty complex question. I am trying to do tile based deferred lighting using DirectX 11 and the compute shader. ...
2
votes
0answers
250 views

Monogame working with Krypton

I am trying to make a simple 2D game engine using Monogame and the Krypton 2.0 lighting engine. So far I have succeeded in rendering a light but I am unable to generate any shadows from any hull's. ...
0
votes
1answer
136 views

Angle to Vector3?

I am working on getting my directional lights to match the sun in my atmospheric scattering shader. I have a float that ranges from 0 to 6.28 (TwoPi). How would I calculate a vector3 from this angle? ...
0
votes
1answer
128 views

Per-fragment lighting system behaves like ambient lighting system

This is the relevant section of my fragment shader varying vec3 normal; varying vec3 halfv; ... vec4 color = ambient * gl_LightSource[0].ambient; vec3 n = normalize(normal); float ...
4
votes
1answer
248 views

How can I handle the combination of multiple shader effects?

To be able to work efficiently with effects, is there a good way to combine multiple reusable "base" effects to achieve a more complex final result? For example, say I have an effect that handles ...
9
votes
1answer
1k views

What is Ramp Shading or Lighting?

What is ramp shading or lighting and how does it work? Is it different than toon shading or is it the same concept? How is specularity calculated differently for ramp shading versus blinn-phong or ...
5
votes
1answer
397 views

Performance of pixel shaders vs. SpriteBatch: XNA

Precondition: I read this question/answer about using shaders, or spritebatch, to render and mark a sprite. I need to do something like that. I also have a 2D lighting PoC which I need to write. The ...
12
votes
4answers
4k views

How can I acheive a smooth 2D lighting effect?

I'm making a 2D tile based game in XNA. Currently my lightning looks like this. How can I get it to look like this? Instead of each block having its own tint, it has a smooth overlay. I'm assuming ...
1
vote
1answer
668 views

how to modify shadow mapping in “3D Graphics with XNA Game Studio 4.0”? [closed]

So I've been following the tutorials from the book Sean James's "3D Graphics with XNA Game Studio 4.0", and have been doing fine until i reached the shadow mapping part. in this book it creates point ...
0
votes
1answer
205 views

Drawing at negative coordinates in XNA?

I am trying to make a 2D isometric RPG and I kind of hit a wall when it comes to lighting. I was thinking of using shaders, if I manage to understand them.The problem I am anticipating is the presence ...
2
votes
2answers
546 views

Lighting problems with Terrain

I'm in the process of learning Open GL and am having issues with lighting on my Terrian, I don't know if the issue is related to how I calculate my normals or the shader itself (I am using the shader ...
4
votes
2answers
1k views

XNA 4.0 - Normal mapping shader - strange texture artifacts

I recently started using custom shader. Shader can do diffuse and specular lighting and normal mapping. But normal mapping is causing really ugly artifacts (some sort of pixeling noise) for textures ...
9
votes
2answers
734 views

Handle many lights in a scene (with shaders)

I'm curious about how to handle many lights in a scene. Given a very big map in a role playing game, with dungeons (with lights in there) etc. I know about deferred lighting, but that only answers how ...
0
votes
1answer
674 views

Help understand GLSL directional light on iOS (left handed coord system)

I now have changed from GLKBaseEffect to a own shader implementation. I have a shader management, which compiles and applies a shader to the right time and does some shader setup like lights. Please ...
2
votes
1answer
700 views

2D Point Light XNA , Why my point light radius is Oval?

I friend of mine , taught me how to make a simple 2d point light with shader, so i follow his steps and finally done it ! but something happend , the light shape is like an oval and not like a ...
2
votes
0answers
867 views

How can I use the dualforward parameter in my unity shader to use lightmaps and normal maps together? [closed]

I'm using the free version of unity and I would like to combine lightmaps with specularity and normal maps. After doing a -bunch- of research, I've figured out that there doesn't seem to be any easy ...
16
votes
1answer
883 views

What is the math behind the light effect in krakatoa?

I'd like to know the math behind the light effect in krakatoa (click here for an example). Light source is traveling with particles, but how is shading done? Is it something simple, like Phong ...
1
vote
1answer
904 views

How do you make a water shader?

I'm working on a minecraft-like world and recently saw this video with a water shader. I searched but couldn't find any good info on how to do something similar. Maybe I'm just googling the wrong ...
6
votes
2answers
844 views

Rendering collections of light sources

I have a small test environment where small point lights are scattered. Players should able to collect them. The collectible lights are rendered using a simple billboard technique where two triangles ...
8
votes
4answers
676 views

I need help with 3d shading/lighting

How do you guys handle shading in a 3d game? I have a directional light source that shades one side of a tree made of cubes. The remaining 3 sides all get ambient shading only. So the 3d effect is ...