• Advertisement
Sign in to follow this  

OpenGL gluLookAt() and matrix stack operations deprecated?

This topic is 1361 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a couple question about some opengl deprecated functionality and it's replacements:

 

1.) I'm told gluLookAt() is deprecated in 3.0. What do i use as it's replacement? Do i multiply a camera rotation matrix by the view matrix to get the new view matrix?

 

2.) My understanding was that OpenGL works with a 32 stack of 4x4 ModelView matrices. If i can't push and pop matrices anymore and vertex data is in a VAO, then there is absolutely no point in 32 stacks and it mine as well be 1 ModelView matrix?

Share this post


Link to post
Share on other sites
Advertisement

All matrix operations and everything that came with it, such as the stack, are all gone. There's not even anything called a model view matrix in OpenGL anymore. You have to manage all matrices yourself now and load them to your shaders as necessary.

Share this post


Link to post
Share on other sites

Do you have a sample program code by chance or can tell me how i could manage model, view, and proj matrix? It seems like 99% of opengl tutorial code on the web is using functionality that was deprecated years before they published the tutorial.

 

Could i get the MVP matrices like so, then send modelview[16] to the shader:

float modelview[16];
glGetFloatv(GL_MODELVIEW_MATRIX, modelview);

Share this post


Link to post
Share on other sites

I have a couple question about some opengl deprecated functionality and it's replacements:

 

1.) I'm told gluLookAt() is deprecated in 3.0. What do i use as it's replacement? Do i multiply a camera rotation matrix by the view matrix to get the new view matrix?

 

2.) My understanding was that OpenGL works with a 32 stack of 4x4 ModelView matrices. If i can't push and pop matrices anymore and vertex data is in a VAO, then there is absolutely no point in 32 stacks and it mine as well be 1 ModelView matrix?

 

1) Vast amount of legacy OpenGL functions is deprecated, not just matrix manipulation.

 

2) Vertex data is not stored in VAO, but in VBO. VAO stores client state (which attributes are enabled, offsets, etc.). A stack of model-view or projection matrices are still useful, but YOU have to implement them if you need them.

 

 

Do you have a sample program code by chance or can tell me how i could manage model, view, and proj matrix? It seems like 99% of opengl tutorial code on the web is using functionality that was deprecated years before they published the tutorial.

 

Could i get the MVP matrices like so, then send modelview[16] to the shader:

float modelview[16];
glGetFloatv(GL_MODELVIEW_MATRIX, modelview);

 

No, you cannot do that! Because functions that sets legacy model-view (top) matrix are deprecated as well. There is a plenty of modern OpenGL tutorials. Just google for them. :)

...

Share this post


Link to post
Share on other sites

You can use uniforms to pass the MVP matrix. I recommend you read a tutorial like this one on modern OpenGL. I also recommend using a math library like GLM which provides functions like lookAt except if you like writing this functionality yourself. For example:

glm::perspective(angle, ratio, near, far) * glm::lookAt(position, target, up)

Share this post


Link to post
Share on other sites

At this stage it's important to add:

 

While the functionality had been officially deprecated, that doesn't mean that it's stopped working!

 

For the most part you can continue using it and it will continue working just as before.  The exception is if you create a "core context" which only supports the non-deprecated functionality, but all drivers will by default give you a "compatibility context", which fully supports it.

 

In other words: unless you explicitly ask for it to not be available, you can continue using it.

 

This seems similar to when Microsoft announced that they weren't providing any more updates to XNA and the internet was full of whining as if XNA had suddenly stopped working.  Yayy internet.  That's not the case at all.

 

Now, it's necessary for me to temper that with a healthily-sized dose of "just because you can doesn't mean that you should" (because yayy internet again).  The old matrix stack and GLU functions were never anything more than a software matrix library, so if you want a replacement for them, the answer is simple: find and use a software matrix library (glm seems to be a popular choice).

 

But unless you need to stop using the old stuff, there's no reason to not continue using it.

 

Again - yayy internet - that doesn't mean I'm advocating it's use.  Just that I'm conscious that porting existing code from old to new (anything, not just GL) can be a very large job, and often has minimal benefit.  All new programs should just use the new stuff.

Share this post


Link to post
Share on other sites

I see, i see.

 

I have a couple last questions:

 

 

(i) Since i feed vertex position in eye space into the VAO/VBO, instead of model space vertex position through glBegin->glVertex3f->glEnd, does this mean, in my vertex shader, i no longer need to transform the received vertex from model->eye space like so:

void main() {
 
    gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
}

and i can instead do the following since im passing in eye space vertex positions to thee vertex shader?:

attribute vec4 v_coord;
attribute vec3 v_normal;
 
void main() {
 
    gl_Position = v_coord;
}

(ii) I know i have to control the MVP matrices myself, then send them to the shader. When do i change the Model matrix? Because in legacy opengl, the Model matrix was changed with every glTranslate or glRotate call.

Edited by Shawn619

Share this post


Link to post
Share on other sites

I see, i see.
 
I have a couple last questions:
 
 
(i) Since i feed vertex position in eye space into the VAO/VBO, instead of model space vertex position through glBegin->glVertex3f->glEnd, does this mean, in my vertex shader, i no longer need to transform the received vertex from model->eye space like so:

void main() {
 
    gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
}
and i can instead do the following since im passing in eye space vertex positions to thee vertex shader?:
attribute vec4 v_coord;
attribute vec3 v_normal;
 
void main() {
 
    gl_Position = v_coord;
}

If you're passing eye-space coordinates then you shouldn't do anther model-to-eye space transformation because your vertices are already in eye-space. But that also implies that you're doing your transformations manually instead of doing them in the shader. If you want to do the equivalent operations to the legacy model, you need to pass the projection and modelview matrices to your shader, pass model-space vertices, and do the transformations in there but with your own uniform variables instead of the built in gl-uniforms.

 

(ii) I know i have to control the MVP matrices myself, then send them to the shader. When do i change the Model matrix? Because in legacy opengl, the Model matrix was changed with every glTranslate or glRotate call.

You should upload the matrix to the shader program when you have composed all the necessary transformations. If you have a translation and a rotation, then combine them and load the final matrix to the shader.

Share this post


Link to post
Share on other sites

Sorry for all the questions.

 

Do i send eye-space vertex positions in the VAO/VBO? Because model-space vertex positions in the VAO/VBO wouldn't make sense, right? 

Share this post


Link to post
Share on other sites

Model space (or object space, to give it its usual name) positions in the buffer makes perfect sense. Consider the buffer to be the object in and of itself, and the vertex shader to be instructions for viewing it. Obviously that's a very simple version and the vertex shader can do a lot more, but it's a solid starting point.

Edited by OandO

Share this post


Link to post
Share on other sites

I'm understanding more, thank you guys.

 

I have a couple important questions that would really help me understand these model, view, and proj matrices so i can construct them myself:

 

(i) In response to "OandO", if i provide object space data to the buffers, like a triangle for example:

float vertices1[] = {   -1.0f, 0.0f, 0.0f, 1.0f,
            1.0f, 0.0f, 0.0f, 1.0f,
            0.0f, 2.0f, 0.0f, 1.0f};

which is later sent to a VAO:

    glGenVertexArrays(3, vao);
    //
    // VAO for first triangle
    //
    glBindVertexArray(vao[0]);
    // Generate two slots for the vertex and color buffers
    glGenBuffers(2, buffers);
    // bind buffer for vertices and copy data into buffer
    glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices1), vertices1, GL_STATIC_DRAW);
    glEnableVertexAttribArray(vertexLoc);
    glVertexAttribPointer(vertexLoc, 4, GL_FLOAT, 0, 0, 0);

How would i move the triangle 5 pixels into the screen(glTranslatef(0.0,0.0,-5.0);) in non-deprecated terms? Because if i alter the "vertices1" vertices to add -5.0 in the z-component(push triangle further back), isn't that changing the vertices from object->world space?

 

(ii) Does a ModelViewProjection 4v4 matrix exist such that any vertex position data for any object sent into a VAO/VBO multiplied by this ModelViewProjection 4v4 will give you that vertex position in world space?

 

Thank you again guys.

Edited by Shawn619

Share this post


Link to post
Share on other sites

I'm understanding more, thank you guys.
 
I have a couple important questions that would really help me understand these model, view, and proj matrices so i can construct them myself:
 
(i) In response to "OandO", if i provide object space data to the buffers, like a triangle for example:

float vertices1[] = {   -1.0f, 0.0f, 0.0f, 1.0f,
            1.0f, 0.0f, 0.0f, 1.0f,
            0.0f, 2.0f, 0.0f, 1.0f};
which is later sent to a VAO:
    glGenVertexArrays(3, vao);
    //
    // VAO for first triangle
    //
    glBindVertexArray(vao[0]);
    // Generate two slots for the vertex and color buffers
    glGenBuffers(2, buffers);
    // bind buffer for vertices and copy data into buffer
    glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices1), vertices1, GL_STATIC_DRAW);
    glEnableVertexAttribArray(vertexLoc);
    glVertexAttribPointer(vertexLoc, 4, GL_FLOAT, 0, 0, 0);
How would i move the triangle 5 pixels into the screen(glTranslatef(0.0,0.0,-5.0);) in non-deprecated terms? Because if i alter the "vertices1" vertices to add -5.0 in the z-component(push triangle further back), isn't that changing the vertices from object->world space?

(ii) Does a ModelViewProjection 4v4 matrix exist such that any vertex position data for any object sent into a VAO/VBO multiplied by this ModelViewProjection 4v4 will give you that vertex position in world space?
 
Thank you again guys.

 

That is what has been stated above already. Create a translation matrix using the vector library you use as a replacement for OpenGL's previously built in functions, load it into the shader, and multiply your vertices by the matrix from the shader.

 

I don't have the possibility to try the code and writing from the top of my head, so take it for pseudo-code.

 

Your OpenGL code (creating the matrix and loading it to the shader):

glm::mat4 mv_matrix = glm::translate(0, 0, -5);
 
GLint mvm_location = glGetUniformLocation(your program handle, "mv_matrix");
glUniformMatrix4fv(mvm_location, mv_matrix);

 

Your shader (multiplying your own model view matrix and the vertex):

in vec3 v_coord;
uniform mat4 mv_matrix:

void main() {
     gl_Position = mv_matrix*v_coord;
}

Share this post


Link to post
Share on other sites

glGenVertexArrays(3, vao);

Why are you creating 3 VAO's to display 1 triangle?

Your OpenGL code (creating the matrix and loading it to the shader):

glm::mat4 mv_matrix = glm::translate(0, 0, -5);

GLint mvm_location = glGetUniformLocation(your program handle, "mv_matrix");
glUniformMatrix4fv(mvm_location, mv_matrix);

glm::mat4 model(1.0f);
model = glm::translate(model, glm::vec3(0.0f, 0.0f, -5.0f));
MVP = viewProjectionMat * model;glUseProgram(program);
glUniformMatrix4fv(MVPLoc, 1, GL_FALSE, glm::value_ptr(MVP));
glUseProgram(0);
Im sure there isnt a glm::translate which doesnt take a glm::mat4 and
glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); Edited by Gooey

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Now

  • Advertisement
  • Similar Content

    • By reenigne
      For those that don't know me. I am the individual who's two videos are listed here under setup for https://wiki.libsdl.org/Tutorials
      I also run grhmedia.com where I host the projects and code for the tutorials I have online.
      Recently, I received a notice from youtube they will be implementing their new policy in protecting video content as of which I won't be monetized till I meat there required number of viewers and views each month.

      Frankly, I'm pretty sick of youtube. I put up a video and someone else learns from it and puts up another video and because of the way youtube does their placement they end up with more views.
      Even guys that clearly post false information such as one individual who said GLEW 2.0 was broken because he didn't know how to compile it. He in short didn't know how to modify the script he used because he didn't understand make files and how the requirements of the compiler and library changes needed some different flags.

      At the end of the month when they implement this I will take down the content and host on my own server purely and it will be a paid system and or patreon. 

      I get my videos may be a bit dry, I generally figure people are there to learn how to do something and I rather not waste their time. 
      I used to also help people for free even those coming from the other videos. That won't be the case any more. I used to just take anyone emails and work with them my email is posted on the site.

      I don't expect to get the required number of subscribers in that time or increased views. Even if I did well it wouldn't take care of each reoccurring month.
      I figure this is simpler and I don't plan on putting some sort of exorbitant fee for a monthly subscription or the like.
      I was thinking on the lines of a few dollars 1,2, and 3 and the larger subscription gets you assistance with the content in the tutorials if needed that month.
      Maybe another fee if it is related but not directly in the content. 
      The fees would serve to cut down on the number of people who ask for help and maybe encourage some of the people to actually pay attention to what is said rather than do their own thing. That actually turns out to be 90% of the issues. I spent 6 hours helping one individual last week I must have asked him 20 times did you do exactly like I said in the video even pointed directly to the section. When he finally sent me a copy of the what he entered I knew then and there he had not. I circled it and I pointed out that wasn't what I said to do in the video. I didn't tell him what was wrong and how I knew that way he would go back and actually follow what it said to do. He then reported it worked. Yea, no kidding following directions works. But hey isn't alone and well its part of the learning process.

      So the point of this isn't to be a gripe session. I'm just looking for a bit of feed back. Do you think the fees are unreasonable?
      Should I keep the youtube channel and do just the fees with patreon or do you think locking the content to my site and require a subscription is an idea.

      I'm just looking at the fact it is unrealistic to think youtube/google will actually get stuff right or that youtube viewers will actually bother to start looking for more accurate videos. 
    • By Balma Alparisi
      i got error 1282 in my code.
      sf::ContextSettings settings; settings.majorVersion = 4; settings.minorVersion = 5; settings.attributeFlags = settings.Core; sf::Window window; window.create(sf::VideoMode(1600, 900), "Texture Unit Rectangle", sf::Style::Close, settings); window.setActive(true); window.setVerticalSyncEnabled(true); glewInit(); GLuint shaderProgram = createShaderProgram("FX/Rectangle.vss", "FX/Rectangle.fss"); float vertex[] = { -0.5f,0.5f,0.0f, 0.0f,0.0f, -0.5f,-0.5f,0.0f, 0.0f,1.0f, 0.5f,0.5f,0.0f, 1.0f,0.0f, 0.5,-0.5f,0.0f, 1.0f,1.0f, }; GLuint indices[] = { 0,1,2, 1,2,3, }; GLuint vao; glGenVertexArrays(1, &vao); glBindVertexArray(vao); GLuint vbo; glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(vertex), vertex, GL_STATIC_DRAW); GLuint ebo; glGenBuffers(1, &ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices,GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, false, sizeof(float) * 5, (void*)0); glEnableVertexAttribArray(0); glVertexAttribPointer(1, 2, GL_FLOAT, false, sizeof(float) * 5, (void*)(sizeof(float) * 3)); glEnableVertexAttribArray(1); GLuint texture[2]; glGenTextures(2, texture); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); sf::Image* imageOne = new sf::Image; bool isImageOneLoaded = imageOne->loadFromFile("Texture/container.jpg"); if (isImageOneLoaded) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imageOne->getSize().x, imageOne->getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageOne->getPixelsPtr()); glGenerateMipmap(GL_TEXTURE_2D); } delete imageOne; glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); sf::Image* imageTwo = new sf::Image; bool isImageTwoLoaded = imageTwo->loadFromFile("Texture/awesomeface.png"); if (isImageTwoLoaded) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imageTwo->getSize().x, imageTwo->getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageTwo->getPixelsPtr()); glGenerateMipmap(GL_TEXTURE_2D); } delete imageTwo; glUniform1i(glGetUniformLocation(shaderProgram, "inTextureOne"), 0); glUniform1i(glGetUniformLocation(shaderProgram, "inTextureTwo"), 1); GLenum error = glGetError(); std::cout << error << std::endl; sf::Event event; bool isRunning = true; while (isRunning) { while (window.pollEvent(event)) { if (event.type == event.Closed) { isRunning = false; } } glClear(GL_COLOR_BUFFER_BIT); if (isImageOneLoaded && isImageTwoLoaded) { glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture[0]); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texture[1]); glUseProgram(shaderProgram); } glBindVertexArray(vao); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, nullptr); glBindVertexArray(0); window.display(); } glDeleteVertexArrays(1, &vao); glDeleteBuffers(1, &vbo); glDeleteBuffers(1, &ebo); glDeleteProgram(shaderProgram); glDeleteTextures(2,texture); return 0; } and this is the vertex shader
      #version 450 core layout(location=0) in vec3 inPos; layout(location=1) in vec2 inTexCoord; out vec2 TexCoord; void main() { gl_Position=vec4(inPos,1.0); TexCoord=inTexCoord; } and the fragment shader
      #version 450 core in vec2 TexCoord; uniform sampler2D inTextureOne; uniform sampler2D inTextureTwo; out vec4 FragmentColor; void main() { FragmentColor=mix(texture(inTextureOne,TexCoord),texture(inTextureTwo,TexCoord),0.2); } I was expecting awesomeface.png on top of container.jpg

    • By khawk
      We've just released all of the source code for the NeHe OpenGL lessons on our Github page at https://github.com/gamedev-net/nehe-opengl. code - 43 total platforms, configurations, and languages are included.
      Now operated by GameDev.net, NeHe is located at http://nehe.gamedev.net where it has been a valuable resource for developers wanting to learn OpenGL and graphics programming.

      View full story
    • By TheChubu
      The Khronos™ Group, an open consortium of leading hardware and software companies, announces from the SIGGRAPH 2017 Conference the immediate public availability of the OpenGL® 4.6 specification. OpenGL 4.6 integrates the functionality of numerous ARB and EXT extensions created by Khronos members AMD, Intel, and NVIDIA into core, including the capability to ingest SPIR-V™ shaders.
      SPIR-V is a Khronos-defined standard intermediate language for parallel compute and graphics, which enables content creators to simplify their shader authoring and management pipelines while providing significant source shading language flexibility. OpenGL 4.6 adds support for ingesting SPIR-V shaders to the core specification, guaranteeing that SPIR-V shaders will be widely supported by OpenGL implementations.
      OpenGL 4.6 adds the functionality of these ARB extensions to OpenGL’s core specification:
      GL_ARB_gl_spirv and GL_ARB_spirv_extensions to standardize SPIR-V support for OpenGL GL_ARB_indirect_parameters and GL_ARB_shader_draw_parameters for reducing the CPU overhead associated with rendering batches of geometry GL_ARB_pipeline_statistics_query and GL_ARB_transform_feedback_overflow_querystandardize OpenGL support for features available in Direct3D GL_ARB_texture_filter_anisotropic (based on GL_EXT_texture_filter_anisotropic) brings previously IP encumbered functionality into OpenGL to improve the visual quality of textured scenes GL_ARB_polygon_offset_clamp (based on GL_EXT_polygon_offset_clamp) suppresses a common visual artifact known as a “light leak” associated with rendering shadows GL_ARB_shader_atomic_counter_ops and GL_ARB_shader_group_vote add shader intrinsics supported by all desktop vendors to improve functionality and performance GL_KHR_no_error reduces driver overhead by allowing the application to indicate that it expects error-free operation so errors need not be generated In addition to the above features being added to OpenGL 4.6, the following are being released as extensions:
      GL_KHR_parallel_shader_compile allows applications to launch multiple shader compile threads to improve shader compile throughput WGL_ARB_create_context_no_error and GXL_ARB_create_context_no_error allow no error contexts to be created with WGL or GLX that support the GL_KHR_no_error extension “I’m proud to announce OpenGL 4.6 as the most feature-rich version of OpenGL yet. We've brought together the most popular, widely-supported extensions into a new core specification to give OpenGL developers and end users an improved baseline feature set. This includes resolving previous intellectual property roadblocks to bringing anisotropic texture filtering and polygon offset clamping into the core specification to enable widespread implementation and usage,” said Piers Daniell, chair of the OpenGL Working Group at Khronos. “The OpenGL working group will continue to respond to market needs and work with GPU vendors to ensure OpenGL remains a viable and evolving graphics API for all its customers and users across many vital industries.“
      The OpenGL 4.6 specification can be found at https://khronos.org/registry/OpenGL/index_gl.php. The GLSL to SPIR-V compiler glslang has been updated with GLSL 4.60 support, and can be found at https://github.com/KhronosGroup/glslang.
      Sophisticated graphics applications will also benefit from a set of newly released extensions for both OpenGL and OpenGL ES to enable interoperability with Vulkan and Direct3D. These extensions are named:
      GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_memory_object_win32 GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_semaphore_win32 GL_EXT_win32_keyed_mutex They can be found at: https://khronos.org/registry/OpenGL/index_gl.php
      Industry Support for OpenGL 4.6
      “With OpenGL 4.6 our customers have an improved set of core features available on our full range of OpenGL 4.x capable GPUs. These features provide improved rendering quality, performance and functionality. As the graphics industry’s most popular API, we fully support OpenGL and will continue to work closely with the Khronos Group on the development of new OpenGL specifications and extensions for our customers. NVIDIA has released beta OpenGL 4.6 drivers today at https://developer.nvidia.com/opengl-driver so developers can use these new features right away,” said Bob Pette, vice president, Professional Graphics at NVIDIA.
      "OpenGL 4.6 will be the first OpenGL release where conformant open source implementations based on the Mesa project will be deliverable in a reasonable timeframe after release. The open sourcing of the OpenGL conformance test suite and ongoing work between Khronos and X.org will also allow for non-vendor led open source implementations to achieve conformance in the near future," said David Airlie, senior principal engineer at Red Hat, and developer on Mesa/X.org projects.

      View full story
    • By _OskaR
      Hi,
      I have an OpenGL application but without possibility to wite own shaders.
      I need to perform small VS modification - is possible to do it in an alternative way? Do we have apps or driver modifictions which will catch the shader sent to GPU and override it?
  • Advertisement