Code: Select all
GL_VERSION = 4.3.0 NVIDIA 310.14
Code: Select all
GL_VERSION = 4.3.0 NVIDIA 310.14
Do you mean you have not tested tessellation, or that all your tests have not succeeded?masterfalcon wrote:There is some work on supporting them, but I have not yet had a successful test.
*raises hand in the air so quickly his arm nearly comes out of socket* Meeeeeeeee!masterfalcon wrote:If anyone wants to help, it would be greatly appreciated.
I will check this out when I get home today.masterfalcon wrote:Another update to my tessellation work. It's rendering something at least, if you move the mouse around you'll see it. I suspect that there is something wrong with how I translated the shaders. Would anyone be able to verify?
Sorry I will not be able to test until at least thursday.masterfalcon wrote:Another update to my tessellation work. It's rendering something at least, if you move the mouse around you'll see it. I suspect that there is something wrong with how I translated the shaders. Would anyone be able to verify?
Code: Select all
// Create new texture with updated dimensions.
mVideoTexture = Ogre::TextureManager::getSingleton().createManual(
mName + "_Texture",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
TEX_TYPE_2D,
mVideoWidth, mVideoHeight,
0,PF_X8R8G8B8,
//0, PF_B8G8R8A8,
//0, PF_R8G8B8A8, //THIS ONE
//0,PF_A8R8G8B8,
TU_DYNAMIC_WRITE_ONLY);
//mVideoMaterial->getTechnique(0)->setSchemeName("ShaderScheme");
mVideoMaterial->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
mVideoMaterial->getTechnique(0)->getPass(0)->createTextureUnitState(
mVideoTexture->getName());
Code: Select all
String customVideoMatVp_GLSL =
"#version 150 \n"
"in vec2 uv0;\n"
"in vec4 vertex;\n"
"out vec2 oUv0;\n"
"uniform mat4 worldViewProj;\n"
"void main()\n"
"{\n"
" gl_Position = worldViewProj * vertex;\n"
" oUv0.xy = uv0.xy;\n"
"}\n";
String customVideoMatFp_GLSL =
"#version 150 \n"
"in vec2 oUv0;\n"
"out vec4 fragColour;\n"
"uniform sampler2D diffuseMap;\n"
"void main()\n"
"{\n"
" fragColour = vec4(texture(diffuseMap, oUv0.xy).zyx,1.0);\n"
"}\n";
String customVideoMatVp_GLSL_120 =
" #version 120 \n"
" varying vec2 UV;\n"
" uniform mat4 worldViewProj;\n"
" void main()\n"
" {\n"
" gl_Position = worldViewProj * gl_Vertex;\n"
" UV = gl_MultiTexCoord0.xy;"
" }\n";
String customVideoMatFp_GLSL_120 =
" varying vec2 UV;\n"
" uniform sampler2D diffuseMap;\n"
" void main()\n"
"{\n"
" gl_FragColor = vec4(texture2D(diffuseMap, UV).zyx,1.0);\n"
"}\n";
bool useCG = false;
bool useGLSL120 = false;
bool useGLSL150 = true;
String mLanguage;
if (useCG)
mLanguage = "cg";
else
mLanguage = "glsl";
HighLevelGpuProgramPtr vp = HighLevelGpuProgramManager::getSingleton()
.createProgram("VideoVp",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
mLanguage, GPT_VERTEX_PROGRAM);
HighLevelGpuProgramPtr fp = HighLevelGpuProgramManager::getSingleton()
.createProgram("VideoFp",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
mLanguage, GPT_FRAGMENT_PROGRAM);
if (vp->getLanguage()=="cg") {
vp->setSource(customVideoMatVp_CG);
vp->setParameter("profiles", "vs_1_1 arbvp1");
vp->setParameter("entry_point", "VideoVp");
}
else {
if (useGLSL120) {
vp->setParameter("syntax", "glsl");
vp->setSource(customVideoMatVp_GLSL_120);
}
else
{
vp->setParameter("syntax", "glsl150");
vp->setSource(customVideoMatVp_GLSL);
}
}
if (fp->getLanguage()=="cg") {
fp->setSource(customVideoMatFp_CG);
fp->setParameter("profiles", "ps_1_1 arbfp1");
fp->setParameter("entry_point", "VideoFp");
}
else
{
if (useGLSL120) {
fp->setParameter("syntax", "glsl");
fp->setSource(customVideoMatFp_GLSL_120);
}
else
{
fp->setParameter("syntax", "glsl150");
fp->setSource(customVideoMatFp_GLSL);
}
}
vp->load();
fp->load();
p->setVertexProgram("VideoVp");
p->setFragmentProgram("VideoFp");
p->getVertexProgramParameters()->setNamedAutoConstant(
"worldViewProj",
GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
if (!useCG)
p->getFragmentProgramParameters()->setNamedConstant(
"diffuseMap",
0);
Code: Select all
//guint8* memory, gsize size
HardwarePixelBufferSharedPtr pixelBuffer = mVideoTexture->getBuffer();
void* textureData = pixelBuffer->lock(HardwareBuffer::HBL_DISCARD);
memcpy(textureData, &memory[0], (int)size);
pixelBuffer->unlock();
No it just outputs something unrelated to whatever the video is.masterfalcon wrote:Is it crashing or are you just not getting the output you expect?
Yeah I'll try that and running through apitrace.masterfalcon wrote:You could try turning on GL error checks in OgreGL3PlusPrerequisites.h and see if that reveals part of the problem.
No need, you have enough on your plate. I was just hoping that I had was doing something so dumb due to me misunderstanding the differences between GL and GL3+ that it would be blatantly obvious.masterfalcon wrote:Otherwise I can try to take a look later using your sample.
To debug this:dermont wrote:masterfalcon wrote:Yeah I'll try that and running through apitrace.masterfalcon wrote:You could try turning on GL error checks in OgreGL3PlusPrerequisites.h and see if that reveals part of the problem.
Code: Select all
symbol lookup error: /home/syniurge/Projets/Dependencies/ogre_build/lib/RenderSystem_GL3Plus.so.1.9.0: undefined symbol: glXCreateContextAttribsARB
Code: Select all
Error attaching FFPLib_Common_VS shader object to GLSL Program Object
Program binary could not be loaded. Binary is not compatible with current driver/hardware combination.
Code: Select all
https://bitbucket.org/sinbad/ogre/raw/2ad4bd4336205e6964152141bcf15e105d215fea/Samples/Common/include/SampleContext.h
else if(Ogre::GpuProgramManager::getSingleton().isSyntaxSupported("glsl"))
{
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(arch + "/RTShaderLib/GLSL", type, sec);
if(Ogre::GpuProgramManager::getSingleton().isSyntaxSupported("glsl150"))
{
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(arch + "/RTShaderLib/GLSL150", type, sec);
}
}
Code: Select all
GLSL compile log: Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL
0(43) : error C7533: global variable gl_TexCoord is deprecated after version 120
GLSL compile log: Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL