#Trying to implement skybox
62 messages · Page 1 of 1 (latest)
if you use the cubemap, then you need to use a shader
I cannot make without shader?
sure, but you don't use the cubemap channel
use diffuse and have a model that has the correct UVs
get a mesh that has the UV unwraps
this mean I change this to difuse like this?
skybox.materials[0].maps[MATERIAL_MAP_CUBEMAP].texture = LoadTextureCubemap(img, CUBEMAP_LAYOUT_AUTO_DETECT);
wait
no much yet
Learn OpenGL . com provides good and clear modern 3.3+ OpenGL tutorials with clear examples. A great resource to learn modern OpenGL aimed at beginners.
basically you don't need a cube map
you just need a mesh that has the correct mapping to wrap your texture around it
you set that in the diffuse channel
DrawCube or GenMeshCube won't work
you will have to load it as a model
I call it a progress XD
oh I see now
I need a model with the texture in the 6 sides inside it?
I was trying to use this texture for test
yes, you need model that knows how to map that
there is a way to map the texture direct in code?
you'd have to define the mesh manually
raylib is not a modeler, it doesn't have functions for defining UVs
that's what the shader does in the example, it defines the UVs using the cube map on the GPU
what models formats I can load?
obj, glb/gltf, m3d, iqm
after this I read this way?
Model skybox = LoadModel("cube.obj");
Texture2D texture = LoadTexture("skybox.png");
SetMaterialTexture(&skybox.materials[0], MATERIAL_MAP_DIFFUSE, texture);
because I'm getting a error
I already tried in 2 formats
are you trying to do that before InitWindow?
I'm trying after initWindow
arethe paths correct?
I think yes it even open this if I click the error message
yes the mtl is in same folder but I have same error with a glb
are you trying to compile that file INTO your game code?
what you mean? this model files are just files in the folder
do you get that error on compile or on run?
compile
why is the compiler trying to read the file?
this is the error
invalid or corrupt file: cannot read at 0x3AB
the models should not be part of the build at all
did you add them to the .sln file or something?
oh I though was to add I will remove
yeah, they are not source files
they are not part of the compile
they are read off disk at runtime
if you are using the quickstart they'd go in the resources folder
did you disable depth mask and depth test?
where is this option?
they are funcitons in rlgl
yes I will remove it
look at the example
you need to disable depth when you draw the skybox
then flush the batch, and turn it on
and draw the box BEFORE anything
thank you very much this is working now! ^^
glad it worked out