₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,235 members, 8,439,439 topics. Date: Sunday, 05 July 2026 at 09:26 AM

Toggle theme

Can You Draw A 3d Scene In Opengl Without Textures - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingCan You Draw A 3d Scene In Opengl Without Textures (645 Views)

1 Reply (Go Down)

Can You Draw A 3d Scene In Opengl Without Textures by MaxFrost(op): 10:59am On Dec 06, 2022
Please graphics programmers in The house
I'm learning opengl with sdl2 and when I try to draw a 3d shape without using The textures it just returns a blank screen. But if I use textures it works perfectly.
Re: Can You Draw A 3d Scene In Opengl Without Textures by qtguru(m): 5:35pm On Dec 06, 2022
MaxFrost:
Please graphics programmers in The house
I'm learning opengl with sdl2 and when I try to draw a 3d shape without using The textures it just returns a blank screen. But if I use textures it works perfectly.
Wireframe mode, check there is a GL command for that
Re: Can You Draw A 3d Scene In Opengl Without Textures by darkdenizen: 5:45pm On Dec 06, 2022
to add to what qtguru suggested also try and manipulate the scene and geometry lighting.

if you know some javascript i would suggest you try out 3js. its what i use for web 3d
Re: Can You Draw A 3d Scene In Opengl Without Textures by qtguru(m): 5:49pm On Dec 06, 2022
darkdenizen:
to add to what qtguru suggested also try and manipulate the scene and geometry lighting.

if you know some javascript i would suggest you try out 3js. its what i use for web 3d
I think there is a mode that either draws with line or fill.

OP this is SDL and C++, mehn you're much better off on Reddit,
Re: Can You Draw A 3d Scene In Opengl Without Textures by MaxFrost(op): 8:07pm On Dec 06, 2022
qtguru:
Wireframe mode, check there is a GL command for that
What I mean is how I go about drawing a 3d object without filling it with textures instead filling it with plain colours
Re: Can You Draw A 3d Scene In Opengl Without Textures by Jivi: 7:14pm On Dec 08, 2022
A simple way is to add a uniform vec4 colorYouWant in the GLSL shader and set the output color to that color. One reason you may be getting blank is probably because no texture means black and with alpha testing enabled, that will be blank.
Re: Can You Draw A 3d Scene In Opengl Without Textures by Jivi: 7:15pm On Dec 08, 2022
MaxFrost:
What I mean is how I go about drawing a 3d object without filling it with textures instead filling it with plain colours
A simple way is to add a uniform vec4 colorYouWant in the GLSL shader and set the output color to that color. One reason you may be getting blank is probably because no texture means black(vec4(0.0f, 0.0f, 0.0f, 0.0f)) and with alpha testing enabled, that will be blank.
Re: Can You Draw A 3d Scene In Opengl Without Textures by Jivi: 7:21pm On Dec 08, 2022
And this depends on whether you are using fixed function pipeline or programmable pipeline. Fixed function pipeline is outdated and you don't need to waste time learning it. You need to use GLSL shaders and set the shader uniform as I outlined earlier.
1 Reply

I'm Having Trouble Setting Up Opengl On VscodeC++ Opengl/direct3d 11 Developer NeededBuilding A 3d Game234

Tech Layoffs & AI ThreatHelp Me Review My SiteWch Is D Best