0
votes
0answers
75 views

OpenGL shading doesn't work with different projection and view matrices?

I found an online (public-domain) code to do marching cubes, and I am trying to adapt this code to work in my own project. The code uses GLUT and "older-style" OpenGL, whereas I am using GLM and ...
1
vote
2answers
75 views

Should I shade models before or after importing them into Unity?

Is it better to shade a model inside the 3D modeling software or inside Unity? As an example, if I need to use a transparent model, should it be made transparent inside the modeling application or ...
0
votes
1answer
106 views

What is wrong with my specular phong shading

I'm sorry if this should be placed on stackoverflow instead however seeing as this is graphics related I was hoping you guys could help me: I'm attempting to write a phong shader and currently working ...
2
votes
1answer
170 views

draw fog of war using shaders

I am making a RTS game, and I'd like some advice on how to best render fog of wars, given what I'm already doing. You can imagine this game as being a classic RTS like Age of Empires 2, where the fog ...
1
vote
1answer
330 views

glsl shader to allow color change of skydome ogre3d

I'm still very new to all this but learning a lot. I'm putting together an application using Ogre3d as the rendering engine. So far I've got it running, with a simple scene, a day/night cycle system ...
2
votes
1answer
174 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" } ...
14
votes
3answers
2k views

How can I draw outlines around 3D models?

How can I draw outlines around 3D models? I'm referring to something like the effects in a recent Pokemon game, which appear to have a single-pixel outline around them:
1
vote
1answer
143 views

How to enable geometry shader in OpenGL 4.2?

I'm porting my Direct3D-based engine to OpenGL and I'm using geometry shaders for rendering text characters (basically, textured billboards). D3D version works fine, but in OpenGL mode it gives only ...
0
votes
1answer
137 views

HLSL postprocessing for day to night (DTN)

I am trying to implement a "day-to-night"-filter (as commonly used in cinema) for a 2D game (XNA) by using a full screen HLSL pixel shader. The aim is to transform any bright and colorful image into a ...
3
votes
2answers
341 views

When is the Z coordinate normalized in GLSL?

I thought that whenever you transform an object to world space, then view space and finally screen space, the last matrix you apply(the projection matrix) normalizes the z values between 0 and 1. ...
1
vote
1answer
274 views

What is the difference between shader uniforms and attributes in OpenGL?

I don't fully understand the differences between uniforms and attributes. To be honest, I probably haven't even used attributes. Can uniforms change for each vertex? I mean to calculate the vertex's ...
14
votes
1answer
626 views

Rendering oily/polluted water?

Any shader wizards out there have an idea of how to achieve an oily/polluted water effect, similar to this: Ideally, the water would not be uniformly oily, but instead the oil could be generated ...
2
votes
1answer
362 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. ...
12
votes
3answers
762 views

Recreating this flat-shaded look

I'll keep it short. How does one achieve the effect depicted in the image below? Is it feasible to do in realtime? It looks deceptively simple, but it probably isn't. Are there any keywords I can ...
0
votes
2answers
177 views

HLSL Pixel Shader Compile, Flow Control, Instruction Count, XNA Issue

im trying to find help with an issue im having moving from the XNA 3.1 framework to XNA 4.0. The shaders I wrote for my 2D game work fine in XNA 3.1, but wont even compile in 4.0. At first I got ...
6
votes
2answers
584 views

What is this Super Mario shading technique (the edge glow) called?

What is this Super Mario shading technique (the edge glow) called? It can best be seen at the legs.
0
votes
1answer
75 views

Are there shaders or at least shader like things in Swing?

Is there? Because I'm wondering if it supports GLSL, HLSL, or it's own shading language? I don't know much about Swing graphics. Does anyone know?
3
votes
1answer
164 views

Messed up UVs in Unity3D for Android

All of my quads appear correctly textured on the Unity3D editor, a Motorola Xoom Android tablet, and on an iPad 2: But on our Samsung Galaxy Mini 2 smartphone they kinda look like this: I wrote ...
6
votes
1answer
419 views

Changing water color based on depth

I'm looking to make a water shader that colors the water based on its depth. Up until now my water shader that I've used has basically been extremely reflective and only looked somewhat blue because ...
0
votes
1answer
196 views

Opengl binding shaders vs binding buffers performance

Quick question for an opengl guru, I'm in the process of building a render queue and can either reduce the number of shader binding or the number of vertex buffer binding. I just want to know which ...
37
votes
2answers
3k views

How to render realistic ice?

I am trying to write an ice shader in Unity that looks good and at least semi-realistic. If the following shot (found on Google) was CG, what would its shader include? (the foreground cave). I might ...
1
vote
2answers
174 views

Why is antialiasing dependent on sampling?

I am thinking about the best ways to render two dimensional objects in the highest detail possible using modern graphics technology and it occurred to me that when I simplify a situation enough, I ...
11
votes
2answers
2k views

Realistic metal shader

How do you create a good metal shader? For different metals and say more or less eroded / rusty and so on. I know that one difference from ordinary materials is that metal should 'colour' the ...
3
votes
1answer
837 views

How'd they do it: TF2 payload cart glow?

How did the creators of TF2 make the glow on the payload cart visible through walls? Is it possible to implement this in Unity's shaderlab?
4
votes
2answers
942 views

Real time reflections

I just had a quick look at the new Crysis 2 DX11 update, and was quite surprised by some of the new features, especially the real time reflections on moving models. From what I could gather, there are ...
8
votes
1answer
295 views

Overview/showcase of shader techniques/uses for games

I am looking for resources that can provide me with a better understanding of what kind of things shaders are used for in games, what they can do, and maybe even more importantly, what they cannot. I ...
15
votes
1answer
2k views

The practical cost of swapping effects

I use XNA for my projects and on those forums I sometimes see references to the fact that swapping an effect for a mesh has a relatively high cost, which surprises me as I thought to swap an effect ...
4
votes
2answers
653 views

What does the term 'photorealistic' really mean?

I was wondering about the term 'photorealistic' in regards to rendering and was wondering how this is used. Is it used to describe a shader (or set of) that have certain quantifiable features? Or any ...
1
vote
1answer
517 views

Porting an HLSL 3.0 shader to 2.0?

I have a couple of .fx files from a Shader-Based 2D Shadows example. I want to utilize the same kind of technique with XNA 4.0's Reach profile, which if I understand correctly needs to have HLSL 2.0 ...
6
votes
2answers
1k views

Looking for an example of glass with XNA or DirectX 9

Any good pointers on how to get the refractive look of glass? I'm looking to create a think piece of glass type of look, sort of the type that you'd have on bathroom shower doors.
12
votes
3answers
1k views

HLSL Translucent Plastic Shader

I'm trying to produce a shader to replicate a white plastic object with a colored light inside. Either by having a shader that will be translucent and if I put a light inside the object the light will ...
14
votes
7answers
11k views

What are some cool examples of procedural pixel shader effects? [closed]

What are some good examples of procedural or screen-space pixel shader effects? No code is necessary; I'm just looking for inspiration. In particular, I'm looking for effects that are not dependent ...
6
votes
2answers
582 views

What is a good alternative to Unified Shader for Shadows?

Most shadow systems I have seen use a unified shader system for shadowing techniques, resulting in an uber shader for the projects. What alternatives do you find work well or is the unified shader ...