Re: OpenGL Sample not working
Ok, I think I have it. The problem is in this line:
Could you please edit the code and tell me the value returned by glGetUniformLocation(po, "projectionMtx") in your machine.
Thanks!
Code: Select all
NS_ASSERT(glGetUniformLocation(po, "projectionMtx") <= 255);
Thanks!
Re: OpenGL Sample not working
Can you please be more specific? I am only beginer with this, although I am more then beginer in C++. When local debugger start run, I get "SpiningCube.exe has triggered a breakpoint." with options Break or Continue.What kind of exception are you getting when the debugger halts there?
What I need to edit? You mean delete thisOk, I think I have it. The problem is in this line:
Code: Select allCould you please edit the code and tell me the value returned by glGetUniformLocation(po, "projectionMtx") in your machine.Code: Select allNS_ASSERT(glGetUniformLocation(po, "projectionMtx") <= 255);
Code: Select all
<= 255
Whatever I do, program crash and when this line of code is deleted, I get this:
Code: Select all
> SpiningCube.exe!Noesis::Render::GLRenderDevice::CreatePrograms() Line 976 C++
po 26/*(this value is allways 26)*/ unsigned int
Re: OpenGL Sample not working
When I coment all NS_ASSERT code
Program run without crash, but I get only blue background window and nothing else.//NS_ASSERT(glGetUniformLocation(po, "projectionMtx") <= 255);
mPrograms.projectionMtxLocation = (NsInt8)glGetUniformLocation(po, "projectionMtx");
mPrograms.projectionMtxHash = 0;
//NS_ASSERT(glGetUniformLocation(po, "opacity") <= 255);
mPrograms.opacityLocation = (NsInt8)glGetUniformLocation(po, "opacity");
mPrograms.opacityHash = 0;
//NS_ASSERT(glGetUniformLocation(po, "radialGrad") <= 255);
mPrograms.radialGradLocation = (NsInt8)glGetUniformLocation(po, "radialGrad");
mPrograms.radialGradHash = 0;
//NS_ASSERT(glGetUniformLocation(po, "rgba") <= 255);
mPrograms.rgbaLocation = (NsInt8)glGetUniformLocation(po, "rgba");
mPrograms.rgbaHash = 0;
Re: OpenGL Sample not working
Sorry for not explaining correctly. What I need is knowing what glGetUniformLocation() function is returning (leave the rest of code of untouched).
I need to know the value of location in your machine (just put a breakpoint after invoking).
Code: Select all
GLint location = glGetUniformLocation(po, "projectionMtx");
printf("%d", location);
NS_ASSERT(glGetUniformLocation(po, "projectionMtx") <= 255);
mPrograms[i].projectionMtxLocation = (NsInt8)glGetUniformLocation(po, "projectionMtx");
mPrograms[i].projectionMtxHash = 0;
Re: OpenGL Sample not working
Aha, ok,
Code: Select all
location 23724032 int
Re: OpenGL Sample not working
Thanks for your collaboration! The following patch should fix your problems:
Code: Select all
Index: GLRenderDevice.cpp
===================================================================
--- GLRenderDevice.cpp (revision 6447)
+++ GLRenderDevice.cpp (working copy)
@@ -970,20 +970,16 @@
mPrograms[i].vertexFormat = p.vertexFormat;
mPrograms[i].object = po;
- NS_ASSERT(glGetUniformLocation(po, "projectionMtx") <= 255);
- mPrograms[i].projectionMtxLocation = (NsInt8)glGetUniformLocation(po, "projectionMtx");
+ mPrograms[i].projectionMtxLocation = glGetUniformLocation(po, "projectionMtx");
mPrograms[i].projectionMtxHash = 0;
- NS_ASSERT(glGetUniformLocation(po, "opacity") <= 255);
- mPrograms[i].opacityLocation = (NsInt8)glGetUniformLocation(po, "opacity");
+ mPrograms[i].opacityLocation = glGetUniformLocation(po, "opacity");
mPrograms[i].opacityHash = 0;
- NS_ASSERT(glGetUniformLocation(po, "radialGrad") <= 255);
- mPrograms[i].radialGradLocation = (NsInt8)glGetUniformLocation(po, "radialGrad");
+ mPrograms[i].radialGradLocation = glGetUniformLocation(po, "radialGrad");
mPrograms[i].radialGradHash = 0;
- NS_ASSERT(glGetUniformLocation(po, "rgba") <= 255);
- mPrograms[i].rgbaLocation = (NsInt8)glGetUniformLocation(po, "rgba");
+ mPrograms[i].rgbaLocation = glGetUniformLocation(po, "rgba");
mPrograms[i].rgbaHash = 0;
}
else
Index: GLRenderDevice.h
===================================================================
--- GLRenderDevice.h (revision 6446)
+++ GLRenderDevice.h (working copy)
@@ -228,10 +228,10 @@
NsUInt8 vertexFormat;
GLuint object;
- NsInt8 projectionMtxLocation;
- NsInt8 opacityLocation;
- NsInt8 radialGradLocation;
- NsInt8 rgbaLocation;
+ GLint projectionMtxLocation;
+ GLint opacityLocation;
+ GLint radialGradLocation;
+ GLint rgbaLocation;
NsUInt32 projectionMtxHash;
NsUInt32 opacityHash;
Re: OpenGL Sample not working
Thanks, it looks like working. I can see now Login menu, but there are no cubes (if they should be there) as in D3D11 sample.
Re: OpenGL Sample not working
Yes, that's correct. Integration samples are not unified yet. Cool, I will integrate this patch in the next version of Noesis.
Thanks for the feedback!
Thanks for the feedback!
Who is online
Users browsing this forum: Google [Bot] and 0 guests