Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Josh Klint

Member Since 09 Jan 2011
Offline Last Active Nov 28 2014 02:44 PM

Topics I've Started

Choosing the discrete GPU with ATI/Intel switchable graphics?

12 January 2014 - 03:12 PM

I'm having trouble tracking down any information on ATI/Intel switchable graphics. On Nvidia/Intel combos, I just have to extern a variable to indicate the application should use the discrete GPU:


Code :
extern "C" {
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}

How is this supposed to be done on ATI/Intel combos? I have consulted the Google and found nothing.  This is using OpenGL on Windows, if that matters.


Android - Where to call surfaceView.getHolder().setFixedSize()?

27 August 2013 - 10:01 AM

I am trying to use surfaceView.getHolder().setFixedSize() to render to a half-resolution buffer on high-density Android displays.  Everywhere I try calling this command it either crashes or does nothing.  Where is this actually supposed to get called?


Code for fractal heightmap generation?

23 July 2013 - 03:10 PM

Fractal heightmap terrain is a common algorithm.  I was wondering if there was a pre-existing code library, or even just a snippet, that did this?  It could save me a few days of experimentation if there's already something out there I can use and modify.

 

Thanks!


Tessellation Trouble

01 June 2013 - 07:14 PM

I'm trying to get some old tessellation code running, but my objects just disappear when I set the draw mode to GL_PATCHES. Here is my control shader:
#version 410

layout(vertices = 3) out;

in vec4 ctrl_position[];

out vec4 eval_position[];

void main()
{
    float TessLevelInner = 1.0;
    float TessLevelOuter = 1.0;

    if (gl_InvocationID == 0) {
        gl_TessLevelInner[0] = TessLevelInner;
        gl_TessLevelOuter[0] = TessLevelOuter;
        gl_TessLevelOuter[1] = TessLevelOuter;
        gl_TessLevelOuter[2] = TessLevelOuter;
    }
    eval_position[gl_InvocationID] = ctrl_position[gl_InvocationID];
}
And my evaluation shader:
#version 400

layout(triangles, equal_spacing, ccw) in;

in vec4 eval_position[];

void main()
{
    gl_Position = (eval_position[0] * gl_TessCoord.x + eval_position[1] * gl_TessCoord.y + eval_position[2] * gl_TessCoord.z);
}
Do you see anything wrong?

Coding Gouraud or Phong shading on a polygon

14 May 2013 - 03:41 PM

I'm implementing smooth groups for our lightmapper.  This means each face's normal needs to be interpolated across a face for the lighting equation, instead of just using the flat polygon normal.

 

Our lightmapper works on BSP-style, where each side is coplanar and can have any number of sides.

 

So my question is, is there a simple way to do Gouraud or Phong shading on a coplanar polygon?  Is there any other routine that can calculate this?  I tried messing around with a vertex distance method, but I don't think that will work.


PARTNERS